Skip to content

Relax GraphTrainer stack trace node count test - #4046

Merged
wconstab merged 1 commit into
mainfrom
whc/graphtrainer-stack-trace-count
Aug 1, 2026
Merged

Relax GraphTrainer stack trace node count test#4046
wconstab merged 1 commit into
mainfrom
whc/graphtrainer-stack-trace-count

Conversation

@wconstab

@wconstab wconstab commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Fixes the shared GraphTrainer failure seen on main and the PP revert PR:

Both fail in TestMetadataPropagation::test_backward_nodes_have_stack_trace with AssertionError: 23 != 24, while bwd_nodes_missing_stack_trace = [].

The exact number of eligible FX/autograd nodes is not the behavior this test needs to lock down; it can change as PyTorch tracing/decomposition/autograd internals change. The invariant is that backward nodes corresponding to forward nodes with stack traces also have stack traces. This PR keeps that assertion and only replaces the brittle exact graph-shape count with a sanity check that the test actually examined at least one backward node.

Validation:

  • python3 -m py_compile torchtitan/experiments/graph_trainer/tests/test_trace_module.py

Note: local pytest was unavailable in the default Python environment on my host, so CI should be used for the targeted runtime check. This PR does not address the separate H100 GraphTrainer integration failures.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 1, 2026
@wconstab
wconstab requested a review from tugsbayasgalan August 1, 2026 02:31
@wconstab
wconstab merged commit d84e54e into main Aug 1, 2026
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/8gpu 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