Skip to content

[CooR] Omit the current device index from repro input storages under compile_on_one_rank - #196154

Closed
aorenste wants to merge 22 commits into
gh/aorenste/383/basefrom
gh/aorenste/383/head
Closed

aorenste wants to merge 22 commits into
gh/aorenste/383/basefrom
gh/aorenste/383/head

Conversation

@aorenste

@aorenste aorenste commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

InputWriter records each input storage's device, so fx_graph_runnable comes out
different on every rank: 3568 of the 3716 lines differing between two ranks of a
16-GPU job were device(type='cuda', index=N). It also makes a repro produced by
rank 11 unrunnable anywhere with fewer than 12 GPUs.

Under compile_on_one_rank the inputs are on the current accelerator by invariant,
so writing the index records nothing that is true of any other rank. Drop it and
let the reader place the storage on whatever device is current: the repro replays
the same compile, matches across ranks, and runs on a box with fewer GPUs than
the rank that produced it. This extends the defaulting the writer already does --
there is a TODO there observing that defaulting to cpu is unhelpful when the
repros that matter are CUDA.

Gated, so a non-CooR repro still names its device: several accelerators can be
live at once there and the repro has to say which one it used.

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @kadeng @chauhang @amjames @jataylo @azahed98

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/196154

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 50366c8 with merge base 13d3489 (image):
💚 Looks good so far! There are no failures yet. 💚

🟡 GREEN LIGHT - OUTDATED (earlier commit) - PR requires human review:

  • Triviality
    • Behavior change in production code: InputWriter.storage in torch/_dynamo/debug_utils.py now drops the device index under compile_on_one_rank
    • Not a single-cause bugfix: it is a design choice about what fx_graph_runnable repros record, which a reviewer could plausibly push back on
  • Socialization
    • Changes the shape of emitted repro lines (reader.storage(..., device=...)), an artifact users and tooling read and replay
    • Replay now depends on whatever device is current at read time, a portability tradeoff a human should sign off on
  • Scope
    • Also wraps two existing tests (test_rng_ops_compile_under_coor, test_device_observations_track_current_device_under_coor) in fresh_cache(), unrelated to the repro change

reason: not_trivial
Reviewed commit: 3e87bb8 (NOT the current head 50366c8)

Inference job

🐛 Report a wrong verdict

This comment was automatically generated by Dr. CI and updates every 15 minutes.

[ghstack-poisoned]
aorenste added a commit that referenced this pull request Sep 6, 2026
…_on_one_rank

InputWriter records each input storage's device, so fx_graph_runnable comes out
different on every rank: 3568 of the 3716 lines differing between two ranks of a
16-GPU job were device(type='cuda', index=N). It also makes a repro produced by
rank 11 unrunnable anywhere with fewer than 12 GPUs.

Under compile_on_one_rank the inputs are on the current accelerator by invariant,
so writing the index records nothing that is true of any other rank. Drop it and
let the reader place the storage on whatever device is current: the repro replays
the same compile, matches across ranks, and runs on a box with fewer GPUs than
the rank that produced it. This extends the defaulting the writer already does --
there is a TODO there observing that defaulting to cpu is unhelpful when the
repros that matter are CUDA.

Gated, so a non-CooR repro still names its device: several accelerators can be
live at once there and the repro has to say which one it used.


ghstack-source-id: 3c77af0
Pull-Request: #196154
@aorenste aorenste added the topic: not user facing topic category label Sep 6, 2026
[ghstack-poisoned]
aorenste added a commit that referenced this pull request Sep 7, 2026
…_on_one_rank

InputWriter records each input storage's device, so fx_graph_runnable comes out
different on every rank: 3568 of the 3716 lines differing between two ranks of a
16-GPU job were device(type='cuda', index=N). It also makes a repro produced by
rank 11 unrunnable anywhere with fewer than 12 GPUs.

Under compile_on_one_rank the inputs are on the current accelerator by invariant,
so writing the index records nothing that is true of any other rank. Drop it and
let the reader place the storage on whatever device is current: the repro replays
the same compile, matches across ranks, and runs on a box with fewer GPUs than
the rank that produced it. This extends the defaulting the writer already does --
there is a TODO there observing that defaulting to cpu is unhelpful when the
repros that matter are CUDA.

Gated, so a non-CooR repro still names its device: several accelerators can be
live at once there and the repro has to say which one it used.

ghstack-source-id: 698d6b7
Pull-Request: #196154
[ghstack-poisoned]
aorenste added a commit that referenced this pull request Sep 7, 2026
…_on_one_rank

InputWriter records each input storage's device, so fx_graph_runnable comes out
different on every rank: 3568 of the 3716 lines differing between two ranks of a
16-GPU job were device(type='cuda', index=N). It also makes a repro produced by
rank 11 unrunnable anywhere with fewer than 12 GPUs.

Under compile_on_one_rank the inputs are on the current accelerator by invariant,
so writing the index records nothing that is true of any other rank. Drop it and
let the reader place the storage on whatever device is current: the repro replays
the same compile, matches across ranks, and runs on a box with fewer GPUs than
the rank that produced it. This extends the defaulting the writer already does --
there is a TODO there observing that defaulting to cpu is unhelpful when the
repros that matter are CUDA.

Gated, so a non-CooR repro still names its device: several accelerators can be
live at once there and the repro has to say which one it used.

ghstack-source-id: ab6d7cc
Pull-Request: #196154
[ghstack-poisoned]
aorenste added a commit that referenced this pull request Sep 14, 2026
…_on_one_rank

InputWriter records each input storage's device, so fx_graph_runnable comes out
different on every rank: 3568 of the 3716 lines differing between two ranks of a
16-GPU job were device(type='cuda', index=N). It also makes a repro produced by
rank 11 unrunnable anywhere with fewer than 12 GPUs.

Under compile_on_one_rank the inputs are on the current accelerator by invariant,
so writing the index records nothing that is true of any other rank. Drop it and
let the reader place the storage on whatever device is current: the repro replays
the same compile, matches across ranks, and runs on a box with fewer GPUs than
the rank that produced it. This extends the defaulting the writer already does --
there is a TODO there observing that defaulting to cpu is unhelpful when the
repros that matter are CUDA.

Gated, so a non-CooR repro still names its device: several accelerators can be
live at once there and the repro has to say which one it used.

ghstack-source-id: de83847
Pull-Request: #196154
[ghstack-poisoned]
aorenste added a commit that referenced this pull request Sep 14, 2026
…_on_one_rank

InputWriter records each input storage's device, so fx_graph_runnable comes out
different on every rank: 3568 of the 3716 lines differing between two ranks of a
16-GPU job were device(type='cuda', index=N). It also makes a repro produced by
rank 11 unrunnable anywhere with fewer than 12 GPUs.

Under compile_on_one_rank the inputs are on the current accelerator by invariant,
so writing the index records nothing that is true of any other rank. Drop it and
let the reader place the storage on whatever device is current: the repro replays
the same compile, matches across ranks, and runs on a box with fewer GPUs than
the rank that produced it. This extends the defaulting the writer already does --
there is a TODO there observing that defaulting to cpu is unhelpful when the
repros that matter are CUDA.

Gated, so a non-CooR repro still names its device: several accelerators can be
live at once there and the repro has to say which one it used.

ghstack-source-id: 8201c58
Pull-Request: #196154
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
aorenste added a commit that referenced this pull request Sep 23, 2026
…_on_one_rank

InputWriter records each input storage's device, so fx_graph_runnable comes out
different on every rank: 3568 of the 3716 lines differing between two ranks of a
16-GPU job were device(type='cuda', index=N). It also makes a repro produced by
rank 11 unrunnable anywhere with fewer than 12 GPUs.

Under compile_on_one_rank the inputs are on the current accelerator by invariant,
so writing the index records nothing that is true of any other rank. Drop it and
let the reader place the storage on whatever device is current: the repro replays
the same compile, matches across ranks, and runs on a box with fewer GPUs than
the rank that produced it. This extends the defaulting the writer already does --
there is a TODO there observing that defaulting to cpu is unhelpful when the
repros that matter are CUDA.

