[dynamo] Prevent recompile on hoistable opaque objects#176643
[dynamo] Prevent recompile on hoistable opaque objects#176643anijain2305 wants to merge 4 commits intogh/anijain2305/1069/basefrom
Conversation
…raph reuse Capture sources from constructor args in OpaqueObjectClassVariable and thread ctor_arg_sources through TorchScriptObjectVariable and synthetic_graph_input so subgraph reuse can apply source replacement to resolve new constructor arg values on stamp-out. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/176643
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (6 Unrelated Failures)As of commit 0ed8bab with merge base 0857433 ( FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
torch/_dynamo/output_graph.py
Outdated
| ) | ||
|
|
||
| gm = inline_invoke_subgraph(gm) | ||
| with dynamo_timed("inline_invoke_subgraph"): |
There was a problem hiding this comment.
Unrelated to this PR - but I hope its ok. In case, anyone has objections, I can open a new PR.
…le for subgraph reuse" Capture sources from constructor args in OpaqueObjectClassVariable and thread ctor_arg_sources through TorchScriptObjectVariable and synthetic_graph_input so subgraph reuse can apply source replacement to resolve new constructor arg values on stamp-out. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx kadeng chauhang amjames Lucaskabela jataylo [ghstack-poisoned]
Capture sources from constructor args in OpaqueObjectClassVariable and thread ctor_arg_sources through TorchScriptObjectVariable and synthetic_graph_input so subgraph reuse can apply source replacement to resolve new constructor arg values on stamp-out. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx kadeng chauhang amjames Lucaskabela jataylo [ghstack-poisoned]
|
@angelayi Thanks for the review. I changed the implementation to further support no recompiles on opaque objects. |
| if should_hoist(self.value): | ||
| with tx.output.tracing_context.guards_context.skip_guard_install(): | ||
| constant_args = var_args.as_python_constant() | ||
| constant_kwargs = var_kwargs.as_python_constant() |
There was a problem hiding this comment.
do we need to distinguish between if self.value has a source or not here?
There was a problem hiding this comment.
I assume we don't because the tests are all passing and I do have a test for this somewhere
There was a problem hiding this comment.
pytorch/test/test_opaque_obj_v2.py
Line 2095 in d7a5197
|
@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 |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
Capture sources from constructor args in OpaqueObjectClassVariable and thread ctor_arg_sources through TorchScriptObjectVariable and synthetic_graph_input so subgraph reuse can apply source replacement to resolve new constructor arg values on stamp-out. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx kadeng chauhang amjames Lucaskabela jataylo [ghstack-poisoned]
|
@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 |
Merge failedReason: 1 jobs have failed, first few of them are: inductor / unit-test / inductor-test / test (inductor_cpp_wrapper, 1, 2, linux.g5.4xlarge.nvidia.gpu) Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 6 checks: pull / cuda13.0-py3.10-gcc11-sm75 / test (pr_time_benchmarks, 1, 1, linux.g4dn.metal.nvidia.gpu), trunk / linux-jammy-cuda13.0-py3.10-gcc11 / test (pr_time_benchmarks, 1, 1, linux.g4dn.metal.nvidia.gpu), inductor / inductor-cpu-test / test (cpu_inductor_torchbench, 1, 2, linux.2xlarge.amx, unstable), inductor / unit-test / inductor-test / test (inductor_cpp_wrapper, 2, 2, linux.g5.4xlarge.nvidia.gpu), inductor / unit-test / inductor-test / test (inductor_cpp_wrapper, 1, 2, linux.g5.4xlarge.nvidia.gpu), inductor / unit-test / inductor-test / test (inductor, 1, 2, linux.g5.4xlarge.nvidia.gpu) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
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 |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 6 checks: pull / cuda13.0-py3.10-gcc11-sm75 / test (pr_time_benchmarks, 1, 1, linux.g4dn.metal.nvidia.gpu), trunk / linux-jammy-cuda13.0-py3.10-gcc11 / test (pr_time_benchmarks, 1, 1, linux.g4dn.metal.nvidia.gpu), inductor / inductor-cpu-test / test (cpu_inductor_torchbench, 1, 2, linux.2xlarge.amx, unstable), inductor / unit-test / inductor-test / test (inductor_cpp_wrapper, 2, 2, linux.g5.4xlarge.nvidia.gpu), inductor / unit-test / inductor-test / test (inductor_cpp_wrapper, 1, 2, linux.g5.4xlarge.nvidia.gpu), inductor / unit-test / inductor-test / test (inductor, 1, 2, linux.g5.4xlarge.nvidia.gpu) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…raph reuse Capture sources from constructor args in OpaqueObjectClassVariable and thread ctor_arg_sources through TorchScriptObjectVariable and synthetic_graph_input so subgraph reuse can apply source replacement to resolve new constructor arg values on stamp-out. ghstack-source-id: bb03798 Pull Request resolved: pytorch/pytorch#176643
Stack from ghstack (oldest at bottom):
Capture sources from constructor args in OpaqueObjectClassVariable and
thread ctor_arg_sources through TorchScriptObjectVariable and
synthetic_graph_input so subgraph reuse can apply source replacement
to resolve new constructor arg values on stamp-out.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @kadeng @chauhang @amjames @Lucaskabela @jataylo