Skip to content

Revert "Tighten generalized scatter graph target (#184075)" - #188219

Closed
frgossen wants to merge 4 commits into
gh/frgossen/157/basefrom
gh/frgossen/157/head
Closed

frgossen wants to merge 4 commits into
gh/frgossen/157/basefrom
gh/frgossen/157/head

Conversation

@frgossen

@frgossen frgossen commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

This reverts commit b35bc89.

PR #184075 reworked Inductor's temporary generalized scatter form to use
private OpOverload targets (a torch.library FRAGMENT registering
generalized_scatter / inplace_generalized_scatter_ with flattened,
encoded view-op arguments) and added matching Piecewise support in the
z3 validator. This revert restores the prior representation that passes
view ops as a list of ViewOp dataclasses directly as call_function args.

The revert was applied on top of current main; three hunks in
reinplace.py conflicted only because later commits had refactored the
PR-introduced code (assert -> raise AssertionError). All conflicts were
resolved to the pre-PR form, fully removing the encode/decode machinery,
the torch.library registration, and the validator additions.

Test Plan:

python -c "import ast; ast.parse(open('torch/_inductor/fx_passes/reinplace.py').read())"
python test/inductor/test_inplacing_pass.py

This PR was authored with the assistance of an AI agent.

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Jun 26, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 1 New Failure, 32 Pending, 6 Unrelated Failures

As of commit 28b13dd with merge base a9fb86c (image):

NEW FAILURE - The following job has failed:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

@pytorch-bot pytorch-bot Bot added ci-no-td Do not run TD on this PR ciflow/inductor ciflow/torchtitan Run TorchTitan integration tests module: inductor release notes: fx release notes category labels Jun 26, 2026
@frgossen
frgossen marked this pull request as ready for review June 26, 2026 00:59
@frgossen
frgossen requested review from aorenste, jansel and zou3519 June 26, 2026 01:00

@atalman atalman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

please fix lint

[ghstack-poisoned]
frgossen added a commit that referenced this pull request Jun 26, 2026
This reverts commit b35bc89.

PR #184075 reworked Inductor's temporary generalized scatter form to use
private OpOverload targets (a torch.library FRAGMENT registering
generalized_scatter / inplace_generalized_scatter_ with flattened,
encoded view-op arguments) and added matching Piecewise support in the
z3 validator. This revert restores the prior representation that passes
view ops as a list of ViewOp dataclasses directly as call_function args.

The revert was applied on top of current main; three hunks in
reinplace.py conflicted only because later commits had refactored the
PR-introduced code (assert -> raise AssertionError). All conflicts were
resolved to the pre-PR form, fully removing the encode/decode machinery,
the torch.library registration, and the validator additions.

Test Plan:

```
python -c "import ast; ast.parse(open('torch/_inductor/fx_passes/reinplace.py').read())"
python test/inductor/test_inplacing_pass.py
```

This PR was authored with the assistance of an AI agent.


ghstack-source-id: 71af8ae
Pull-Request: #188219
@frgossen frgossen added the suppress-bc-linter Suppresses the failures of API backward-compatibility linter (Lint/bc_linter) label Jun 26, 2026
[ghstack-poisoned]
frgossen added a commit that referenced this pull request Jun 26, 2026
This reverts commit b35bc89.

PR #184075 reworked Inductor's temporary generalized scatter form to use
private OpOverload targets (a torch.library FRAGMENT registering
generalized_scatter / inplace_generalized_scatter_ with flattened,
encoded view-op arguments) and added matching Piecewise support in the
z3 validator. This revert restores the prior representation that passes
view ops as a list of ViewOp dataclasses directly as call_function args.

The revert was applied on top of current main; three hunks in
reinplace.py conflicted only because later commits had refactored the
PR-introduced code (assert -> raise AssertionError). All conflicts were
resolved to the pre-PR form, fully removing the encode/decode machinery,
the torch.library registration, and the validator additions.

Test Plan:

```
python -c "import ast; ast.parse(open('torch/_inductor/fx_passes/reinplace.py').read())"
python test/inductor/test_inplacing_pass.py
```

