Repository navigation
EncodeTileInt8 (INT8 and INT8_TWO_TRANSPOSITIONS) and EncodeTileInt8VNNI - #1055
Merged
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_997791704
branch
3 times, most recently
from
October 12, 2026 11:28
4b0c64e to
7326b8f
Compare
…t8VNNI` stored each token's scale as bf16 but quantized with `1 / scale` from the unrounded float scale. Decoding multiplies by the stored bf16 scale, so values near the absmax could decode up to ~0.75 of a quantization step off instead of at most 0.5. Quantize with the stored scale instead, as `tiled_attention.cc` (when it writes int8 tiles) and `EncodeTileInt8MatrixAccumulation` already do. This only changes the int8 values of affected tokens; the layout and scales are unchanged. Add a test that the encode/decode error of every int8 encoding is within half a step. It fails for the three fixed encoders without this change. PiperOrigin-RevId: 997838762
copybara-service
Bot
force-pushed
the
test_997791704
branch
from
October 12, 2026 11:45
7326b8f to
985c6f9
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.
EncodeTileInt8(INT8 and INT8_TWO_TRANSPOSITIONS) andEncodeTileInt8VNNIstored each token's scale as bf16 but quantized with
1 / scalefrom theunrounded float scale. Decoding multiplies by the stored bf16 scale, so values
near the absmax could decode up to ~0.75 of a quantization step off instead of
at most 0.5.
Quantize with the stored scale instead, as
tiled_attention.cc(when it writesint8 tiles) and
EncodeTileInt8MatrixAccumulationalready do. This onlychanges the int8 values of affected tokens; the layout and scales are
unchanged.
Add a test that the encode/decode error of every int8 encoding is within half a
step. It fails for the three fixed encoders without this change.