Commit 9c360e0
[None][fix] write per-rank torch profile traces
PyExecutor reads TLLM_TORCH_PROFILE_TRACE directly and every rank calls
torch_profiler.export_chrome_trace() on the same path. When TP/PP/DP > 1,
the concurrent writes interleave and the resulting file fails to parse
in Chrome tracing / Perfetto (bad control character / unterminated
string at the byte where one rank's output overran another's).
Append the rank to the env-provided path before the first use so each
rank writes to its own file. Matches SGLang's scheduler_profiler_mixin
filename convention: the user supplies a base path, the runtime adds
the per-rank suffix automatically.
Example: TLLM_TORCH_PROFILE_TRACE=/tmp/trace.json now produces
/tmp/trace-rank-0.json, /tmp/trace-rank-1.json, etc.
Signed-off-by: Gavin.Zhu <gavin.z@gmicloud.ai>1 parent 17ac84c commit 9c360e0
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
936 | 936 | | |
937 | 937 | | |
938 | 938 | | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
939 | 947 | | |
940 | 948 | | |
941 | 949 | | |
| |||
0 commit comments