Skip to content

[docs] Fix the Flux MXFP8 example to use converters - #5012

Merged
tianyu-l merged 3 commits into
pytorch:mainfrom
YeonwooSung:pr/docs-flux-mxfp8-converters
Oct 2, 2026
Merged

tianyu-l merged 3 commits into
pytorch:mainfrom
YeonwooSung:pr/docs-flux-mxfp8-converters

Conversation

@YeonwooSung

Copy link
Copy Markdown
Contributor

The custom MXFP8 example in torchtitan/models/flux/README.md cannot be copied. It assigns config.model_converters = ModelConvertersContainer.Config(...), but ModelConvertersContainer is not defined, so that line raises NameError. Trainer.Config and FluxTrainer.Config also have no model_converters attribute, so the assignment would raise AttributeError even if the name existed.

flux_schnell_mxfp8 and flux_dev_mxfp8 do not use that API. _enable_mxfp8 in torchtitan_recipes/models/flux.py rebuilds the model with build_model_config(flavor, converters=[MXFP8LinearConverter.Config(fqns=[...])]). build_model_config in torchtitan/models/flux/flavors.py takes converters, not quantization or model_converters. The example now does the same assignment, imports the names it uses, and keeps the recipe FQNs: double_blocks, single_blocks, img_in, txt_in, time_in, vector_in, and final_layer.

Test plan

  • /tmp/ttenv/bin/python -m pytest tests/unit_tests/cpu/test_flux_mxfp8_readme.py -q

@pytorch-bot pytorch-bot Bot added the ciflow/fake-pg Run 1-GPU Fake PG integration tests label Oct 2, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 2, 2026
@pytorch-bot

pytorch-bot Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Workflows were awaiting approval. CI has now been triggered for the ciflow labels on this PR.

@tianyu-l

tianyu-l commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

ci failure

@tianyu-l
tianyu-l merged commit f34295b into pytorch:main Oct 2, 2026
@YeonwooSung
YeonwooSung deleted the pr/docs-flux-mxfp8-converters branch October 2, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/fake-pg Run 1-GPU Fake PG integration tests CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants