[dynamo] Track mutated_sources on SideEffects for precise mutation detection#176477
[dynamo] Track mutated_sources on SideEffects for precise mutation detection#176477anijain2305 wants to merge 6 commits intogh/anijain2305/1060/basefrom
Conversation
…tection Record the exact source (AttrSource for store_attr, var.source for value mutations) into an OrderedSet on SideEffects. This enables invoke_subgraph reuse to detect mutations via a simple set intersection with traced_sources instead of walking source chains, and is more precise -- mutating mod.d no longer invalidates a subgraph that only read mod.c. Authored with Claude. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/176477
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 4 Unrelated FailuresAs of commit 85a9638 with merge base b633f26 ( NEW FAILURE - The following job has failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
BROKEN TRUNK - The following job 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
|
williamwen42
left a comment
There was a problem hiding this comment.
There seems like there could be some overlap with _capture_user_stack? Could we investigate if we can combine _capture_user_stack and self.mutated_sources?
…mutation detection" Record the exact source (AttrSource for store_attr, var.source for value mutations) into an OrderedSet on SideEffects. This enables invoke_subgraph reuse to detect mutations via a simple set intersection with traced_sources instead of walking source chains, and is more precise -- mutating mod.d no longer invalidates a subgraph that only read mod.c. Authored with Claude. [ghstack-poisoned]
…mutation detection" Record the exact source (AttrSource for store_attr, var.source for value mutations) into an OrderedSet on SideEffects. This enables invoke_subgraph reuse to detect mutations via a simple set intersection with traced_sources instead of walking source chains, and is more precise -- mutating mod.d no longer invalidates a subgraph that only read mod.c. Authored with Claude. [ghstack-poisoned]
…mutation detection" Record the exact source (AttrSource for store_attr, var.source for value mutations) into an OrderedSet on SideEffects. This enables invoke_subgraph reuse to detect mutations via a simple set intersection with traced_sources instead of walking source chains, and is more precise -- mutating mod.d no longer invalidates a subgraph that only read mod.c. Authored with Claude. [ghstack-poisoned]
…mutation detection" Record the exact source (AttrSource for store_attr, var.source for value mutations) into an OrderedSet on SideEffects. This enables invoke_subgraph reuse to detect mutations via a simple set intersection with traced_sources instead of walking source chains, and is more precise -- mutating mod.d no longer invalidates a subgraph that only read mod.c. Authored with Claude. [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 |
|
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 |
|
@pytorchbot merge -i |
…mutation detection" Record the exact source (AttrSource for store_attr, var.source for value mutations) into an OrderedSet on SideEffects. This enables invoke_subgraph reuse to detect mutations via a simple set intersection with traced_sources instead of walking source chains, and is more precise -- mutating mod.d no longer invalidates a subgraph that only read mod.c. Authored with Claude. 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: trunk / macos-py3-arm64 / test (default, 3, 3, macos-m1-stable) Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 4 checks: inductor / inductor-cpu-test / test (cpu_inductor_torchbench, 1, 2, linux.2xlarge.amx, unstable), inductor / unit-test / inductor-test / test (inductor_cpp_wrapper, 1, 2, linux.g5.4xlarge.nvidia.gpu), inductor / unit-test / inductor-test / test (inductor_cpp_wrapper, 2, 2, linux.g5.4xlarge.nvidia.gpu), trunk / macos-py3-arm64 / test (default, 3, 3, macos-m1-stable) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Add a dispatch table that maps guard type names to extract/check handler pairs. This lets invoke_subgraph_cache evaluate guards at cache-lookup time without duplicating per-guard-type logic in parallel if/elif chains. Pull Request resolved: #176033 Approved by: https://github.com/zou3519 ghstack dependencies: #176477
…tection Record the exact source (AttrSource for store_attr, var.source for value mutations) into an OrderedSet on SideEffects. This enables invoke_subgraph reuse to detect mutations via a simple set intersection with traced_sources instead of walking source chains, and is more precise -- mutating mod.d no longer invalidates a subgraph that only read mod.c. Authored with Claude. ghstack-source-id: fc82832 Pull Request resolved: pytorch/pytorch#176477
Stack from ghstack (oldest at bottom):
Record the exact source (AttrSource for store_attr, var.source for
value mutations) into an OrderedSet on SideEffects. This enables
invoke_subgraph reuse to detect mutations via a simple set
intersection with traced_sources instead of walking source chains,
and is more precise -- mutating mod.d no longer invalidates a
subgraph that only read mod.c.
Authored with Claude.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @kadeng @chauhang @amjames @Lucaskabela @jataylo