Repository navigation
Regional weather diffusion: torch.compile with domain parallelism - #2211
Draft
coreyjadams wants to merge 3 commits into
Draft
coreyjadams wants to merge 3 commits into
coreyjadams wants to merge 3 commits into
Conversation
Contributor
CODEOWNERS review mapCurrent for commit No CODEOWNER
Comment |
Compile the loss under ShardTensor too, and pass attention_backend from the model config to the DiT.
…ensor - Slice the ddp/domain submeshes once and reuse the objects. Each mesh[...] call builds a new, equal DeviceMesh; a compiled graph that meets one it does not track emits device_mesh._get_submesh, which Inductor cannot lower (pytorch/pytorch#201701). - test_training runs torch_compile=True too, including with ShardTensor.
coreyjadams
force-pushed
the
dp-07-recipe-compile
branch
from
October 30, 2026 21:46
dd38467 to
6e75d08
Compare
This branch has not been deployed
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.
PhysicsNeMo Pull Request
Description
Turns on
torch.compilefor the regional weather diffusion recipe underdomain parallelism, which the recipe previously disabled. Closes #1986 together
with the previous PR.
utils/trainer.py: the loss is compiled under ShardTensor too; the guardand its "Skipping torch.compile" log line are removed.
utils/nn.py:attention_backendcomes from the model config (defaultnatten2d), so e.g.natten2d_ropeis honored.utils/parallel.py: theddpanddomainsubmeshes are sliced once andshared. Each
mesh["..."]builds a new, equalDeviceMesh; a compiledgraph that meets one it does not track emits
device_mesh._get_submesh,which Inductor cannot lower ([DTensor][compile] Slicing the same DeviceMesh more than once makes a later compile fail with
device_mesh._get_submesh is not an OpOverloadpytorch/pytorch#201701).test_training.py:torch_compile=Trueis now part of the matrix,including with ShardTensor (the skip is removed).
Validated:
test_training -k "lognormal and None"green on 1 GPU and on2 GPUs (8 passed; the rest skip by world size). The #1986 repro config (DiT,
natten2d_rope, bf16, FSDP2, compiled) trains 20 steps on 4 GPUs (2data-parallel x domain 2) at ~0.06 s/step after compilation.
apex LayerNorm with compile is not covered (apex was not available to test).
Checklist
Dependencies
Depends on #2210 (ShardTensor compile fixes).