Add bf16 avx2 8bit dequant and Nbit dequant#5634
Open
cyyever wants to merge 6 commits into
Open
Conversation
Contributor
|
@q10 has imported this pull request. If you are a Meta employee, you can view this in D100932926. |
Contributor
|
@cyyever looks like the CPU huilds are failing |
Contributor
Author
13bb9db to
48c01f8
Compare
Contributor
Author
|
@q10 rebased it |
Contributor
|
@cyyever looks like there are still build failures |
Contributor
Author
|
@q10 I have interesting findings |
48c01f8 to
a808f38
Compare
a808f38 to
4ccc4b6
Compare
4ccc4b6 to
bcdc3bf
Compare
Contributor
Author
|
@q10 I have relaxed the comparison error bounds |
q10
reviewed
Apr 24, 2026
q10
reviewed
Apr 24, 2026
q10
reviewed
Apr 24, 2026
q10
reviewed
Apr 24, 2026
40ab93c to
12bbd45
Compare
Ref path computes in double precision while AVX2 path uses fp32 FMA; results may differ by ~1 fp32 ULP which can cross a bf16 bucket boundary, so bit-exact EXPECT_EQ is too strict. Compare as float with ~2 bf16 ULPs tolerance.
…utput path The SVE dispatcher in FusedNBitRowwiseQuantizedSBHalfToFloatOrHalf was silently dropping the is_uint16_t_of_type_bf16 template parameter, so on SVE hardware a <float16, /*bf16=*/true> call produced fp16-formatted bits where bf16 was expected. Thread a bool IS_BF16_OUT template arg through FusedNBitRowwiseQuantizedSBHalfToFloatOrHalfNeon and add a NEON bf16 write-out branch using the same round-to-nearest-ties-to-even formula as Bf16ConvertAvx2.h (val + ((val>>16)&1) + 0x7FFF, take high 16 bits).
4141f97 to
b1b1739
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.