Skip to content

[dynamo] Track side effect stack on SubgraphTracer#176453

Closed
anijain2305 wants to merge 7 commits intogh/anijain2305/1053/basefrom
gh/anijain2305/1053/head
Closed

[dynamo] Track side effect stack on SubgraphTracer#176453
anijain2305 wants to merge 7 commits intogh/anijain2305/1053/basefrom
gh/anijain2305/1053/head

Conversation

@anijain2305
Copy link
Contributor

@anijain2305 anijain2305 commented Mar 4, 2026

Stack from ghstack (oldest at bottom):

Replace the boolean has_side_effect flag on SubgraphTracer with
side_effect_stack (StackSummary | None). None means no side effect;
non-None carries the user code stack where the first externally-visible
side effect was detected.

Only externally-visible mutations (not is_side_effect_safe) are
recorded, so local mutations inside the subgraph don't trigger it.

Authored with Claude.

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

Replace the boolean has_side_effect flag on SubgraphTracer with
side_effect_stack (StackSummary | None). None means no side effect;
non-None carries the user code stack where the first externally-visible
side effect was detected.

Only externally-visible mutations (not is_side_effect_safe) are
recorded, so local mutations inside the subgraph don't trigger it.

Authored with Claude.

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 4, 2026

🔗 Helpful Links

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

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

❌ 1 New Failure, 4 Cancelled Jobs, 2 Unrelated Failures

As of commit 241f60d with merge base 1da0362 (image):

NEW FAILURE - The following job has failed:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

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.

@pytorch-bot
Copy link

pytorch-bot bot commented Mar 4, 2026

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.

Replace the boolean has_side_effect flag on SubgraphTracer with
side_effect_stack (StackSummary | None). None means no side effect;
non-None carries the user code stack where the first externally-visible
side effect was detected.

Only externally-visible mutations (not is_side_effect_safe) are
recorded, so local mutations inside the subgraph don't trigger it.

Authored with Claude.

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

[ghstack-poisoned]
@anijain2305 anijain2305 requested a review from Lucaskabela March 4, 2026 18:12
@anijain2305 anijain2305 added ciflow/trunk Trigger trunk jobs on your pull request topic: not user facing topic category labels Mar 4, 2026
Replace the boolean has_side_effect flag on SubgraphTracer with
side_effect_stack (StackSummary | None). None means no side effect;
non-None carries the user code stack where the first externally-visible
side effect was detected.

Only externally-visible mutations (not is_side_effect_safe) are
recorded, so local mutations inside the subgraph don't trigger it.

Authored with Claude.

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

[ghstack-poisoned]
Replace the boolean has_side_effect flag on SubgraphTracer with
side_effect_stack (StackSummary | None). None means no side effect;
non-None carries the user code stack where the first externally-visible
side effect was detected.

Only externally-visible mutations (not is_side_effect_safe) are
recorded, so local mutations inside the subgraph don't trigger it.

Authored with Claude.

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

[ghstack-poisoned]
Replace the boolean has_side_effect flag on SubgraphTracer with
side_effect_stack (StackSummary | None). None means no side effect;
non-None carries the user code stack where the first externally-visible
side effect was detected.

Only externally-visible mutations (not is_side_effect_safe) are
recorded, so local mutations inside the subgraph don't trigger it.

Authored with Claude.

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

[ghstack-poisoned]
Replace the boolean has_side_effect flag on SubgraphTracer with
side_effect_stack (StackSummary | None). None means no side effect;
non-None carries the user code stack where the first externally-visible
side effect was detected.

Only externally-visible mutations (not is_side_effect_safe) are
recorded, so local mutations inside the subgraph don't trigger it.

Authored with Claude.

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

[ghstack-poisoned]
Replace the boolean has_side_effect flag on SubgraphTracer with
side_effect_stack (StackSummary | None). None means no side effect;
non-None carries the user code stack where the first externally-visible
side effect was detected.

Only externally-visible mutations (not is_side_effect_safe) are
recorded, so local mutations inside the subgraph don't trigger it.

Authored with Claude.

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

[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #176477

@anijain2305
Copy link
Contributor Author

@pytorchbot merge -i

pytorchmergebot pushed a commit that referenced this pull request Mar 5, 2026
Record every source accessed via VariableBuilder (and cell loads via
load_cell) into an OrderedSet on SubgraphTracer, then propagate it
through SubgraphTracingInfo. This gives callers a complete picture of
which sources were touched during a subgraph trace -- needed by the
upcoming invoke_subgraph reuse mechanism to collect guards and detect
mutations on captured variables.

Authored with Claude.

Pull Request resolved: #176459
Approved by: https://github.com/Lucaskabela, https://github.com/zou3519
ghstack dependencies: #176453
sandy-gags pushed a commit to sandy-gags/pytorch that referenced this pull request Mar 12, 2026
Replace the boolean has_side_effect flag on SubgraphTracer with
side_effect_stack (StackSummary | None). None means no side effect;
non-None carries the user code stack where the first externally-visible
side effect was detected.

Only externally-visible mutations (not is_side_effect_safe) are
recorded, so local mutations inside the subgraph don't trigger it.

Authored with Claude.

ghstack-source-id: 8622656
Pull Request resolved: pytorch/pytorch#176453
sandy-gags pushed a commit to sandy-gags/pytorch that referenced this pull request Mar 12, 2026
Replace the boolean has_side_effect flag on SubgraphTracer with
side_effect_stack (StackSummary | None). None means no side effect;
non-None carries the user code stack where the first externally-visible
side effect was detected.

Only externally-visible mutations (not is_side_effect_safe) are
recorded, so local mutations inside the subgraph don't trigger it.

Authored with Claude.

ghstack-source-id: 0d4f49f
Pull Request resolved: pytorch/pytorch#176453
sandy-gags pushed a commit to sandy-gags/pytorch that referenced this pull request Mar 13, 2026
Replace the boolean has_side_effect flag on SubgraphTracer with
side_effect_stack (StackSummary | None). None means no side effect;
non-None carries the user code stack where the first externally-visible
side effect was detected.

Only externally-visible mutations (not is_side_effect_safe) are
recorded, so local mutations inside the subgraph don't trigger it.

Authored with Claude.

ghstack-source-id: 3d21249
Pull Request resolved: pytorch/pytorch#176453
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants