feat(flux): torch.compile + DDP-overlap compile patches#815
Merged
Conversation
ed473ee to
baa615b
Compare
wenxie-amd
previously approved these changes
Jul 13, 2026
wenxie-amd
approved these changes
Jul 14, 2026
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.
Part of an 18-PR series splitting the Flux diffusion-training feature (training Flux, a DiT text-to-image diffusion model, on Primus/Megatron) out of one large branch for reviewability. Targets
feat/flux/fluxand also mergesfeat/flux/turbo— review after both.What this changes
The
torch.compileand DDP-overlap-compile patches for the Flux model, plus the compile / graph-break tests and the two backend-selection / TE-vs-local-spec tests (which top-level-import turbo modules).Why it has two parents
The source only needs the turbo layer, but the co-located tests run the full compiled model under FSDP2 — importing the Flux model (
feat/flux/flux) and the fp8 all-gather (viafeat/flux/turbo→feat/flux/opt).Dependencies
Builds on the CI-pins PR (
feat/flux/ci-env) — it carries the required bumped Primus-Turbo pin for the CK launch path; that PR merges first. Also builds onfeat/flux/flux+feat/flux/turbo. (NoMEGATRON_PATHdependency: the compiled-vs-eager test runs in-process via a Dynamo reset before each compiled build, and the conftest puts the recursively-checked-out Megatron submodule onsys.path.)Test plan
pytest tests/unit_tests/backends/megatron/diffusion -k "compile or backend_selection or te_vs_local". Validated locally on an AMD GPU container: 41 passed (incl. the in-processtest_compiled_local_vs_eager/test_te_eager_vs_local_compiled, confirmed passing with no Megatron entry onPYTHONPATH).Files
7 (compile + DDP-overlap patches, compile/graph-break + backend-selection tests).