Repository navigation
[wip] Add isolated parameter to torch.compile for independent Dynamo caches - #178347
anijain2305 wants to merge 1 commit into
Conversation
When multiple torch.compile calls target the same function, they share a Dynamo cache on fn.__code__ which can cause cache thrashing and shared recompile limit exhaustion. The new isolated=True parameter creates a fresh code object (via code.replace()) for each compiled version, giving each its own independent ExtraState with separate cache entries, recompile limits, and frame_state. Authored with Claude. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/178347
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 3 Unrelated FailuresAs of commit 835463e with merge base c032b7d ( NEW FAILURE - The following job has failed:
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 jobs are 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
|
When multiple torch.compile calls target the same function, they share a Dynamo cache on fn.__code__ which can cause cache thrashing and shared recompile limit exhaustion. The new isolated=True parameter creates a fresh code object (via code.replace()) for each compiled version, giving each its own independent ExtraState with separate cache entries, recompile limits, and frame_state. Authored with Claude. ghstack-source-id: 9d67168 Pull Request resolved: #178347

Stack from ghstack (oldest at bottom):
When multiple torch.compile calls target the same function, they share
a Dynamo cache on
fn.__code__which can cause cache thrashing and sharedrecompile limit exhaustion. The new isolated=True parameter creates a
fresh code object (via code.replace()) for each compiled version, giving
each its own independent ExtraState with separate cache entries,
recompile limits, and frame_state.
Authored with Claude.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @kadeng @chauhang @amjames @Lucaskabela @jataylo