Skip to content

[Feature]: 补齐性能模式冒烟用例:--spec-decode、--num-warmups 与多档 sweep #705

Open

Description

@SJTUyh

💻 需求背景、当前现状、期望实现的功能内容、具体的设计方案、以及测试方案

需求背景

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 串接回归漏检”的风险。

当前现状

  1. --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 到结果文件的端到端用例。
  1. --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 的端到端行为。
  1. 多档 --batch-size / --num-prompts(sweep)无冒烟用例

期望实现的功能内容

在不引入任何新依赖的前提下,复用现有 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/):

  1. 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。
  2. 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。
  3. 多档 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 分支);如需覆盖另外两种模式,再评估“按用例独立启动 /metrics stub 服务”或为模拟器增加运行时切换开关,二者均不需要新增依赖。
  • 断言方式:沿用现有 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 依赖。

替代方案

补充说明


本 Issue 由 Agent「trae-local」生成,经 @SJTUyh 审核后以本人身份创建。

Activity

  1. github-actions commented on Nov 23, 2026

    @github-actions

    🌟欢迎给AISBench benchmark测评工具提issue,我们会尽快处理您的诉求~

  2. github-actions commented on Nov 23, 2026

    @github-actions

    🤖 基于AI机器人的issue内容完整性检查结果:

    问题内容检查结果

    检查状态

    [PASS]

    详细检查

    • 问题/痛点描述: [COMPLETE]
    • 建议方案: [COMPLETE]

    👉 如果想重新检查,在评论区@issue_checker即可。

    【强烈推荐❤️‍🔥】确保issue描述完整后,可以试着将issue交给Ask DeepWiki回答,deepwiki包含了和工具相关的所有知识库

  3. added
    content_check_passed
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    content_check_passedfeaturetest-cases

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions