Skip to content

[dynamo] Import FakeStore from torch.distributed._backends.fake in after_aot - #203096

Closed
d4l3k wants to merge 1 commit into
gh/d4l3k/314/basefrom
gh/d4l3k/314/head
Closed

d4l3k wants to merge 1 commit into
gh/d4l3k/314/basefrom
gh/d4l3k/314/head

Conversation

@d4l3k

@d4l3k d4l3k commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Stack from ghstack (oldest at bottom):

#202141 moved FakeProcessGroup/FakeStore to torch.distributed._backends.fake, leaving torch/testing/_internal/distributed/fake_pg.py as a compatibility shim. after_aot.py was its last user in torch/ outside torch/testing. setup_fake_process_groups now imports from the new module; the fake backend is registered on demand by init_process_group, so the shim's import-time registration isn't needed. The FakeStore import emitted into generated repros is dropped: it has been unused since repros started calling setup_fake_process_groups, and dropping it rather than repointing it keeps generated repros runnable on released torch (2.11+), which lacks torch.distributed._backends.fake.

Test plan:

python -m pytest test/dynamo/test_fx_graph_runnable.py
lintrunner -a --skip CLANGTIDY torch/_dynamo/repro/after_aot.py

22 passed; the collective and multi-process-group tests run the generated repro in a fresh subprocess.

Line changes: implementation +1/-2, tests +0/-0.

This PR was authored with the help of an AI assistant (Claude).

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 Nov 2, 2026 •

Copy link
Copy Markdown

PR Status: Approved 🚀

Please fix all CI failures and trigger merge by commenting "@pytorchbot merge".

✅ AUTOMATED REVIEW - Ready for human review:

The PR points `setup_fake_process_groups` in `torch/_dynamo/repro/after_aot.py`
at the new `torch.distributed._backends.fake` module instead of the `fake_pg.py`
compatibility shim, and stops writing the unused `FakeStore` import into
generated repros. The review found no issues. Recommendation: Approve.

Reviewed commit: 867fce8

Review run

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit 867fce8 with merge base b85dea2 (image):
💚 Looks good so far! There are no failures yet. 💚

🟢 GREEN LIGHT - PR approved to be merged without human review:

  • Triviality
    • Mechanical refactor: setup_fake_process_groups imports FakeStore from torch.distributed._backends.fake, which the fake_pg shim just re-exports
    • Behavior-neutral tweak: drops the unused FakeStore import from the generate_compiler_repro_string header
  • Correctness
    • Shim's import-time _register_fake_backend() is covered by Backend._ensure_backend_registered in distributed_c10d.py, run by init_process_group
    • Only FakeStore uses in after_aot.py are lines 223 and 236; generated repros call setup_fake_process_groups, which imports its own
  • Socialization
    • No signature, default, or parsed-format change; no test asserts on the removed repro import line

reason: clean
Reviewed commit: 867fce8

Inference job

🐛 Report a wrong verdict

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

@pytorch-bot pytorch-bot Bot added ciflow/inductor ciflow/torchtitan Run TorchTitan integration tests module: dynamo labels Nov 2, 2026
@d4l3k d4l3k added the topic: not user facing topic category label Nov 2, 2026
@d4l3k
d4l3k marked this pull request as ready for review November 2, 2026 21:35
@pytorchgreenlight pytorchgreenlight Bot added the GL/approved Approved by GreenLight label Nov 2, 2026
@d4l3k

d4l3k commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Nov 2, 2026
@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

@pytorchbot pytorchbot added the in progress PR is being worked on by the author, until the automated review accepts it label Nov 2, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review of 867fce8: nothing blocking; ready for human review.

The PR points setup_fake_process_groups in torch/_dynamo/repro/after_aot.py at the new torch.distributed._backends.fake module instead of the fake_pg.py compatibility shim, and stops writing the unused FakeStore import into generated repros. The review found no issues. Recommendation: Approve.

This review is AI-generated and advisory. Each new automated review replaces the previous one.

@pytorch-bot pytorch-bot Bot added ready for review Automated review passed, ready for a final review by a maintainer. and removed in progress PR is being worked on by the author, until the automated review accepts it labels Nov 3, 2026
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 5, 2026
…ter_aot (pytorch#203096)

pytorch#202141 moved FakeProcessGroup/FakeStore to `torch.distributed._backends.fake`, leaving `torch/testing/_internal/distributed/fake_pg.py` as a compatibility shim. `after_aot.py` was its last user in `torch/` outside `torch/testing`. `setup_fake_process_groups` now imports from the new module; the `fake` backend is registered on demand by `init_process_group`, so the shim's import-time registration isn't needed. The `FakeStore` import emitted into generated repros is dropped: it has been unused since repros started calling `setup_fake_process_groups`, and dropping it rather than repointing it keeps generated repros runnable on released torch (2.11+), which lacks `torch.distributed._backends.fake`.

Test plan:

```
python -m pytest test/dynamo/test_fx_graph_runnable.py
lintrunner -a --skip CLANGTIDY torch/_dynamo/repro/after_aot.py
```

22 passed; the collective and multi-process-group tests run the generated repro in a fresh subprocess.

Line changes: implementation +1/-2, tests +0/-0.

This PR was authored with the help of an AI assistant (Claude).

Pull Request resolved: pytorch#203096
Approved by: https://github.com/pytorchgreenlight
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 9, 2026
…ter_aot (pytorch#203096)

pytorch#202141 moved FakeProcessGroup/FakeStore to `torch.distributed._backends.fake`, leaving `torch/testing/_internal/distributed/fake_pg.py` as a compatibility shim. `after_aot.py` was its last user in `torch/` outside `torch/testing`. `setup_fake_process_groups` now imports from the new module; the `fake` backend is registered on demand by `init_process_group`, so the shim's import-time registration isn't needed. The `FakeStore` import emitted into generated repros is dropped: it has been unused since repros started calling `setup_fake_process_groups`, and dropping it rather than repointing it keeps generated repros runnable on released torch (2.11+), which lacks `torch.distributed._backends.fake`.

Test plan:

```
python -m pytest test/dynamo/test_fx_graph_runnable.py
lintrunner -a --skip CLANGTIDY torch/_dynamo/repro/after_aot.py
```

22 passed; the collective and multi-process-group tests run the generated repro in a fresh subprocess.

Line changes: implementation +1/-2, tests +0/-0.

This PR was authored with the help of an AI assistant (Claude).

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

Labels

ciflow/inductor ciflow/torchtitan Run TorchTitan integration tests ciflow/trunk Trigger trunk jobs on your pull request GL/approved Approved by GreenLight Merged module: dynamo ready for review Automated review passed, ready for a final review by a maintainer. topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants