Repository navigation
🚨 MXFP4 on the fine-grained machinery, and DeepSeek-V4's FP8 + MXFP4 plan - #49778
Draft
IlyasMoutawwakil wants to merge 15 commits into
Draft
IlyasMoutawwakil wants to merge 15 commits into
IlyasMoutawwakil wants to merge 15 commits into
Conversation
IlyasMoutawwakil
force-pushed
the
fg-split/6-mxfp4
branch
from
October 20, 2026 11:08
0e0531a to
ae62b38
Compare
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
IlyasMoutawwakil
force-pushed
the
fg-split/6-mxfp4
branch
from
October 20, 2026 11:20
ae62b38 to
5b3c910
Compare
IlyasMoutawwakil
force-pushed
the
fg-split/6-mxfp4
branch
from
October 20, 2026 13:33
5b3c910 to
f41b6f5
Compare
This was referenced Oct 20, 2026
IlyasMoutawwakil
force-pushed
the
fg-split/6-mxfp4
branch
from
October 20, 2026 14:35
f41b6f5 to
d0129d7
Compare
IlyasMoutawwakil
force-pushed
the
fg-split/6-mxfp4
branch
from
October 20, 2026 15:30
d0129d7 to
b1979e6
Compare
IlyasMoutawwakil
force-pushed
the
fg-split/6-mxfp4
branch
2 times, most recently
from
October 20, 2026 16:04
4991a3b to
b6b3074
Compare
IlyasMoutawwakil
force-pushed
the
fg-split/6-mxfp4
branch
from
October 20, 2026 16:25
b6b3074 to
d106975
Compare
IlyasMoutawwakil
force-pushed
the
fg-split/6-mxfp4
branch
2 times, most recently
from
October 20, 2026 17:34
3837fca to
a1dd17d
Compare
This was referenced Oct 20, 2026
IlyasMoutawwakil
force-pushed
the
fg-split/6-mxfp4
branch
from
October 21, 2026 12:22
9c003af to
f8f9371
Compare
IlyasMoutawwakil
force-pushed
the
fg-split/6-mxfp4
branch
from
October 21, 2026 13:52
f8f9371 to
d9efb5b
Compare
IlyasMoutawwakil
force-pushed
the
fg-split/6-mxfp4
branch
2 times, most recently
from
October 22, 2026 07:00
0eb9021 to
1aafb73
Compare
IlyasMoutawwakil
force-pushed
the
fg-split/6-mxfp4
branch
2 times, most recently
from
October 22, 2026 07:18
1aafb73 to
ba15098
Compare
IlyasMoutawwakil
force-pushed
the
fg-split/6-mxfp4
branch
from
October 23, 2026 13:03
ba15098 to
0b94bcb
Compare
…plan - Mxfp4Config / Mxfp4HfQuantizer become a block-scaled format: W4A16 (the default, how GPT-OSS runs), W4A8 or W4A4, GPT-OSS's blocks/scales layout and the modelopt one; integrations/mxfp4 is frozen. - DeepSeek-V4: DeepseekV4Config.adapt_quantization_config reads expert_dtype="fp4" (model or quantization config) into FP8 linears over MXFP4 experts (Fp8Config.with_mxfp4_experts), in DeepSeek's own "deepseek" producer layout (block scales shipped as `scale`); its conversion mapping names the checkpoint's own keys so a save writes them back. - Tests: the MXFP4 suite, the DeepSeek-V4 plan and the FP8 + MXFP4 mixed fixtures of the shared testers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plan tests no longer expect a passed config to merge silently. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On SM100 the experts hold the Triton layout, which DeepGEMM's grouped experts refuse. The FP8-Base sweep keeps DeepGEMM off SM100, where block-FP8 gate|up stay stacked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pgemm_linear Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fine-grained kernels need Triton's FP8 type. GPT-OSS on a T4 or an A100 would otherwise dequantize, and GPT-OSS-120B no longer fits an A100 80GB in bf16. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An fp8 checkpoint with expert_dtype fp4 reads as block FP8 with W4A4 MXFP4 experts, for V4 and V4.1 alike. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A passed Fp8Config quantizes every module to FP8. The fixture wants DeepSeek-V4's MXFP4 experts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IlyasMoutawwakil
force-pushed
the
fg-split/6-mxfp4
branch
from
October 23, 2026 13:35
0b94bcb to
b0750fd
Compare
Contributor
|
[For maintainers] Suggested jobs to run (before merge) run-slow: deepseek_v4, finegrained, fp8, mxfp4 |
1 of 6 tasks
This branch has not been deployed
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.
What.
Mxfp4ConfigandMxfp4HfQuantizerbecome a block-scaled format: W4A16 (the default, as GPT-OSS runs), W4A8 orW4A4. This moves MXFP4 onto the shared kernels and loaders that FP8 uses since FP8 on the fine-grained machinery (
Fp8Config) #49777._blocks/_scaleslayout (openai/gpt-oss-20b).Mxfp4Configkeepsmain's positional arguments. The frozen
integrations/mxfp4stays for main's behaviours.read_fp8builds DeepSeek-V4's plan when the FP8 checkpoint saysexpert_dtype="fp4": block FP8 over W4A4 MXFP4experts. V4.1 ships
expert_dtypein its quantization config. V4 sets it on the model config, soDeepseekV4Config.__post_init__moves it into the quantization config, with the"deepseek"layout. The Hubconfig (deepseek-ai/DeepSeek-V4-Flash) only says
fp8, so only the model knows its scales are namedscale.Behaviour changes.
experts_implementation="deepgemm"at load. Switching to it after aTriton load raises, so the SM100 test sweeps leave it out.
deepgemm_megamoeworks as before.8.9, such as an A100 or a T4,
Mxfp4Configloads through main's MXFP4 quantizer, kept frozen asMxfp4LegacyHfQuantizer.kernelspackage still dequantizes a checkpoint.quantization_configholds more fields.Breaking. 🚨 GPT-OSS MXFP4 with
use_kernels=Truenow loads dequantized on CPU too.use_kernelsputs the megablocks layer onGptOssMLP, and that layer reads bf16 experts. So an MXFP4 model withuse_kernels=Truedequantizes its experts, on every device. Main did this on GPU only.that class, so the CPU case follows the same rule as the GPU one.
Depends on. #49777. It needs FP8 for DeepSeek-V4.
How tested.
tests/quantization/mxfp4, the DeepSeek-V4 plan tests intests/quantization/finegrained, GPT-OSSand DeepSeek-V4 model tests.
The comments and docstrings that say why each change exists are there for readability. Feel free to ask for any of
them to go if it's self-evident.
🤖 Generated with Claude Code