This PR was authored with the assistance of an AI agent.


ghstack-source-id: af9ab73
Pull-Request: #188219
@frgossen

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

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

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: inductor / inductor-test / test-osdc (inductor_torchbench, 2, 2, mt-l-x86aavx2-29-113-a10g)

Details for Dev Infra team Raised by workflow job

@frgossen

Copy link
Copy Markdown
Contributor Author

@pytorchbot rebase

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

[ghstack-poisoned]
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Successfully rebased gh/frgossen/157/orig onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via ghstack checkout https://github.com/pytorch/pytorch/pull/188219)

pytorchmergebot pushed a commit that referenced this pull request Jun 26, 2026
This reverts commit b35bc89.

PR #184075 reworked Inductor's temporary generalized scatter form to use
private OpOverload targets (a torch.library FRAGMENT registering
generalized_scatter / inplace_generalized_scatter_ with flattened,
encoded view-op arguments) and added matching Piecewise support in the
z3 validator. This revert restores the prior representation that passes
view ops as a list of ViewOp dataclasses directly as call_function args.

The revert was applied on top of current main; three hunks in
reinplace.py conflicted only because later commits had refactored the
PR-introduced code (assert -> raise AssertionError). All conflicts were
resolved to the pre-PR form, fully removing the encode/decode machinery,
the torch.library registration, and the validator additions.

Test Plan:

```
python -c "import ast; ast.parse(open('torch/_inductor/fx_passes/reinplace.py').read())"
python test/inductor/test_inplacing_pass.py
```

This PR was authored with the assistance of an AI agent.


ghstack-source-id: a985ff5
Pull-Request: #188219
@frgossen

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

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / linux-jammy-rocm-py3.10-mi350 / test (distributed, 3, 3, amd-do-linux.rocm.gpu.gfx950.2)

Details for Dev Infra team Raised by workflow job

@atalman

atalman commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

@pytorchbot merge -f "all looks good. Lets merge"

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

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

@atalman

atalman commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

@pytorchbot cherry-pick --onto release/2.13 -c critical

@pytorchbot

Copy link
Copy Markdown
Collaborator

Cherry picking #188219

Command git -C /home/runner/work/pytorch/pytorch cherry-pick -x f2a71f17894fdbbdc8fb1c16ef2d12142ee7b997 returned non-zero exit code 1

Auto-merging torch/_inductor/fx_passes/reinplace.py
CONFLICT (content): Merge conflict in torch/_inductor/fx_passes/reinplace.py
error: could not apply f2a71f17894... Revert "Tighten generalized scatter graph target (#184075)" (#188219)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Details for Dev Infra team Raised by workflow job

atalman pushed a commit that referenced this pull request Jun 26, 2026
)" (#188277)

