Commit 06949f2
committed
Fix test fixture ordering to match trainer: on_train_begin before apply_torch_compile
All four fixtures previously called apply_torch_compile() before on_train_begin().
In the trainer (trainer.py:97,124) the order is reversed: on_train_begin() runs
first (moving parameters to device/dtype and initialising preprocessors), then
apply_torch_compile(). With the wrong order, preprocessors don't exist yet when
compile runs and are never compiled even when torch_compile_mode is set.
Also remove the now-redundant on_train_begin() calls from the two train-step tests
since the fixture already covers it, and fix the ruff blank-line formatting issue.1 parent cf2216f commit 06949f2
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| |||
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
| 78 | + | |
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
| |||
90 | 95 | | |
91 | 96 | | |
92 | 97 | | |
| 98 | + | |
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
| |||
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
| 132 | + | |
126 | 133 | | |
127 | 134 | | |
128 | 135 | | |
| |||
160 | 167 | | |
161 | 168 | | |
162 | 169 | | |
163 | | - | |
164 | 170 | | |
165 | 171 | | |
166 | 172 | | |
| |||
179 | 185 | | |
180 | 186 | | |
181 | 187 | | |
182 | | - | |
183 | 188 | | |
184 | 189 | | |
185 | 190 | | |
| |||
0 commit comments