Repository navigation
Mixed-precision FP8 × INT4 (W4A8) inference quantizes activations (A) to float8_e4m3fn or float8_e5m2 and weights (B) to int4 while executing on the FP8 matrix unit with float32 accumulation. Previously, gemm_quantized accepted only a single quant_dtype applied identically to both operands. - #164
Open
copybara-service[bot] wants to merge 1 commit into
Open
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
copybara-service
Bot
force-pushed
the
test_1022545780
branch
3 times, most recently
from
November 17, 2026 05:30
f014f3f to
da84ee4
Compare
… (`A`) to `float8_e4m3fn` or `float8_e5m2` and weights (`B`) to `int4` while executing on the `FP8` matrix unit with `float32` accumulation. Previously, `gemm_quantized` accepted only a single `quant_dtype` applied identically to both operands. * Add `rhs_quant_dtype` to `QuantizedGemmParams` in `benchmarks/matmul.py` (defaulting to `quant_dtype`, including across `with_generation_defaults()`, and accepting `"int4"` when `quant_dtype` is `"float8_e4m3fn"` or `"float8_e5m2"`). * Quantize `B` to `rhs_quant_dtype` in `QuantizedGemmBenchmark.setup()` while keeping `float32` accumulation and the `quant_dtype` MXU roofline ceiling whenever `A` is `FP8`. * Include `rhs_quant_dtype` in `QuantizedGemmBenchmark.REPORT_SCHEMA` and append `_rhs_<rhs_quant_dtype>` in `get_run_identifier()` when `rhs_quant_dtype` differs from `quant_dtype`. * Add TPU + XProf hardware test coverage (`QuantizedGemmBenchmarkTest`) in `tests/test_matmul_tpu.py` verifying on-device XProf execution and mixed-precision `FP8 × INT4` HLO dtypes. PiperOrigin-RevId: 1022545780
copybara-service
Bot
force-pushed
the
test_1022545780
branch
from
November 17, 2026 06:52
da84ee4 to
3e24a57
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.
Mixed-precision
FP8 × INT4(W4A8) inference quantizes activations (A) tofloat8_e4m3fnorfloat8_e5m2and weights (B) toint4while executing on theFP8matrix unit withfloat32accumulation. Previously,gemm_quantizedaccepted only a singlequant_dtypeapplied identically to both operands.rhs_quant_dtypetoQuantizedGemmParamsinbenchmarks/matmul.py(defaulting toquant_dtype, including acrosswith_generation_defaults(), and accepting"int4"whenquant_dtypeis"float8_e4m3fn"or"float8_e5m2").Btorhs_quant_dtypeinQuantizedGemmBenchmark.setup()while keepingfloat32accumulation and thequant_dtypeMXU roofline ceiling wheneverAisFP8.rhs_quant_dtypeinQuantizedGemmBenchmark.REPORT_SCHEMAand append_rhs_<rhs_quant_dtype>inget_run_identifier()whenrhs_quant_dtypediffers fromquant_dtype.QuantizedGemmBenchmarkTest) intests/test_matmul_tpu.pyverifying on-device XProf execution and mixed-precisionFP8 × INT4HLO dtypes.