This reverts commit b35bc89 on the
release/2.13 branch. It is the release-branch counterpart of the
main-branch revert (#188219).

PR #184075 reworked Inductor's temporary generalized scatter form to use
private OpOverload targets (a torch.library FRAGMENT registering
generalized_scatter / inplace_generalized_scatter_ with flattened,
encoded view-op arguments) and added matching Piecewise support in the
z3 validator. This revert restores the prior representation that passes
view ops as a list of ViewOp dataclasses directly as call_function args.

The reinplace.py hunks conflicted against the release branch; all were
resolved to the pre-PR form with bare asserts (torch/_inductor/** is
still S101-exempt on this branch, so no noqa is added), fully removing
the encode/decode machinery, the torch.library registration, and the
z3 validator additions.

Test Plan:

```
lintrunner torch/_inductor/fx_passes/reinplace.py
```

This PR was authored with the assistance of an AI agent.
@frgossen

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge -f "All 7 failures verified unrelated to this revert (which only touches the inductor reinplace generalized-scatter pass and the z3 validator): inductor_timm (1,2)/(2,2) and inductor_torchbench (2,2) are eager-nondeterminism broken-trunk failures tracked in #187951 (fix #187954); rocm-mi350 distributed (3,3) is an RCCL pre-flight infra flake (bad KFD/HSA topology on the pod); macos mps (1,1) is a SIGSEGV at test_metal_capture teardown after the test itself passed; unit-test inductor (1,2)/(2,2) fail only AOTInductorLoggingTest::test_shape_env_reuse* (pt2 logger handler-count flake)."

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Can't merge closed PR #188219

gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
…ytorch#188219)

This reverts commit b35bc89.

PR pytorch#184075 reworked Inductor's temporary generalized scatter form to use
private OpOverload targets (a torch.library FRAGMENT registering
generalized_scatter / inplace_generalized_scatter_ with flattened,
encoded view-op arguments) and added matching Piecewise support in the
z3 validator. This revert restores the prior representation that passes
view ops as a list of ViewOp dataclasses directly as call_function args.

The revert was applied on top of current main; three hunks in
reinplace.py conflicted only because later commits had refactored the
PR-introduced code (assert -> raise AssertionError). All conflicts were
resolved to the pre-PR form, fully removing the encode/decode machinery,
the torch.library registration, and the validator additions.

Test Plan:

```
python -c "import ast; ast.parse(open('torch/_inductor/fx_passes/reinplace.py').read())"
python test/inductor/test_inplacing_pass.py
```

This PR was authored with the assistance of an AI agent.

Pull Request resolved: pytorch#188219
Approved by: https://github.com/atalman, https://github.com/zou3519
vishalgoyal316 pushed a commit to vishalgoyal316/pytorch that referenced this pull request Jul 16, 2026
…ytorch#188219)

This reverts commit b35bc89.

PR pytorch#184075 reworked Inductor's temporary generalized scatter form to use
private OpOverload targets (a torch.library FRAGMENT registering
generalized_scatter / inplace_generalized_scatter_ with flattened,
encoded view-op arguments) and added matching Piecewise support in the
z3 validator. This revert restores the prior representation that passes
view ops as a list of ViewOp dataclasses directly as call_function args.

The revert was applied on top of current main; three hunks in
reinplace.py conflicted only because later commits had refactored the
PR-introduced code (assert -> raise AssertionError). All conflicts were
resolved to the pre-PR form, fully removing the encode/decode machinery,
the torch.library registration, and the validator additions.

Test Plan:

```
python -c "import ast; ast.parse(open('torch/_inductor/fx_passes/reinplace.py').read())"
python test/inductor/test_inplacing_pass.py
```

This PR was authored with the assistance of an AI agent.

Pull Request resolved: pytorch#188219
Approved by: https://github.com/atalman, https://github.com/zou3519
@github-actions
github-actions Bot deleted the gh/frgossen/157/head branch July 27, 2026 02:25
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
…ytorch#188219)

This reverts commit b35bc89.

PR pytorch#184075 reworked Inductor's temporary generalized scatter form to use
private OpOverload targets (a torch.library FRAGMENT registering
generalized_scatter / inplace_generalized_scatter_ with flattened,
encoded view-op arguments) and added matching Piecewise support in the
z3 validator. This revert restores the prior representation that passes
view ops as a list of ViewOp dataclasses directly as call_function args.

The revert was applied on top of current main; three hunks in
reinplace.py conflicted only because later commits had refactored the
PR-introduced code (assert -> raise AssertionError). All conflicts were
resolved to the pre-PR form, fully removing the encode/decode machinery,
the torch.library registration, and the validator additions.

Test Plan:

```
python -c "import ast; ast.parse(open('torch/_inductor/fx_passes/reinplace.py').read())"
python test/inductor/test_inplacing_pass.py
```

This PR was authored with the assistance of an AI agent.

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

Labels

ci-no-td Do not run TD on this PR ciflow/inductor ciflow/torchtitan Run TorchTitan integration tests ciflow/trunk Trigger trunk jobs on your pull request Merged module: inductor release notes: fx release notes category suppress-bc-linter Suppresses the failures of API backward-compatibility linter (Lint/bc_linter)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants