fix: use disable_ue8m0_cast for FP8 GEMM on Blackwell (sm_100) - #255
Open
Andrewxu313 wants to merge 1 commit into
Open
fix: use disable_ue8m0_cast for FP8 GEMM on Blackwell (sm_100)#255Andrewxu313 wants to merge 1 commit into
Andrewxu313 wants to merge 1 commit into
Conversation
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>
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.
Description
w8a16_gemmnow passesdisable_ue8m0_cast=Truetodeep_gemm.fp8_gemm_nt. Also fixesw8a16_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_ntdefaults to the UE8M0/MXFP8 scale path, which requires power-of-2 (UE8M0) scale factors. Ouract_quant/ checkpointscale_invare regular float blockwise scales, so the kernel returned all-NaN — GLM-5.1-FP8 produced"!!!!"on B200.disable_ue8m0_cast=Trueselects DeepGEMM's regular blockwise-FP8 (1d2d) kernel that accepts these scales (matchesgemm/w8a8_deepgemm.py; no-op on Hopper). Verified end-to-end: coherent GLM-5.1-FP8 generation on 8×B200.Type of Change
Checklist