Skip to content

[dynamo][invoke_subgraph] Escape hatch to override lookup logic#177215

Open
anijain2305 wants to merge 6 commits intogh/anijain2305/1075/basefrom
gh/anijain2305/1075/head
Open

[dynamo][invoke_subgraph] Escape hatch to override lookup logic#177215
anijain2305 wants to merge 6 commits intogh/anijain2305/1075/basefrom
gh/anijain2305/1075/head

Conversation

@anijain2305
Copy link
Contributor

@anijain2305 anijain2305 commented Mar 11, 2026

Stack from ghstack (oldest at bottom):

Add support for user-defined ___dynamo_module_hash__ on nn.Module as an escape hatch for invoke_subgraph reuse. When a module defines this method, Dynamo calls it eagerly at compile time and uses the returned int as the cache key, bypassing all automatic guard/reuse checks. This lets users assert "these modules are structurally identical" when automatic checks are too conservative or hit Dynamo bugs.

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

Add support for user-defined ___dynamo_module_hash__ on nn.Module as an escape hatch for invoke_subgraph reuse. When a module defines this method, Dynamo calls it eagerly at compile time and uses the returned int as the cache key, bypassing all automatic guard/reuse checks. This lets users assert "these modules are structurally identical" when automatic checks are too conservative or hit Dynamo bugs.

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 11, 2026

🔗 Helpful Links

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

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

✅ You can merge normally! (2 Unrelated Failures)

As of commit 56d05a7 with merge base 3fab23b (image):

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 pytorch-bot bot added ciflow/inductor ciflow/torchtitan Run TorchTitan integration tests module: dynamo labels Mar 11, 2026
anijain2305 added a commit that referenced this pull request Mar 11, 2026
Add support for user-defined ___dynamo_module_hash__ on nn.Module as an escape hatch for invoke_subgraph reuse. When a module defines this method, Dynamo calls it eagerly at compile time and uses the returned int as the cache key, bypassing all automatic guard/reuse checks. This lets users assert "these modules are structurally identical" when automatic checks are too conservative or hit Dynamo bugs.

ghstack-source-id: 113bfaf
Pull Request resolved: #177215
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 11, 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.

…logic"


Add support for user-defined `___dynamo_module_hash__` on nn.Module as an escape hatch for invoke_subgraph reuse. When a module defines this method, Dynamo calls it eagerly at compile time and uses the returned int as the cache key, bypassing all automatic guard/reuse checks. This lets users assert "these modules are structurally identical" when automatic checks are too conservative or hit Dynamo bugs.

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

[ghstack-poisoned]
anijain2305 added a commit that referenced this pull request Mar 11, 2026
Add support for user-defined ___dynamo_module_hash__ on nn.Module as an escape hatch for invoke_subgraph reuse. When a module defines this method, Dynamo calls it eagerly at compile time and uses the returned int as the cache key, bypassing all automatic guard/reuse checks. This lets users assert "these modules are structurally identical" when automatic checks are too conservative or hit Dynamo bugs.

ghstack-source-id: 16f80de
Pull Request resolved: #177215
…logic"


Add support for user-defined `___dynamo_module_hash__` on nn.Module as an escape hatch for invoke_subgraph reuse. When a module defines this method, Dynamo calls it eagerly at compile time and uses the returned int as the cache key, bypassing all automatic guard/reuse checks. This lets users assert "these modules are structurally identical" when automatic checks are too conservative or hit Dynamo bugs.

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

[ghstack-poisoned]
anijain2305 added a commit that referenced this pull request Mar 12, 2026
Add support for user-defined ___dynamo_module_hash__ on nn.Module as an escape hatch for invoke_subgraph reuse. When a module defines this method, Dynamo calls it eagerly at compile time and uses the returned int as the cache key, bypassing all automatic guard/reuse checks. This lets users assert "these modules are structurally identical" when automatic checks are too conservative or hit Dynamo bugs.

ghstack-source-id: 9e48c21
Pull Request resolved: #177215
…logic"


Add support for user-defined `___dynamo_module_hash__` on nn.Module as an escape hatch for invoke_subgraph reuse. When a module defines this method, Dynamo calls it eagerly at compile time and uses the returned int as the cache key, bypassing all automatic guard/reuse checks. This lets users assert "these modules are structurally identical" when automatic checks are too conservative or hit Dynamo bugs.

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

[ghstack-poisoned]
anijain2305 added a commit that referenced this pull request Mar 12, 2026
Add support for user-defined ___dynamo_module_hash__ on nn.Module as an escape hatch for invoke_subgraph reuse. When a module defines this method, Dynamo calls it eagerly at compile time and uses the returned int as the cache key, bypassing all automatic guard/reuse checks. This lets users assert "these modules are structurally identical" when automatic checks are too conservative or hit Dynamo bugs.

ghstack-source-id: 9fc9a5d
Pull Request resolved: #177215
…logic"


Add support for user-defined `___dynamo_module_hash__` on nn.Module as an escape hatch for invoke_subgraph reuse. When a module defines this method, Dynamo calls it eagerly at compile time and uses the returned int as the cache key, bypassing all automatic guard/reuse checks. This lets users assert "these modules are structurally identical" when automatic checks are too conservative or hit Dynamo bugs.

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

[ghstack-poisoned]
anijain2305 added a commit that referenced this pull request Mar 13, 2026
Add support for user-defined ___dynamo_module_hash__ on nn.Module as an escape hatch for invoke_subgraph reuse. When a module defines this method, Dynamo calls it eagerly at compile time and uses the returned int as the cache key, bypassing all automatic guard/reuse checks. This lets users assert "these modules are structurally identical" when automatic checks are too conservative or hit Dynamo bugs.

ghstack-source-id: ba16e08
Pull Request resolved: #177215
…logic"


Add support for user-defined `___dynamo_module_hash__` on nn.Module as an escape hatch for invoke_subgraph reuse. When a module defines this method, Dynamo calls it eagerly at compile time and uses the returned int as the cache key, bypassing all automatic guard/reuse checks. This lets users assert "these modules are structurally identical" when automatic checks are too conservative or hit Dynamo bugs.

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

[ghstack-poisoned]
anijain2305 added a commit that referenced this pull request Mar 13, 2026
Add support for user-defined ___dynamo_module_hash__ on nn.Module as an escape hatch for invoke_subgraph reuse. When a module defines this method, Dynamo calls it eagerly at compile time and uses the returned int as the cache key, bypassing all automatic guard/reuse checks. This lets users assert "these modules are structurally identical" when automatic checks are too conservative or hit Dynamo bugs.

ghstack-source-id: 9b3e1e1
Pull Request resolved: #177215
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.

1 participant