Repository navigation
Open
Labels
Description
💻 需求背景、当前现状、期望实现的功能内容、具体的设计方案、以及测试方案
需求背景
AISBench 冒烟框架(smoke_tests/)通过 .github/workflows/run_smoke_test_pr_and_daily.yml 在 PR 与每日定时任务中执行 bash smoke_tests/scripts/run_steps.sh -t short,是性能/精度主流程的主要回归入口。当前 smoke_tests/test-case/ 下共有 114 个 case.yml,覆盖 run_other_commands、run_server_accuracy、run_server_performance、run_server_pressure 四类场景,但性能模式的部分可选能力没有任何端到端用例,存在“单元测试通过、CLI 串接回归漏检”的风险。
当前现状
--spec-decode已实现但无冒烟用例
ais_bench/benchmark/cli/argument_parser.py注册了--spec-decode,说明为仅在--mode perf生效。ais_bench/benchmark/cli/workers.py在推理前后采集/metrics快照并计算增量;ais_bench/benchmark/spec_decode/reporter.py将结果写入<work_dir>/performances/spec_decode_<host>_<port>.json,采集不到增量时错误信息为No spec decode activity detected during benchmark window。tools/infer_serve_simulator/已提供/metrics端点:tools/infer_serve_simulator/flask_service.py注册了/metrics路由,tools/infer_serve_simulator/api/metrics_api.py依据tools/infer_serve_simulator/api/api_config.yaml的metrics.mode支持error_http/no_spec/static_counters三种行为,README 明确写明用于 spec-decode 场景测试。- 但在
smoke_tests/全目录检索不到spec-decode关键字;tests/UT/spec_decode/只有解析、计算与上报单测,没有从 CLI 到结果文件的端到端用例。
--num-warmups无冒烟用例
ais_bench/benchmark/cli/argument_parser.py提供--num-warmups;ais_bench/benchmark/tasks/openicl_api_infer.py的warm_up()按该值执行预热,日志打印Warmup finished ...,值为 0 时打印Warmup size is 0, skip...。- 现有冒烟用例的
run.sh均未显式传入--num-warmups,只有tests/UT/tasks/test_openicl_api_infer.py覆盖默认值,无法验证 0 与大于 1 的端到端行为。
- 多档
--batch-size/--num-prompts(sweep)无冒烟用例
ais_bench/benchmark/cli/argument_parser.py中--batch-size与--num-prompts均为nargs='+',多值仅在perf/perf_viz/agentx模式生效;ais_bench/benchmark/cli/sweep.py负责组合展开,ais_bench/benchmark/cli/config_manager.py会把组合清单写入<work_dir>/combos_manifest.json(常量见ais_bench/benchmark/utils/perf_manifest.py)。- 现有 114 个冒烟用例的命令行参数只有单值
--batch-size/--num-prompts(或完全不传),没有覆盖 sweep 展开与combos_manifest.json产物。 - 仓库 Issue [Bug] --batch-size 和 --num-prompts 设置多值且一一对应,但执行时,解析多出来一个 #677(https://github.com/AISBench/benchmark/issues/677)已暴露多值参数解析问题,说明该路径在真实使用中缺乏回归保护。
期望实现的功能内容
在不引入任何新依赖的前提下,复用现有 tools/infer_serve_simulator 与 gsm8k 等小数据集,新增以下冒烟用例(case.yml + run.sh + clean.sh + ais_bench_configs,结构可参照现有 smoke_tests/test-case/run_server_performance/stream_apis/perf_vllm_api_stream_chat_gsm8k/):
- spec-decode 指标采集:
--mode perf --spec-decode,模拟器保持默认metrics.mode: static_counters。断言退出码为 0、<timestamp>/performances/spec_decode_<host>_<port>.json存在,且 JSON 中status == "na"、error包含No spec decode activity detected during benchmark window,同时tmplog.txt不出现 Traceback。 - warmup 行为:沿用同一模型/数据集配置,分别以
--num-warmups 0与--num-warmups 4运行--mode perf。断言退出码为 0,logs/infer/<api>/<dataset>.out中分别出现Warmup size is 0, skip与Warmup finished,并校验Total Count: 4。 - 多档 sweep:
--mode perf --batch-size 8 16 --num-prompts 32 64。断言退出码为 0、时间戳目录下存在combos_manifest.json且combinations数量为 2,汇总 CSV 同时包含两个带-bs后缀的组合。
设计方案
- 用例放置:
smoke_tests/test-case/run_server_performance/<新分组>/,case_group至少包含run_server_performance、short,rank_size: 3,与现有性能用例保持一致。 - 配置方式:沿用现有
run.sh的${AISBENCH_SMOKE_SERVICE_IP}/${AISBENCH_SMOKE_SERVICE_PORT}注入方式;模型使用vllm_api或vllm_api_stream_chat,数据集使用 gsm8k,--num-prompts控制在 4~8,确保单用例在 timeout 60s 内完成。 - spec-decode 异常分支:
error_http/no_spec需要修改模拟器api_config.yaml后重启服务,当前模拟器由所有用例共享,直接切换会影响其他用例。建议第一阶段只覆盖默认static_counters的端到端链路(对应 N/A 分支);如需覆盖另外两种模式,再评估“按用例独立启动/metricsstub 服务”或为模拟器增加运行时切换开关,二者均不需要新增依赖。 - 断言方式:沿用现有
run.sh的[ ! -f ... ] && exit 1风格,JSON 字段使用grep或仓库已在使用的python3 -c校验,不新增依赖。
测试方案
- 本地:在冒烟环境执行
bash smoke_tests/scripts/run_steps.sh -t <新用例组>,确认三个用例单独通过。 - CI:由
.github/workflows/run_smoke_test_pr_and_daily.yml的-t short触发,确认 PR 路径过滤命中smoke_tests/**与ais_bench/benchmark/**。 - 回归验证:先在当前版本上运行多档 sweep 用例,确认其能复现 Issue [Bug] --batch-size 和 --num-prompts 设置多值且一一对应,但执行时,解析多出来一个 #677 的多值解析失败(用例应为失败态);修复后用例转绿,证明用例有效。
- 验收标准:新增用例全部通过;
spec_decode_*.json、combos_manifest.json与 warmup 日志断言均命中;不新增requirements*.txt依赖。
替代方案
- 仅补
tests/UT/spec_decode/与tests/UT/tasks/test_openicl_api_infer.py单测:成本较低,但无法覆盖 CLI 参数解析、模拟器/metrics串接、结果文件落盘与日志行为,无法防止类似 Issue [Bug] --batch-size 和 --num-prompts 设置多值且一一对应,但执行时,解析多出来一个 #677 的端到端问题。 - 等待现有用例自然暴露问题:
--spec-decode、--num-warmups与多值 sweep 目前没有任何用例入口,短期内不会被执行到,不构成回归保护。
补充说明
- 相关前置 Issue:[Bug] --batch-size 和 --num-prompts 设置多值且一一对应,但执行时,解析多出来一个 #677(多值参数解析)为本需求提供了真实使用场景,但不属于同一问题;本 Issue 只要求补齐冒烟用例,不包含修复 [Bug] --batch-size 和 --num-prompts 设置多值且一一对应,但执行时,解析多出来一个 #677。
- 断言字符串均来自现有代码:
No spec decode activity detected during benchmark window(workers.py)、performances/spec_decode_<host>_<port>.json(reporter.py)、combos_manifest.json(perf_manifest.py / config_manager.py)、Warmup finished/Warmup size is 0, skip(openicl_api_infer.py)。 - 若维护者认为
error_http/no_spec两个分支暂不做端到端覆盖,可先合入 static_counters 用例,后续按需追加。
本 Issue 由 Agent「trae-local」生成,经 @SJTUyh 审核后以本人身份创建。
Activity
github-actions commentedon Nov 23, 2026
🌟欢迎给AISBench benchmark测评工具提issue,我们会尽快处理您的诉求~
github-actions commentedon Nov 23, 2026
🤖 基于AI机器人的issue内容完整性检查结果:
问题内容检查结果
检查状态
[PASS]
详细检查
👉 如果想重新检查,在评论区@issue_checker即可。
【强烈推荐❤️🔥】确保issue描述完整后,可以试着将issue交给
回答,deepwiki包含了和工具相关的所有知识库