Skip to content

Organize benchmark logs by date/branch/commit and propagate run metadata to Feishu#173

Open
chen2021673 wants to merge 2 commits into
masterfrom
feishu-benchmark-run-metadata
Open

Organize benchmark logs by date/branch/commit and propagate run metadata to Feishu#173
chen2021673 wants to merge 2 commits into
masterfrom
feishu-benchmark-run-metadata

Conversation

@chen2021673

@chen2021673 chen2021673 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Benchmark 日志此前平铺在 logs/profile_logs/ 下,且写入飞书表格时用的是「当前」git 分支和 commit,导致补传旧日志或并行多次运行时元信息错乱。本 PR 让每次运行的日志按 <日期>/<分支>_<commit>/ 归档,并把真实的运行元信息(分支、commit、启动时间)记录进日志,飞书脚本据此回填,不再依赖当前 git 状态。

Changes

scripts/run_models_and_profile.bash

  • 运行开始时采集 RUN_STARTED_AT / RUN_ID / git 分支与 commit,并对分支名做文件名安全处理。
  • 将本次输出归档到 <LOG_DIR父目录>/<日期>/<分支>_<commit短>/ 下。
  • 固定生成 logs/profile_logs/ 两个子目录,供后续 Feishu 写入脚本统一读取。
  • 生成 logs/run_metadata.log 汇总本次运行信息;每个训练日志头部追加 [RUN_METADATA] / [RUN_STARTED_AT] / [GIT_BRANCH] / [GIT_COMMIT] 等行。
  • 终端打印本次运行的 metadata、log、profile 路径。

scripts/write_to_feishu_sheet.py

  • 新增 parse_metadata_lines / load_run_metadata,从训练日志及其引用的 run_metadata.log 解析元信息。
  • 表格首行的日期、分支、commit 改为取自运行元信息(get_run_date / get_run_branch / get_run_commit_id),旧日志无元信息时回退到当前 git。
  • main 新增 --log-dir 参数,表示 run 输出根目录;脚本自动读取其下的 logs/profile_logs/
  • discover_testcasesget_model_data 统一使用解析后的日志目录。

scripts/compare_utils.py

  • collect_log_files 跳过新增的 run_metadata.log,避免被当作训练日志参与对比。

Tests

本地日志路径:
image

追加信息:
image

写入命令:

python write_to_feishu_sheet.py token.json \
  --log-dir 20260612/feishu-benchmark-run-metadata_cde0458/

测试写入结果正确

…ata to Feishu

Restructure run_models_and_profile.bash to write logs under
<date>/<branch>_<commit>/ and emit a run_metadata.log plus per-log metadata
headers (branch, commit, start time). write_to_feishu_sheet.py now reads this
metadata so each sheet row reflects the actual run instead of the current git
state, and accepts --log-dir/--profile-log-dir. compare_utils.py skips the new
run_metadata.log when collecting logs.
@chen2021673 chen2021673 force-pushed the feishu-benchmark-run-metadata branch from ecf2c52 to 1a8d9d5 Compare June 12, 2026 03:18
@chen2021673 chen2021673 force-pushed the feishu-benchmark-run-metadata branch from 1a8d9d5 to 0e19707 Compare June 12, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant