Skip to content

fix: use disable_ue8m0_cast for FP8 GEMM on Blackwell (sm_100) - #255

Open
Andrewxu313 wants to merge 1 commit into
mainfrom
fix/blackwell-fp8-disable-ue8m0-cast
Open

fix: use disable_ue8m0_cast for FP8 GEMM on Blackwell (sm_100)#255
Andrewxu313 wants to merge 1 commit into
mainfrom
fix/blackwell-fp8-disable-ue8m0-cast

Conversation

@Andrewxu313

Copy link
Copy Markdown
Contributor

Description

w8a16_gemm now passes disable_ue8m0_cast=True to deep_gemm.fp8_gemm_nt. Also fixes w8a16_gemm_dequant's 3D reshape to use the explicit N dim instead of -1 (ambiguous for empty / 0-token sub-batches).

Motivation

On Blackwell (sm_100), deep_gemm.fp8_gemm_nt defaults to the UE8M0/MXFP8 scale path, which requires power-of-2 (UE8M0) scale factors. Our act_quant / checkpoint scale_inv are regular float blockwise scales, so the kernel returned all-NaN — GLM-5.1-FP8 produced "!!!!" on B200. disable_ue8m0_cast=True selects DeepGEMM's regular blockwise-FP8 (1d2d) kernel that accepts these scales (matches gemm/w8a8_deepgemm.py; no-op on Hopper). Verified end-to-end: coherent GLM-5.1-FP8 generation on 8×B200.

Type of Change

  • Bug fix

Checklist

  • I have read the CONTRIBUTION guide.
  • I have updated the tests (verified via isolated B200 numeric check + e2e GLM run; no unit test added).
  • I have updated the documentation (root-cause recorded in the design repo).

w8a16_gemm had disable_ue8m0_cast dropped, so deep_gemm.fp8_gemm_nt defaulted to the UE8M0/MXFP8 scale path on sm_100, which needs power-of-2 scales we don't supply -> all-NaN (GLM-5.1-FP8 emitted '!!!!' on B200). Pass disable_ue8m0_cast=True (DeepGEMM's regular blockwise-FP8 path; matches w8a8_deepgemm; no-op on Hopper). Also fix w8a16_gemm_dequant's 3D reshape to use the explicit N dim instead of -1 (ambiguous for empty/0-token sub-batches). Verified: coherent GLM-5.1-FP8 generation on 8xB200.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Andrewxu313 <Andrewxu313@users.noreply.github.com>
@github-actions github-actions Bot added the ci:run Trigger build + GPU regression on H20 label Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run Trigger build + GPU regression on H20

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant