Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

completing a phase #43

Closed
wants to merge 8 commits into from
Closed

completing a phase #43

wants to merge 8 commits into from

Conversation

JeffreySarnoff
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Sep 25, 2022

Codecov Report

Attention: Patch coverage is 12.50000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 64.94%. Comparing base (3953e14) to head (663b207).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/bfloat16.jl 12.50% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #43      +/-   ##
==========================================
- Coverage   66.66%   64.94%   -1.72%     
==========================================
  Files           3        3              
  Lines         186      194       +8     
==========================================
+ Hits          124      126       +2     
- Misses         62       68       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ViralBShah
Copy link
Member

Do we want to get this merged?

@JeffreySarnoff
Copy link
Member Author

JeffreySarnoff commented Jan 31, 2024

I resolved the conflicts.
It should merge. I merged the resolved conflicts, or tried to do so -- it is taking forever.

@JeffreySarnoff
Copy link
Member Author

here are the resolutions
https://github.com/JuliaMath/BFloat16s.jl/pull/43/conflicts

@ViralBShah
Copy link
Member

This PR still shows 3 files with conflicts. No merge button.

@ViralBShah
Copy link
Member

@oscardssmith @maleadt Since you guys have been on a tear - what about this one?

Base.atan(y::BFloat16, x::BFloat16) = BFloat16(atan(Float32(y), Float32(x)))
Base.hypot(x::BFloat16, y::BFloat16) = BFloat16(hypot(Float32(x), Float32(y)))
Base.hypot(x::BFloat16, y::BFloat16, z::BFloat16) = BFloat16(hypot(Float32(x), Float32(y), Float32(z)))
Base.clamp(x::BFloat16, lo::BFloat16, hi::BFloat16) = BFloat16(clamp(Float32(x), Float32(lo), Float32(hi)))
Copy link
Member

@maleadt maleadt Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitions like this are not beneficial. The generic definitions work fine already: https://github.com/JuliaLang/julia/blob/48ddd2dc2859f41fc1a82876cc5654fb31d7b2ba/base/intfuncs.jl#L1269-L1272

julia> clamp(BFloat16(5), BFloat16(5.5), BFloat16(6.5))
BFloat16(5.5)

By eagerly demoting to FLoat32 you're making it impossible for LLVM to emit instructions that would support operations like this, which is now possible after JuliaLang/julia#55486.

Similar arguments can be made for other operations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so this pre-dates the LLVM support. Should we clean up this package and perhaps remove the other operations of this nature?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing this PR in that case.

@ViralBShah ViralBShah closed this Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants