Commit e0a6bb5
Enabled compiled autograd for backward pass (#7667)
Compiled Autograd is an extension to torch.compile which enhances the
autograd engine by capturing a larger backward computation graph at
runtime. This allows a more comprehensive optimization of the backward
pass during training.
Overall, 5-20% speedup is expected in backward-heavy workloads with
stable graphs.
Disabled by default, the feature can be enabled from a user script by
setting `compiled_autograd_enabled=True` when invoking the engine's
`compile` method.
Note, that bfloat16 + eager backend requires PyTorch >=2.5 (where
partial fixes landed) or disabling compiled autograd for bfloat16 models
(due to a known PyTorch bug in torch.compile PyTorch #152162/#161153)
---------
Signed-off-by: Max Kovalenko <[email protected]>
Co-authored-by: Olatunji Ruwase <[email protected]>1 parent 39a682d commit e0a6bb5
2 files changed
+55
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
19 | 31 | | |
20 | 32 | | |
21 | 33 | | |
| |||
73 | 85 | | |
74 | 86 | | |
75 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
76 | 104 | | |
77 | 105 | | |
78 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
449 | 452 | | |
450 | 453 | | |
451 | 454 | | |
| |||
2476 | 2479 | | |
2477 | 2480 | | |
2478 | 2481 | | |
2479 | | - | |
2480 | | - | |
2481 | | - | |
2482 | | - | |
2483 | | - | |
2484 | | - | |
2485 | | - | |
2486 | | - | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
2487 | 2491 | | |
2488 | | - | |
2489 | | - | |
| 2492 | + | |
| 2493 | + | |
2490 | 2494 | | |
2491 | 2495 | | |
2492 | 2496 | | |
| |||
4205 | 4209 | | |
4206 | 4210 | | |
4207 | 4211 | | |
4208 | | - | |
| 4212 | + | |
| 4213 | + | |
| 4214 | + | |
| 4215 | + | |
| 4216 | + | |
4209 | 4217 | | |
4210 | 4218 | | |
4211 | 4219 | | |
| |||
4271 | 4279 | | |
4272 | 4280 | | |
4273 | 4281 | | |
| 4282 | + | |
| 4283 | + | |
| 4284 | + | |
| 4285 | + | |
| 4286 | + | |
| 4287 | + | |
| 4288 | + | |
4274 | 4289 | | |
4275 | 4290 | | |
4276 | 4291 | | |
| |||
0 commit comments