Commit b6b2c2d
authored
Fix AC(compile(model)) by disabling Dynamo LRU cache (#1991)
Stacked PRs:
* __->__#1991
--- --- ---
FIXES #1971
Description of the fix is in
pytorch/pytorch#166926 (There's a default on
fix tackled by @williamwen42). Briefly, disabling the Dynamo LRU cache
will ensure that the graph used at recompute time is the same as the one
used during the original forward. This issue happens when the same
python code object (module/function) has multiple valid graphs e.g. one
with static shapes and one with dynamic shapes.
Requires pytorch/pytorch#167038
Turning off the LRU cache can increase dynamo cache lookup overhead,
however this should not affect torchtitan since we ensure relatively few
graphs (usually 0 for bf16, or 1 for mxfp8) for each torch.compile
wrapped code object.1 parent 268020d commit b6b2c2d
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
| 517 | + | |
| 518 | + | |
517 | 519 | | |
518 | 520 | | |
519 | 521 | | |
| |||
0 commit comments