Repository navigation
[graph_trainer] Re-enable llama3 AutoParallel numerics test (was empty_strided shadow-node bug) - #3495
Merged
SherlockNoMad merged 1 commit intoJun 4, 2026
Conversation
SherlockNoMad
requested review from
IvanKobzarev,
aditvenk,
sanketpurandare,
tianyu-l,
xmfan and
yiming0416
as code owners
June 3, 2026 19:35
SherlockNoMad
force-pushed
the
graph_trainer/reenable-autoparallel-llama3-numerics
branch
from
June 3, 2026 19:36
ce96d6d to
0848090
Compare
sanketpurandare
approved these changes
Jun 3, 2026
…y_strided shadow-node bug) The skip on `test_llama3_aot_fx_trace_autoparallel_vs_eager` (and the integration test `autoparallel_llama3_fsdp_tp`) blamed an "upstream AutoParallel nll_loss assertion regression" / "incorrect loss partitioning". That was a misattribution: it is the same empty_strided dead-shadow-node bug that #3480 root-caused and fixed with `_remove_dead_empty_strided_chains`. AutoParallel produces a model-only graph (vocab-sharded DTensor logits); the loss op is applied afterwards inside graph_trainer's `make_fwd_bwd_step`, which is traced by `minimal_fx_tracer` -- exactly the graph the DCE cleans. Under the unfixed nightly, DTensor shard propagation leaves a dead `nll_loss` shadow node reading an uninitialized `empty_strided` target, which trips the bounds check `t >= 0 && t < n_classes` at runtime (same failure class as the embedding OOB). `_remove_dead_empty_strided_chains` strips that dead chain. The upstream fix is pytorch/pytorch #185865. Verified on 8xH100 (autoparallel installed): the loss matches eager (max diff 1.3e-4), `1 passed`. CI runs this unit test on the unfixed nightly (integration_test_8gpu_graph_trainer.yaml), so it exercises the DCE path directly -- keep `_remove_dead_empty_strided_chains` until #185865 lands. The DSv3 AutoParallel and JIT (#2149) tests remain disabled: separate, still-open bugs (confirmed #2149 still reproduces "Node tangents_2 was invalid, but is output"). Test plan: pytest torchtitan/experiments/graph_trainer/tests/test_numerics.py::TestGraphTrainerAutoParallelNumerics::test_llama3_aot_fx_trace_autoparallel_vs_eager 🤖 Generated with [Claude Code](https://claude.com/claude-code)
SherlockNoMad
force-pushed
the
graph_trainer/reenable-autoparallel-llama3-numerics
branch
from
June 4, 2026 21:08
0848090 to
c0e90b3
Compare
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.
Summary
The skip on
test_llama3_aot_fx_trace_autoparallel_vs_eagerand the integration testautoparallel_llama3_fsdp_tpblamed an "upstream AutoParallel nll_loss assertion regression" / "incorrect loss partitioning". That was a misattribution — it is the sameempty_strideddead-shadow-node bug that #3480 root-caused and fixed with_remove_dead_empty_strided_chains.Root cause
AutoParallel produces a model-only graph (vocab-sharded DTensor logits); the loss op is applied afterwards inside graph_trainer's
make_fwd_bwd_step, which is traced byminimal_fx_tracer— exactly the graph the DCE cleans. Under the unfixed nightly, DTensor shard propagation leaves a deadnll_lossshadow node reading an uninitializedempty_stridedtarget, which trips the bounds checkt >= 0 && t < n_classesat runtime — the same failure class as the embedding OOB in #3480._remove_dead_empty_strided_chainsstrips that dead chain. The upstream fix is pytorch/pytorch #185865.Minimal isolation (simulating the unfixed nightly by restoring the pre-fix
_propagate_tensor_meta_non_cached) confirms the DCE removes the dead bounds-checked shadow op:Verification
Ran on 8×H100 with
autoparallelinstalled — loss matches eager:CI runs this unit test on the unfixed nightly (
integration_test_8gpu_graph_trainer.yaml), so it exercises the DCE path directly. Keep_remove_dead_empty_strided_chainsuntil #185865 lands.Left disabled (verified separate, still-open bugs)
AssertionError: Node tangents_2 was invalid, but is outputintorch/_functorch/partitioners.py.Test plan
🤖 Generated with Claude Code