fix(parse_results): 不再把 raw_requests 嵌入 results.json,避免 8.5MB 膨胀

parse_jsonl 当 raw 文件是单个聚合 JSON 对象时返回 [data](整个聚合含
itls/generated_texts 数组),原代码把它当 raw_requests[:100] 塞进 scenario,
导致单次 bench 的 results.json 膨胀到 12.5MB(itls 6.95MB + generated_texts 1.54MB)。
而真正有用的聚合百分位已在 latencies 字段(~0.5KB),逐请求原始数据已在
raw_outputs/*.jsonl,raw_requests 字段纯冗余。

- 移除 scenario dict 的 raw_requests 字段; parse_jsonl 返回值改用 _ 接收
- 符合 BENCHMARK_WORKFLOW.md: 产生大量请求时逐请求数据存 raw_outputs, results.json 只留聚合百分位
- 实测 qwen3_235b results.json: 12.52MB -> ~KB
- 同步修改 4 份相同 md5 的 parse_results.py(本提交含 3 份 tracked; qwen3_8b 未跟踪待随实验提交)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
yy-fighting 2026-07-21 10:04:26 +00:00
parent 3bd8f60474
commit 31a21631b8
3 changed files with 3 additions and 6 deletions

View File

@ -212,7 +212,7 @@ def parse_scenario(result_root: Path, raw_file: Path) -> dict | None:
if log_file.exists(): if log_file.exists():
summary = parse_summary_log(log_file.read_text(encoding="utf-8", errors="replace")) summary = parse_summary_log(log_file.read_text(encoding="utf-8", errors="replace"))
raw_requests, aggregates = parse_jsonl(raw_file) _, aggregates = parse_jsonl(raw_file)
# For newer sglang aggregate JSON, success/failed are not present in the # For newer sglang aggregate JSON, success/failed are not present in the
# raw output file. Override them from the human-readable summary log when # raw output file. Override them from the human-readable summary log when
@ -238,7 +238,6 @@ def parse_scenario(result_root: Path, raw_file: Path) -> dict | None:
"total_token_throughput": summary.get("total_token_throughput"), "total_token_throughput": summary.get("total_token_throughput"),
"accept_length": None, "accept_length": None,
"latencies": aggregates["latencies"], "latencies": aggregates["latencies"],
"raw_requests": raw_requests[:100] if len(raw_requests) <= 100 else None,
} }
return scenario return scenario

View File

@ -212,7 +212,7 @@ def parse_scenario(result_root: Path, raw_file: Path) -> dict | None:
if log_file.exists(): if log_file.exists():
summary = parse_summary_log(log_file.read_text(encoding="utf-8", errors="replace")) summary = parse_summary_log(log_file.read_text(encoding="utf-8", errors="replace"))
raw_requests, aggregates = parse_jsonl(raw_file) _, aggregates = parse_jsonl(raw_file)
# For newer sglang aggregate JSON, success/failed are not present in the # For newer sglang aggregate JSON, success/failed are not present in the
# raw output file. Override them from the human-readable summary log when # raw output file. Override them from the human-readable summary log when
@ -238,7 +238,6 @@ def parse_scenario(result_root: Path, raw_file: Path) -> dict | None:
"total_token_throughput": summary.get("total_token_throughput"), "total_token_throughput": summary.get("total_token_throughput"),
"accept_length": None, "accept_length": None,
"latencies": aggregates["latencies"], "latencies": aggregates["latencies"],
"raw_requests": raw_requests[:100] if len(raw_requests) <= 100 else None,
} }
return scenario return scenario

View File

@ -212,7 +212,7 @@ def parse_scenario(result_root: Path, raw_file: Path) -> dict | None:
if log_file.exists(): if log_file.exists():
summary = parse_summary_log(log_file.read_text(encoding="utf-8", errors="replace")) summary = parse_summary_log(log_file.read_text(encoding="utf-8", errors="replace"))
raw_requests, aggregates = parse_jsonl(raw_file) _, aggregates = parse_jsonl(raw_file)
# For newer sglang aggregate JSON, success/failed are not present in the # For newer sglang aggregate JSON, success/failed are not present in the
# raw output file. Override them from the human-readable summary log when # raw output file. Override them from the human-readable summary log when
@ -238,7 +238,6 @@ def parse_scenario(result_root: Path, raw_file: Path) -> dict | None:
"total_token_throughput": summary.get("total_token_throughput"), "total_token_throughput": summary.get("total_token_throughput"),
"accept_length": None, "accept_length": None,
"latencies": aggregates["latencies"], "latencies": aggregates["latencies"],
"raw_requests": raw_requests[:100] if len(raw_requests) <= 100 else None,
} }
return scenario return scenario