Commit 0de35f9
authored
[profiler] Suppress Callable field from tyro CLI parsing (#3038)
## Summary
Fixes a crash introduced by #2926 where `trace_post_processor:
Function.Config | None` in `Profiler.Config` causes `tyro.cli()` to fail
because tyro cannot parse `Callable[..., Any]` types from CLI arguments.
**Error:**
```
Invalid input to tyro.cli()
Unsupported type annotation for field profiler.trace-post-processor.fn
with type collections.abc.Callable[..., typing.Any]
```
**Fix:** Annotate `trace_post_processor` with `tyro.conf.Suppress`,
matching the existing pattern used for:
- `model_spec` in `trainer.py:62`
- `sample_processor` in `text_datasets.py:502`
The field defaults to `None` and is only set programmatically by
`CUDAGraphWrapper`, never via CLI.
## Test plan
- [ ] Verify `python -m torchtitan.train ...` no longer crashes at
config parsing
- [ ] Verify graph_trainer still works (trace_post_processor set
programmatically)1 parent 1a2fef0 commit 0de35f9
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
172 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
173 | 176 | | |
174 | 177 | | |
175 | 178 | | |
| 179 | + | |
176 | 180 | | |
177 | 181 | | |
178 | 182 | | |
| |||
0 commit comments