Gated, so a non-CooR repro still names its device: several accelerators can be
live at once there and the repro has to say which one it used.

ghstack-source-id: 3ac41de
Pull-Request: #196154
[ghstack-poisoned]
aorenste added a commit that referenced this pull request Sep 23, 2026
…_on_one_rank

InputWriter records each input storage's device, so fx_graph_runnable comes out
different on every rank: 3568 of the 3716 lines differing between two ranks of a
16-GPU job were device(type='cuda', index=N). It also makes a repro produced by
rank 11 unrunnable anywhere with fewer than 12 GPUs.

Under compile_on_one_rank the inputs are on the current accelerator by invariant,
so writing the index records nothing that is true of any other rank. Drop it and
let the reader place the storage on whatever device is current: the repro replays
the same compile, matches across ranks, and runs on a box with fewer GPUs than
the rank that produced it. This extends the defaulting the writer already does --
there is a TODO there observing that defaulting to cpu is unhelpful when the
repros that matter are CUDA.

Gated, so a non-CooR repro still names its device: several accelerators can be
live at once there and the repro has to say which one it used.

ghstack-source-id: a7f0dea
Pull-Request: #196154
[ghstack-poisoned]
@aorenste
aorenste marked this pull request as ready for review September 27, 2026 18:08
@aorenste
aorenste requested a review from bobrenjc93 September 27, 2026 18:08
Comment thread torch/_dynamo/debug_utils.py Resolved
[ghstack-poisoned]
@aorenste aorenste changed the title Omit the current device index from repro input storages under compile_on_one_rank [CooR] Omit the current device index from repro input storages under compile_on_one_rank Sep 30, 2026
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@pytorchgreenlight pytorchgreenlight Bot added the GL/superseded GreenLight review is superseded by changes label Oct 30, 2026
@aorenste

aorenste commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 5, 2026
…compile_on_one_rank (pytorch#196154)

InputWriter records each input storage's device, so fx_graph_runnable comes out
different on every rank: 3568 of the 3716 lines differing between two ranks of a
16-GPU job were device(type='cuda', index=N). It also makes a repro produced by
rank 11 unrunnable anywhere with fewer than 12 GPUs.

Under compile_on_one_rank the inputs are on the current accelerator by invariant,
so writing the index records nothing that is true of any other rank. Drop it and
let the reader place the storage on whatever device is current: the repro replays
the same compile, matches across ranks, and runs on a box with fewer GPUs than
the rank that produced it. This extends the defaulting the writer already does --
there is a TODO there observing that defaulting to cpu is unhelpful when the
repros that matter are CUDA.

Gated, so a non-CooR repro still names its device: several accelerators can be
live at once there and the repro has to say which one it used.

Pull Request resolved: pytorch#196154
Approved by: https://github.com/bobrenjc93
ghstack dependencies: pytorch#196153
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 9, 2026
…compile_on_one_rank (pytorch#196154)

InputWriter records each input storage's device, so fx_graph_runnable comes out
different on every rank: 3568 of the 3716 lines differing between two ranks of a
16-GPU job were device(type='cuda', index=N). It also makes a repro produced by
rank 11 unrunnable anywhere with fewer than 12 GPUs.

Under compile_on_one_rank the inputs are on the current accelerator by invariant,
so writing the index records nothing that is true of any other rank. Drop it and
let the reader place the storage on whatever device is current: the repro replays
the same compile, matches across ranks, and runs on a box with fewer GPUs than
the rank that produced it. This extends the defaulting the writer already does --
there is a TODO there observing that defaulting to cpu is unhelpful when the
repros that matter are CUDA.

Gated, so a non-CooR repro still names its device: several accelerators can be
live at once there and the repro has to say which one it used.

Pull Request resolved: pytorch#196154
Approved by: https://github.com/bobrenjc93
ghstack dependencies: pytorch#196153
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/dtensor Run DTensor specific tests ciflow/inductor ciflow/torchtitan Run TorchTitan integration tests ciflow/trunk Trigger trunk jobs on your pull request GL/superseded GreenLight review is superseded by changes Merged module: dynamo topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants