Skip to content

feat(flux): torch.compile + DDP-overlap compile patches#815

Merged
wenxie-amd merged 5 commits into
mainfrom
feat/flux/compile
Jul 14, 2026
Merged

feat(flux): torch.compile + DDP-overlap compile patches#815
wenxie-amd merged 5 commits into
mainfrom
feat/flux/compile

Conversation

@jasainio

Copy link
Copy Markdown
Contributor

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/flux and also merges feat/flux/turbo — review after both.

What this changes

The torch.compile and 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 (via feat/flux/turbofeat/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 on feat/flux/flux + feat/flux/turbo. (No MEGATRON_PATH dependency: 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 on sys.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-process test_compiled_local_vs_eager/test_te_eager_vs_local_compiled, confirmed passing with no Megatron entry on PYTHONPATH).

Files

7 (compile + DDP-overlap patches, compile/graph-break + backend-selection tests).

@luiza-amd luiza-amd force-pushed the feat/flux/compile branch from ed473ee to baa615b Compare July 13, 2026 06:38
@luiza-amd luiza-amd changed the base branch from feat/flux/flux to main July 13, 2026 06:39
@luiza-amd luiza-amd marked this pull request as ready for review July 13, 2026 06:57
@luiza-amd luiza-amd marked this pull request as draft July 13, 2026 06:57
wenxie-amd
wenxie-amd previously approved these changes Jul 13, 2026
@luiza-amd luiza-amd marked this pull request as ready for review July 13, 2026 07:49
Comment thread tests/unit_tests/backends/megatron/diffusion/test_te_vs_local_spec_attention.py Dismissed
@wenxie-amd wenxie-amd merged commit a655077 into main Jul 14, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants