Repository navigation
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/179315
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit d189d9e with merge base 44a01f7 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
| return ( | ||
| isinstance(n.meta.get("val"), torch.SymBool) | ||
| and len(n.users) > 0 | ||
| and all(u.target is torch.ops.aten._assert_scalar.default for u in n.users) |
There was a problem hiding this comment.
@claude what happens to the _assert_scalar downstream op if we don't save the symbool? is it still partitioned into the backward? and how will it receive its inputs
|
@claude what happens to the _assert_scalar downstream op if we don't save the symbool? is it still partitioned into the backward? and how will it receive its inputs |
|
Claude finished @xmfan's task in 4m 16s —— View job
AnswerThe 1. 2. When the backward graph is extracted, 3. What this PR actually fixes: The issue is not about the
So this PR filters these SymBool nodes out of To directly answer your questions:
|
|
bumping this - per-layer compile with moe is this PR away from landing 🙏 |
For issue at pytorch/torchtitan#2741 (comment) The min-cut partitioner avoids saving intermediate runtime assertion nodes for the BWD graph, but the assertion expressions are not skipped, and inductor can fail when they're passed as BWD graph inputs. This skips the expression node as well. [ghstack-poisoned]
weifengpy
left a comment
There was a problem hiding this comment.
thanks for unblocking titan!
|
@pytorchbot merge |
Merge startedYour 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 |
…#182597) 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 Pull Request resolved: #182597 Approved by: https://github.com/pianpwk
…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
…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
…79315) For issue at pytorch/torchtitan#2741 (comment) The min-cut partitioner avoids saving intermediate runtime assertion nodes for the BWD graph, but the assertion expressions are not skipped, and inductor can fail when they're passed as BWD graph inputs. This skips the expression node as well. Pull Request resolved: pytorch#179315 Approved by: https://github.com/weifengpy
…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
…79315) For issue at pytorch/torchtitan#2741 (comment) The min-cut partitioner avoids saving intermediate runtime assertion nodes for the BWD graph, but the assertion expressions are not skipped, and inductor can fail when they're passed as BWD graph inputs. This skips the expression node as well. Pull Request resolved: pytorch#179315 Approved by: https://github.com/weifengpy
…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
For issue at pytorch/torchtitan#2741 (comment)
The min-cut partitioner avoids saving intermediate runtime assertion nodes for the BWD graph, but the assertion expressions are not skipped, and inductor can fail when they're passed as BWD graph inputs.
This skips the expression node as well.
Stack from ghstack (oldest at bottom):
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @kadeng @chauhang @amjames @Lucaskabela @jataylo @azahed98