pytorch - 💡(How to fix) Fix remove TORCHDYNAMO_DYNAMIC_SHAPES=1 from docs [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
pytorch/pytorch#180467Fetched 2026-04-17 08:22:19
View on GitHub
Comments
0
Participants
1
Timeline
30
Reactions
1
Participants
Timeline (top)
mentioned ×11subscribed ×11labeled ×7unlabeled ×1

Fix Action

Fix / Workaround

  1. "Why am I getting OOMs?" — currently suggests disabling dynamic shapes as step 1 for OOM debugging. Is that still relevant advice? With automatic dynamic as the default, is disabling it a meaningful OOM mitigation, or is that a distraction from the real causes (CUDA graphs, peak memory from compiled code, etc.)?
RAW_BUFFERClick to expand / collapse

e FAQ currently tells users to enable dynamic shapes via: env TORCHDYNAMO_DYNAMIC_SHAPES=1 python model.py

This env var no longer exists. We read the dynamic shapes doc page and your Workplace posts. Our understanding is that automatic dynamic is now the default, and torch.compile(dynamic=True) forces all sizes dynamic which is not recommended for performance.

The FAQ mentions the old env var in two sections:

  1. "Why didn't my code recompile?" — explaining that dynamic shapes prevent recompilation. We're thinking the fix is to explain that automatic dynamic is the default, and link to the dynamic shapes page for explicit control options.

  2. "Why am I getting OOMs?" — currently suggests disabling dynamic shapes as step 1 for OOM debugging. Is that still relevant advice? With automatic dynamic as the default, is disabling it a meaningful OOM mitigation, or is that a distraction from the real causes (CUDA graphs, peak memory from compiled code, etc.)?

cc @svekars @sekyondaMeta @AlannaBurke @chauhang @penguinwu @ezyang @bobrenjc93 @aditvenk

extent analysis

TL;DR

Update the FAQ to reflect that automatic dynamic shapes are now the default and provide guidance on explicit control options.

Guidance

  • Review the FAQ sections "Why didn't my code recompile?" and "Why am I getting OOMs?" to ensure they are updated to reflect the current default behavior of automatic dynamic shapes.
  • Consider removing or revising the suggestion to disable dynamic shapes as a step for OOM debugging, as it may no longer be a meaningful mitigation.
  • Add a link to the dynamic shapes page in the FAQ to provide users with information on explicit control options.
  • Verify that the updated FAQ accurately reflects the current behavior and best practices for dynamic shapes.

Example

No code snippet is provided as it is not necessary for this issue.

Notes

The issue lacks information on the specific version of the software being used, which may affect the applicability of the suggested changes.

Recommendation

Apply workaround: Update the FAQ to reflect the current default behavior of automatic dynamic shapes, as this is a non-invasive change that can help prevent user confusion and provide more accurate guidance.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

pytorch - 💡(How to fix) Fix remove TORCHDYNAMO_DYNAMIC_SHAPES=1 from docs [1 participants]