quant(fp8): bridge MXFP8 dense and NVFP4 experts - #76
Conversation
…d-MXFP8 dense support - store_dtype=nvfp4 now returns ModelOptNvFp4FusedMoE (registers w13_weight/w2_weight names the DeepSeek/GLM fused-experts loader expects; the earlier CompressedTensors method registers *_weight_packed and KeyErrors at load). - dense_format=mxfp8: FP8 checkpoints whose dense weights are serialized as MXFP8 (e4m3 values + per-32 ue8m0 uint8 scales, e.g. requantized offline from BF16 via mxfp8_e4m3_quantize) route LinearBase to a thin adapter over the compressed-tensors W8A8 MXFP8 scheme. ignored_layers keeps enumerated BF16 linears (routers, indexer heads, lm_head) on the unquantized path. Enables GLM-5.2-FP8-NVFP4experts and GLM-5.2-MXFP8dense-NVFP4experts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> (cherry picked from commit 4b55617)
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a new ChangesFP8 Quantization Method Extensions
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant LinearBase
participant Fp8Config
participant Mxfp8SerializedLinearMethod
participant CompressedTensorsW8A8Mxfp8
LinearBase->>Fp8Config: get_quant_method(layer)
Fp8Config->>Fp8Config: check dense_format == "mxfp8"
Fp8Config-->>LinearBase: Mxfp8SerializedLinearMethod()
LinearBase->>Mxfp8SerializedLinearMethod: create_weights / apply
Mxfp8SerializedLinearMethod->>CompressedTensorsW8A8Mxfp8: delegate scheme methods
sequenceDiagram
participant RoutedExperts
participant Fp8Config
participant ModelOptNvFp4Config
participant ModelOptNvFp4FusedMoE
RoutedExperts->>Fp8Config: get_quant_method(layer)
Fp8Config->>Fp8Config: check store_dtype == "nvfp4"
Fp8Config->>ModelOptNvFp4Config: construct nv_cfg
Fp8Config-->>RoutedExperts: ModelOptNvFp4FusedMoE(nv_cfg, moe_config)
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Adds the missing FP8 checkpoint bridge for GLM-style hybrid checkpoints:
dense_format=mxfp8routes dense LinearBase weights through the serialized MXFP8 compressed-tensors method.store_dtype=nvfp4routes MoE experts through the ModelOpt NVFP4 fused MoE method instead of the generic FP8 MoE path.This is the runtime patch already present in the GLM 5.2 sweep image and is required for offline checkpoints such as
GLM-5.2-MXFP8dense-NVFP4experts/GLM-5.2-FP8-NVFP4experts.Validation
python3 -m py_compile vllm/model_executor/layers/quantization/fp8.pygit diff --checkSummary by CodeRabbit
New Features
Bug Fixes