Skip to content

Questions about test_float8_blockwise_gemm_exact.py #2828

Done

Description

@dinghaodhd

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?

Activity

  1. added
    question
    on Apr 6, 2026
  2. pggPL commented on Dec 1, 2026

    @pggPL
    Collaborator

    Apologies for the delayed response!

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions