Commit b8bed65
committed
fix: disable torch.compile tracing at the LightningModule.log boundary
Move the torch.compiler.disable from the generic is_param_in_hook_signature
helper to LightningModule.log, and revert the helper to pure Python.
Only self.log is reachable from a compiled training_step; its signature
introspection (inspect.getfullargspec on a bound method) fails to trace on
PyTorch 2.12/2.13. Disabling at the log boundary matches the existing idiom
(toggle_optimizer, _ResultCollection.log) and keeps the introspection helper
torch-free, since its other callers run outside the compiled graph.1 parent 269d096 commit b8bed65
2 files changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
| 386 | + | |
386 | 387 | | |
387 | 388 | | |
388 | 389 | | |
| |||
408 | 409 | | |
409 | 410 | | |
410 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
411 | 419 | | |
412 | 420 | | |
413 | 421 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | | - | |
20 | | - | |
21 | 18 | | |
22 | 19 | | |
23 | 20 | | |
| |||
0 commit comments