[feat] add MXFP8 support on H3 - #1796
Conversation
|
This PR has merge conflicts with the base branch. Please rebase: git fetch origin main
git rebase origin/main
# Resolve any conflicts, then:
git push --force-with-lease |
Merge Protections🔴 1 of 1 protections blocking · waiting on 🤖 CI
🔴 PR merge requirementsWaiting for
This rule is failing.
|
Pre-commit checks failedHi @Davids048, the pre-commit checks have failed. To fix them locally: # Install pre-commit if you haven't already
uv pip install pre-commit
pre-commit install
# Run all checks and auto-fix what's possible
pre-commit run --all-filesCommon fixes:
After fixing, commit and push the changes. The checks will re-run automatically. For future commits, |
2 similar comments
Pre-commit checks failedHi @Davids048, the pre-commit checks have failed. To fix them locally: # Install pre-commit if you haven't already
uv pip install pre-commit
pre-commit install
# Run all checks and auto-fix what's possible
pre-commit run --all-filesCommon fixes:
After fixing, commit and push the changes. The checks will re-run automatically. For future commits, |
Pre-commit checks failedHi @Davids048, the pre-commit checks have failed. To fix them locally: # Install pre-commit if you haven't already
uv pip install pre-commit
pre-commit install
# Run all checks and auto-fix what's possible
pre-commit run --all-filesCommon fixes:
After fixing, commit and push the changes. The checks will re-run automatically. For future commits, |
Pre-commit checks failedHi @Davids048, the pre-commit checks have failed. To fix them locally: # Install pre-commit if you haven't already
uv pip install pre-commit
pre-commit install
# Run all checks and auto-fix what's possible
pre-commit run --all-filesCommon fixes:
After fixing, commit and push the changes. The checks will re-run automatically. For future commits, |
9030a06 to
0fe2db3
Compare
|
Rebased onto current origin/main to pick up the main-side FastH3 loader/CLI and unit-test fixes; no content changes (range-diff clean, with only the already-upstreamed h3-sequential-load hunk absorbed by main). |
Pre-commit checks failedHi @Davids048, the pre-commit checks have failed. To fix them locally: # Install pre-commit if you haven't already
uv pip install pre-commit
pre-commit install
# Run all checks and auto-fix what's possible
pre-commit run --all-filesCommon fixes:
After fixing, commit and push the changes. The checks will re-run automatically. For future commits, |
SolitaryThinker
left a comment
There was a problem hiding this comment.
Requesting changes based on the implementation review; CI-only failures are intentionally omitted. The main blockers are distributed/FSDP correctness, LoRA lifecycle correctness, and missing non-skip MXFP8 parity. I also left a dependency-declaration comment. I reviewed the component, loader, LoRA integration, and quality/evidence lanes. Blackwell numerical validation could not be run in my local environment.
Reject LoRA unmerge after MXFP8 or NVFP4 quantization because the quantized weights would not reflect the unmerged BF16 weights. Reject runtime adapter changes when default NVFP4 has removed the BF16 weights. Keep adapter switching enabled when the BF16 weights remain available and the changed weights can be requantized. Detailed behavior: | Public operation | MXFP8 | Default NVFP4 | | ---------------------- | ----------------------- | -------------------- | | unmerge_lora_weights() | Explicitly rejected | Explicitly rejected | | set_lora_adapter() | Allowed and requantized | Explicitly rejected | Add TODOs for supporting unmerge through BF16 weight preservation and requantization. Add lifecycle tests for the rejection paths and MXFP8 adapter-switch requantization.
Pre-commit checks failedHi @Davids048, the pre-commit checks have failed. To fix them locally: # Install pre-commit if you haven't already
uv pip install pre-commit
pre-commit install
# Run all checks and auto-fix what's possible
pre-commit run --all-filesCommon fixes:
After fixing, commit and push the changes. The checks will re-run automatically. For future commits, |
SolitaryThinker
left a comment
There was a problem hiding this comment.
Re-reviewed the latest head against both origin/main and the prior reviewed commit. All four requested changes are addressed: the FastH3 extra directly pins Quack, unsupported FSDP-inference quantization is rejected before model construction, the packed-weight LoRA lifecycle is explicitly guarded with MXFP8 adapter changes requantized, and Blackwell numerical parity now covers activation/scales, fused SwiGLU, and the full H3 FFN. The author also reported a 4-pass GB200 run and 20 matched BF16/MXFP8 generations with no visible quality regression. No new blocking code findings. Per maintainer direction, CI status was not considered. I could not independently rerun Blackwell kernels locally; the MXFP8 sample attachment currently returns 404 and should be reattached for the record, but this is non-blocking given the recorded numerical and visual evidence.
Purpose
Add Blackwell MXFP8 inference for the two linear layers in every MiniMax-H3 transformer feed-forward network
(FFN). The FFN accepts BF16 hidden states, executes both matrix multiplications with MXFP8 values and E8M0
block scales, and returns BF16 hidden states.
Changes
fc_inandfc_outlayers. Weights are quantized aftercheckpoint loading and LoRA merging.
The FFN dtype flow is:
Enable the path with:
Test Plan
Profile one 345-frame FastH3 generation after three warmup generations:
The MXFP8 run used this command. The BF16 totals came from predecessor run
20260831T004438Z-4009913, whichused the same profile settings with transformer quantization disabled.
Profile configuration:
vsa-datafreeLoRA, 5 scheduler points, seed 1000Test Results
Summed GPU kernel time inside the same 800 FFN NVTX ranges:
fc_infc_outMXFP8 reduces summed FFN kernel time by 31.21% in this profile. For the single measured generation in each
format, output-tensor production took 17.84 seconds with MXFP8 and 18.15 seconds with BF16. Including frame
postprocessing and media saving, elapsed latency was 19.33 seconds with MXFP8 and 19.53 seconds with BF16. One
measurement per format does not establish run-to-run variability. The run artifacts do not record a commit ID
or source hashes, so the exact profiled source snapshot is unverified.
Checklist
pre-commit run --all-filesand fixed all issuesFor model/pipeline changes: