Repository navigation
[Quantization] Consolidate MXFP8 Linear and GroupedExperts converters - #3473
Merged
yichuan-w merged 1 commit intoJun 1, 2026
Merged
Conversation
yichuan-w
requested review from
fegin,
tianyu-l,
wconstab and
wwwjn
as code owners
June 1, 2026 04:04
yichuan-w
marked this pull request as draft
June 1, 2026 04:05
yichuan-w
force-pushed
the
yichuan/consolidate-mxfp8-converters
branch
from
June 1, 2026 04:18
0d5509a to
fb4e87c
Compare
yichuan-w
marked this pull request as ready for review
June 1, 2026 04:34
yichuan-w
force-pushed
the
yichuan/consolidate-mxfp8-converters
branch
from
June 1, 2026 04:42
fb4e87c to
dbf0ef9
Compare
tianyu-l
reviewed
Jun 1, 2026
|
|
||
| class MXFP8GroupedExpertsConverter(QuantizationConverter): | ||
| """Apply MXFP8 quantization to MoE expert grouped GEMMs.""" | ||
| class MXFP8Converter(QuantizationConverter): |
Contributor
There was a problem hiding this comment.
Why converting both in one converter class? This will couple linear and grouped experts, both converted or both not converted.
For now I think we can follow https://github.com/pytorch/torchtitan/blob/main/torchtitan/components/quantization/float8.py
yichuan-w
force-pushed
the
yichuan/consolidate-mxfp8-converters
branch
from
June 1, 2026 05:56
dbf0ef9 to
6db1807
Compare
tianyu-l
reviewed
Jun 1, 2026
| self.config = config | ||
|
|
||
| if find_spec("torchao") is None: | ||
| if MXFP8Linear is None: |
| field compatibility. | ||
| """ | ||
|
|
||
| _recipe_name: str = "mxfp8_rceil" |
Contributor
There was a problem hiding this comment.
@danielvegamyhre
Does it look OK that recipe is removed from config with MXFP8Linear?
yichuan-w
force-pushed
the
yichuan/consolidate-mxfp8-converters
branch
from
June 1, 2026 07:33
6db1807 to
203ccf2
Compare
Migrate MXFP8Linear to use torchao's native MXFP8Linear (pytorch/ao#4374) instead of Linear + quantize_(), following the same pattern as Float8Linear. Also fix has_quantization() to handle MXFP8Linear being None when torchao is not installed, and change assert to ValueError for SM100 capability check. Fixes pytorch/torchtitan#3219
yichuan-w
force-pushed
the
yichuan/consolidate-mxfp8-converters
branch
from
June 1, 2026 07:35
203ccf2 to
6363521
Compare
tianyu-l
approved these changes
Jun 1, 2026
saforem2
added a commit
to saforem2/torchtitan
that referenced
this pull request
Jun 2, 2026
…orch#3436 thread Merged 7 upstream commits (b72d986..04a3098). Headline is PR pytorch#3450 — the upstream-canonical fix for the histc->scatter swap that our PR pytorch#3436 was tracking. Approach: build boolean routing_map_BLE via scatter_ in router, compute num_tokens_per_expert via routing_map.sum, thread the map through to dispatcher. Same scatter direction we recommended, done better (computed once, reused). API change at the boundary: router returns 4-tuple; dispatch() takes new num_local_tokens_per_expert_E positional arg. ezpz doesn't override these methods or unpack router output directly, inherits cleanly. set_moe_sharding_config call into upstream's helper picks up the new shard declaration automatically. No ezpz replay needed. Other 6 commits: HybridEP compile (pytorch#3360), MXFP8 consolidation (pytorch#3473), graph_trainer DTensor fix (pytorch#3480), graph_trainer test skips (pytorch#3432), two CI migrations (pytorch#3464, pytorch#3479). None touch ezpz. Live 2N smoke deferred to Aurora: the project .venv/bin/python symlinks at an Aurora-only Spack hash (python-3.12.12-5zo3wzv) that Sunspot doesn't have (Sunspot equivalent is the nvje3vk hash). Smoke per the journal's "always smoke after GroupedExperts touches" lesson should run on Aurora. Also: updated ~/.ezpz/utils.sh from bit.ly canonical (now exposes unified ezpz_setup; backup at utils.sh-20260602-065437).
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.
Migrate MXFP8Linear to use torchao's native MXFP8Linear (pytorch/ao#4374) instead of Linear + quantize_(), following the same pattern as Float8Linear.
Merge MXFP8LinearConverter and MXFP8GroupedExpertsConverter into a single MXFP8Converter that handles both Linear and GroupedExperts in one pass. For dense models (no GroupedExperts), the MoE traversal is a no-op.
Fixes #3219