You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Questions about test_float8_blockwise_gemm_exact.py #2828
Hello :
We notice that the ref function in float8_blockwise_gemm is torch._scaled_mm, however torch._scaled_mm may call cublasLtMatmul , which is same to what TE blockwise gemm calls.
So I'm confused that this utest will pass even when the blas gemm returns wrong result. What is the purpose of this utest?
You're right that this test assumes the underlying 128×128 unscaled FP8 cublasLtMatmul is correct (end-to-end numerical checks against a high-precision reference live in tests/pytorch/test_numerics.py).
However, test_float8_blockwise_gemm_exact.py does not compare the same kernel against itself:
TE runs the block-scaled cuBLASLt GEMM path (tex.generic_gemm) with 1D/2D block scaling and fused epilogues (bias, accumulate, GELU/dGELU).
The reference (CuBLASRefBlockwiseGemm) only uses per-tensor torch._scaled_mm with unit scales (1.0) per 128×128 tile so that hardware FP8 QMMA rounding matches for a bit-exact (atol=0, rtol=0) check. All blockwise scale decoding (CuBLASScaleMunger), per-block scaling, and K-tile FP32 FMA accumulation (fused_fma) are computed independently.
So the purpose of this test is to verify TE's blockwise scale packing/swizzling, rowwise/columnwise handling, cuBLASLt block-scaling descriptor wiring, fused epilogues, and constraint checks bit-for-bit.
Closing as answered — feel free to reopen if you have follow-up questions.
Activity
pggPL commentedon Dec 1, 2026
Apologies for the delayed response!
You're right that this test assumes the underlying 128×128 unscaled FP8
cublasLtMatmulis correct (end-to-end numerical checks against a high-precision reference live intests/pytorch/test_numerics.py).However,
test_float8_blockwise_gemm_exact.pydoes not compare the same kernel against itself:tex.generic_gemm) with 1D/2D block scaling and fused epilogues (bias,accumulate,GELU/dGELU).CuBLASRefBlockwiseGemm) only uses per-tensortorch._scaled_mmwith unit scales (1.0) per 128×128 tile so that hardware FP8 QMMA rounding matches for a bit-exact (atol=0, rtol=0) check. All blockwise scale decoding (CuBLASScaleMunger), per-block scaling, and K-tile FP32 FMA accumulation (fused_fma) are computed independently.So the purpose of this test is to verify TE's blockwise scale packing/swizzling, rowwise/columnwise handling, cuBLASLt block-scaling descriptor wiring, fused epilogues, and constraint checks bit-for-bit.
Closing as answered — feel free to reopen if you have follow-up questions.