Skip to content

[AOTAutograd] Filter assert-only SymBool saves in default partitioner - #182597

Closed
sanketpurandare wants to merge 1 commit into
mainfrom
fix_symbool
Closed

sanketpurandare wants to merge 1 commit into
mainfrom
fix_symbool

Conversation

@sanketpurandare

@sanketpurandare sanketpurandare commented May 6, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #182413
Extension of #179315

AOTAutograd's min-cut partitioner already filters SymBool nodes whose only users are aten._assert_scalar, because these are runtime assertion intermediates and not real backward dependencies. default_partition could still save the same assert-only SymBool nodes into the forward/backward saved-symbol ABI. When a nested AOTAutograd function is executed under make_fx/ProxyTensor with unbacked symbols, RuntimeWrapper sees those saved values as torch.SymBool and rejects them.

This change shares the assert-only SymBool predicate between min-cut and default partitioning, and filters default_partition's saved_sym_nodes before extracting the forward/backward graphs.

The issue was reproduced with the standalone repro in #182413 and also in the TorchTitan/AutoParallel nested AOT GraphTrainer path.

Test Plan:
python test/dynamo/test_aot_autograd.py -k test_partitioner_filters_symbool_saved_for_bw
lintrunner --config=.lintrunner.toml torch/_functorch/partitioners.py test/dynamo/test_aot_autograd.py

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

@pytorch-bot

pytorch-bot Bot commented May 6, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 2 New Failures

As of commit 9713cda with merge base 29dba80 (image):

NEW FAILURES - The following jobs have failed:

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 May 6, 2026
@pytorch-bot

pytorch-bot Bot commented May 6, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@sanketpurandare sanketpurandare changed the title Filter assert-only SymBool saves in default partitioner [AOTAutograd] Filter assert-only SymBool saves in default partitioner May 6, 2026
@sanketpurandare

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge -f "Unrelated failures"

@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

@sanketpurandare
sanketpurandare deleted the fix_symbool branch May 13, 2026 00:07
Alokksinha00 pushed a commit to Alokksinha00/pytorch that referenced this pull request May 15, 2026
…pytorch#182597)

Fixes pytorch#182413
Extension of pytorch#179315

AOTAutograd's min-cut partitioner already filters SymBool nodes whose only users are aten._assert_scalar, because these are runtime assertion intermediates and not real backward dependencies. default_partition could still save the same assert-only SymBool nodes into the forward/backward saved-symbol ABI. When a nested AOTAutograd function is executed under make_fx/ProxyTensor with unbacked symbols, RuntimeWrapper sees those saved values as torch.SymBool and rejects them.

This change shares the assert-only SymBool predicate between min-cut and default partitioning, and filters default_partition's saved_sym_nodes before extracting the forward/backward graphs.

The issue was reproduced with the standalone repro in pytorch#182413 and also in the TorchTitan/AutoParallel nested AOT GraphTrainer path.

Test Plan:
python test/dynamo/test_aot_autograd.py -k test_partitioner_filters_symbool_saved_for_bw
lintrunner --config=.lintrunner.toml torch/_functorch/partitioners.py test/dynamo/test_aot_autograd.py

Pull Request resolved: pytorch#182597
Approved by: https://github.com/pianpwk
aperson30 pushed a commit to aperson30/pytorch that referenced this pull request Jun 20, 2026
…pytorch#182597)

Fixes pytorch#182413
Extension of pytorch#179315

AOTAutograd's min-cut partitioner already filters SymBool nodes whose only users are aten._assert_scalar, because these are runtime assertion intermediates and not real backward dependencies. default_partition could still save the same assert-only SymBool nodes into the forward/backward saved-symbol ABI. When a nested AOTAutograd function is executed under make_fx/ProxyTensor with unbacked symbols, RuntimeWrapper sees those saved values as torch.SymBool and rejects them.

This change shares the assert-only SymBool predicate between min-cut and default partitioning, and filters default_partition's saved_sym_nodes before extracting the forward/backward graphs.

The issue was reproduced with the standalone repro in pytorch#182413 and also in the TorchTitan/AutoParallel nested AOT GraphTrainer path.

Test Plan:
python test/dynamo/test_aot_autograd.py -k test_partitioner_filters_symbool_saved_for_bw
lintrunner --config=.lintrunner.toml torch/_functorch/partitioners.py test/dynamo/test_aot_autograd.py

Pull Request resolved: pytorch#182597
Approved by: https://github.com/pianpwk
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
…pytorch#182597)

Fixes pytorch#182413
Extension of pytorch#179315

AOTAutograd's min-cut partitioner already filters SymBool nodes whose only users are aten._assert_scalar, because these are runtime assertion intermediates and not real backward dependencies. default_partition could still save the same assert-only SymBool nodes into the forward/backward saved-symbol ABI. When a nested AOTAutograd function is executed under make_fx/ProxyTensor with unbacked symbols, RuntimeWrapper sees those saved values as torch.SymBool and rejects them.

This change shares the assert-only SymBool predicate between min-cut and default partitioning, and filters default_partition's saved_sym_nodes before extracting the forward/backward graphs.

The issue was reproduced with the standalone repro in pytorch#182413 and also in the TorchTitan/AutoParallel nested AOT GraphTrainer path.

Test Plan:
python test/dynamo/test_aot_autograd.py -k test_partitioner_filters_symbool_saved_for_bw
lintrunner --config=.lintrunner.toml torch/_functorch/partitioners.py test/dynamo/test_aot_autograd.py

Pull Request resolved: pytorch#182597
Approved by: https://github.com/pianpwk
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
…pytorch#182597)

Fixes pytorch#182413
Extension of pytorch#179315

AOTAutograd's min-cut partitioner already filters SymBool nodes whose only users are aten._assert_scalar, because these are runtime assertion intermediates and not real backward dependencies. default_partition could still save the same assert-only SymBool nodes into the forward/backward saved-symbol ABI. When a nested AOTAutograd function is executed under make_fx/ProxyTensor with unbacked symbols, RuntimeWrapper sees those saved values as torch.SymBool and rejects them.

This change shares the assert-only SymBool predicate between min-cut and default partitioning, and filters default_partition's saved_sym_nodes before extracting the forward/backward graphs.

The issue was reproduced with the standalone repro in pytorch#182413 and also in the TorchTitan/AutoParallel nested AOT GraphTrainer path.

Test Plan:
python test/dynamo/test_aot_autograd.py -k test_partitioner_filters_symbool_saved_for_bw
lintrunner --config=.lintrunner.toml torch/_functorch/partitioners.py test/dynamo/test_aot_autograd.py

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AOTAutograd saves SymBool for backward but runtime wrapper rejects it

3 participants