Commit c9a68de
authored
Make MoE models non-strict tracing friendly (#2612)
## Summary
- `kernels.py`: wrap `fill_indices` as `custom_op` + `register_fake` for
FakeTensor compatibility during `make_fx` tracing
- `test_trace_module.py`: add model-specific tests (llama3, qwen3,
qwen3_moe, deepseek_v3, llama4, gpt_oss) and FSDP tests
Stacked on #2553
## Test plan
- [x] `pytest
torchtitan/experiments/graph_trainer/tests/test_trace_module.py -k
TestTraceModels` — all 6 model tests pass
- [x] `pre-commit run --all-files` passes1 parent 82f508e commit c9a68de
File tree
4 files changed
+591
-39
lines changed- torchtitan
- experiments/graph_trainer
- tests
- models/common
- moe
4 files changed
+591
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
26 | 43 | | |
27 | 44 | | |
28 | 45 | | |
| |||
219 | 236 | | |
220 | 237 | | |
221 | 238 | | |
222 | | - | |
| 239 | + | |
223 | 240 | | |
224 | 241 | | |
225 | 242 | | |
| |||
275 | 292 | | |
276 | 293 | | |
277 | 294 | | |
278 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
279 | 299 | | |
280 | 300 | | |
281 | 301 | | |
282 | | - | |
| 302 | + | |
283 | 303 | | |
284 | 304 | | |
285 | 305 | | |
| |||
315 | 335 | | |
316 | 336 | | |
317 | 337 | | |
318 | | - | |
| 338 | + | |
319 | 339 | | |
320 | 340 | | |
321 | 341 | | |
| |||
0 commit comments