disable profiling trace by default

This commit is contained in:
2026-07-15 04:43:46 +08:00
parent cb962589e9
commit 59e497fdc9
3 changed files with 173 additions and 4 deletions

View File

@@ -1062,3 +1062,48 @@ topk_weights = torch.softmax(topk_logits, dim=-1)
- 小样本中输出 token 数不同,仍需看趋势而不是单条。
操作结论:不保留该代码改动,回退到 full-softmax router。下一步继续围绕 MoE expert GEMM、all-reduce、prefill/cache 路径做实验。
## 2026-07-15关闭默认 PROF_TRACE
### 改动
`qwen3_5.py``_prof()` 原本默认开启:
```python
_PROF_TRACE = os.environ.get("PROF_TRACE", "1") != "0"
```
这会在 decode 阶段输出大量 `[PROF]` 行,并且每次 `flush=True`。改为默认关闭:
```python
_PROF_TRACE = os.environ.get("PROF_TRACE", "0") == "1"
```
需要代码级 profiling 时再显式设置 `PROF_TRACE=1`
### 结果
本地归档:
- `worklogs/remote_results/2026-07-15-official-like-baseline/eager_100k_no_prof_c1_r8_t256_cap40k.json`
| 指标 | 100K 基线 | PROF_TRACE 默认关闭 | 目标 |
| --- | ---: | ---: | ---: |
| Success Rate | 100.00% | 100.00% | >= 99% |
| Cache Hit Rate | 74.17% | 74.17% | >= 50% |
| TTFT P90 | 9.803s | 12.739s | <= 5s |
| Output TPS P10 | 5.825 | 5.851 | >= 20 |
| Aggregate Output TPS | 5.789 | 5.674 | - |
| Uncached Input TPS | 178.330 | 169.148 | - |
| Cache TPS | 512.015 | 485.652 | - |
| Weighted Throughput | 883.109 | 840.712 | >= 8000 |
### 结论
关闭默认 profiling 没有带来明显性能收益,说明当前主要瓶颈不是日志 I/O。不过该改动仍应保留在生产提交中
- 避免评测日志膨胀;
- 避免 profiling 输出影响长时间 benchmark 稳定性;
- profiling 仍可通过 `PROF_TRACE=1` 手动开启。
下一步继续看 MoE routed expert 和 TP all-reduce服务日志中 decode 稳态仍约 5.8 tok/s说明专家计算/通信路径仍是核心。