Skip to content

feat(serving): greenspec scenario, spec-decode acceptance, arms, run summary - #43

Merged
thangquang09 merged 12 commits into
refactor/vng-benchmarkfrom
feat/greenspec-refactor
Oct 31, 2026
Merged

thangquang09 merged 12 commits into
refactor/vng-benchmarkfrom
feat/greenspec-refactor

Conversation

@Noridom1

@Noridom1 Noridom1 commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

What

Ports the GreenSpec speculative-decoding bench (previously PR #42 on vng-benchmark) to the serving-YAML architecture.

  • greenspec scenario family (scenarios/greenspec.yaml, infx/serving/greenspec.py). The dataset Green-Lab/GreenSpec is pinned in lock.yaml (greenspec-v1.1.1, revision f7ea173f). Rows become request bodies in a node-local selection file and are replayed through aiperf (raw_payload). Overrides: subset, lite, bucket, mode, max_tokens, requests.
  • Tool-schema normalizer. v1.1.1 fixes required: {} in the tool schemas. greenspec.payload() also rewrites any remaining required: {} to [], so an older pin does not hit the HTTP 400 that SGLang returns for it (vLLM does not validate).
  • Spec-decode metrics (infx/serving/specdec.py). Prometheus counters are snapshotted before and after the replay. The aggregate JSON gets a spec_decode block with acceptance length, acceptance rate and draft depth. Separate module so a future speedbench family can reuse it.
  • arms: in serving YAML. Engine variants (for example base and MTP) share serve: and env:; each arm becomes its own job and point in one run. Duplicate arms are rejected. Not allowed with endpoint:. spec-decoding is derived per arm.
  • Run summary (infx/serving/summary.py plus a summary job in gn-benchmark.yml). Writes a table to $GITHUB_STEP_SUMMARY with throughput, TTFT, TPOT, acceptance and speedup over the base arm.
  • Leak guard. The repo is public and GreenSpec rows are not. The console filter withholds error text, only an allowlist of result files is uploaded (error messages redacted), server logs stay on the node, and the job fails if a question_id remains in an upload.
  • GREENLAB_HF_TOKEN is passed through gn-benchmark.yml -> benchmark-tmpl.yml like SERVING_API_KEY. Without it every arm fails with "GREENLAB_HF_TOKEN is unset" (9f6d288).
  • Example configs/serving/gemma4-greenspec-diverse.yaml, docs (ARCHITECTURE.md, serving-bench skill), tests.

Needs

The GREENLAB_HF_TOKEN repository secret (documented in serving-runner-setup).

Verified

  • 234 serving tests pass on the merge with refactor/vng-benchmark @ 708166e (the 18 srt_slurm/launch failures in the wider suite need srtctl and are not from this change).
  • Two-arm smoke on rtx6000pro-hcm (run 40859952101, before the aiperf-native merge, agentx-harness 1.0.12; vLLM v0.30.0, MTP depth 6, c16, 50 requests): both arms 50/50 ok, the token reads the dataset, one RTX 6000 Pro serves --max-model-len 262144 with FLASHINFER. The aggregate carries spec_decode: acceptance length 5.03, accept rate 67.2%. The summary table renders with mtpx6 in the spec column. The 0.97x speedup there is not meaningful: the KV cache holds about one 256k request, so c16 queues (TTFT p50 264-380 s).
  • Re-smoke after the aiperf-native merge (perf(bench): replace agentx-harness with upstream aiperf #44), run 40991598389 (rtx6000pro-hcm, aiperf 0.13.0.dev20261027, 50 requests, c16): both arms 50/50 ok, 0 dropped. spec_decode on the MTP arm: acceptance length 4.88, accept rate 64.7%. The summary job succeeded; the table renders locally from the artifacts with mtpx6 and a 1.05x speedup (not meaningful on RTX, same KV limit).
  • SGLang smokes on rtx6000pro-hcm (v1.1.1, 20 diverse rows, base arm): at c16 on one GPU a run failed with 2/16 requests over the aiperf 10% failure threshold. The SGLang log shows a KV pool of 130823 tokens against --context-length 262144, so the longest prompts probably do not fit (hypothesis, server error text is withheld by the leak guard). TP2 and --kv-cache-dtype fp8_e4m3 variants were run at c2 to check this; fp8 KV changes numerics, so those runs are for error checking only. Results: see the comment below.
  • An earlier single-arm smoke on cluster:hcm-hgx02 (run 40679051440) also passed.

Not yet verified

  • The summary job writing the table to the GitHub run page was checked by rendering the artifacts locally, not on the page.
  • No real speedup number yet: needs cluster:hcm-hgx02 (H200). No full 3072-row run.
  • SGLang on RTX: the MTP arm crashes on SWA pool sizing (not fixed here).
  • Warmup requests from the old bench are not ported.

…y table

Port of the GreenSpec bench (PR #42 on vng-benchmark) to the serving refactor.

- scenario `greenspec`: raw_payload file built from one selection of the private
  Green-Lab/GreenSpec release (overrides: subset, lite, bucket, mode, max_tokens,
  requests); the release is pinned in datasets/lock.yaml.
- infx/serving/greenspec.py: selection, request bodies, console filter and the
  artifact guard. The benchmark repo is public, so only an allowlist of files is
  uploaded, error text is withheld and server logs are stubbed.
- infx/serving/specdec.py: acceptance length and rate from the engine's
  spec_decode counters before/after the replay, merged into the aggregate as
  `spec_decode`.
- to_matrix: spec-decoding follows --speculative-config / --speculative-algorithm
  (was always none).
- infx/serving/summary.py and a `summary` job in gn-benchmark.yml: one table of the
  run's points with the speedup of a speculative point over its base point.
- config example, docs and skills updated; GREENLAB_HF_TOKEN is now needed on a
  runner that runs this scenario.
`arms:` gives each variant its own job and engine (serve: and env: shared, an arm
adds `append` flags and overlays env), so a speculative arm and its base arm land
in one run and the summary table can give the speedup. Point names are
<name>-<arm>_c<conc>. Arms with identical engine command and env are rejected;
arms: does not combine with endpoint:.

- specdec: draft_depth (drafted tokens / draft events) in the spec_decode block;
  the summary table shows it next to the spec method (mtpx6).
- configs/serving: the greenspec example now carries both arms.
@Noridom1
Noridom1 marked this pull request as ready for review October 30, 2026 02:25
@github-actions

Copy link
Copy Markdown

Thanks for the contribution!

  • Review: If this PR changes files owned by someone other than a repository admin or @SemiAnalysisAI/core, ask one eligible CODEOWNER to complete the latest PR_REVIEW_CHECKLIST.md before contacting a core maintainer on Slack. Follow the template exactly, including As a PR reviewer and CODEOWNER, I have reviewed this and have, so sign-off verification triggers.
  • PR verification: Sweeps run only when the PR appends an inferencex-e2e/perf-changelog.yaml entry and carries exactly one primary label: full-sweep-fail-fast (strongly recommended; canary plus per-matrix fail-fast), full-sweep-enabled (canary; matrix jobs continue after a failure), or non-canary-full-sweep-enabled (no canary or fail-fast). The modifiers all-evals, evals-only, and agentx-fast require a primary label. On fork PRs, a maintainer applies the label. See sweep labels and reuse.
  • After merging: PR authors must ensure all GitHub Actions jobs pass. Transient failures often pass on rerun; see how to rerun failed jobs.
中文

感谢你的贡献!

  • **审阅:**如果 PR 修改的文件归属于仓库管理员及 @SemiAnalysisAI/core 之外的 CODEOWNER,请先联系一位有资格的 CODEOWNER 填写最新的 PR_REVIEW_CHECKLIST.md,再通过 Slack 联系核心维护者。必须严格遵循模板,并保留 As a PR reviewer and CODEOWNER, I have reviewed this and have,才能触发签核验证。
  • **PR 验证:**只有当 PR 在 inferencex-e2e/perf-changelog.yaml 末尾追加了条目,并且恰好带有一个主标签时,才会运行扫描:full-sweep-fail-fast(强烈推荐;canary 加逐矩阵 fail-fast)、full-sweep-enabled(有 canary;矩阵任务在失败后继续运行)或 non-canary-full-sweep-enabled(无 canary,也无 fail-fast)。修饰标签 all-evals、evals-only 和 agentx-fast 必须与主标签一起使用。fork PR 的标签由维护者添加。参见扫描标签与复用。
  • **合并后:**PR 作者必须确保所有 GitHub Actions 任务通过。临时性失败通常可以通过重新运行恢复;参见重新运行失败任务的说明。

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

inferencex-e2e/infx diff: +1492 -72

Generally most InferenceX submissions don't need to add changes to the infx package. On the off chance they do, generally the diff is small. Please prompt your agent to clean your PR to keep your diff to only necessary & minimal changes too. We have an increased code quality bar for changes to the infx package.

中文

大多数 InferenceX 提交通常不需要修改 infx 包。即使确实需要,改动通常也很小。请让你的 agent 清理 PR,使改动只包含必要且最小的内容。infx 包的改动有更高的代码质量要求。

@Noridom1

Noridom1 commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

Hi @thangquang09, please review, make no mistake :D

v1.1.1 fixes tool parameters whose required keyword was {} instead of a list
(548 of 3072 rows); SGLang rejects those with HTTP 400, vLLM accepts them.
payload() also rewrites the keyword, so an older release still runs on both engines.
greenspec-v1.1.1 is marked private in lock.yaml; datasets.py takes an
optional boolean (default false, one-line error otherwise) and the
runner-setup skill keys off the flag instead of hand-copying the private
entry names. Drop the test that pins lock.yaml contents; a small test
covers the private flag parsing instead.
@thangquang09

Copy link
Copy Markdown
Collaborator

Confirmed mergeable. Verified locally at the latest head: 272/272 serving tests pass, ruff check + format clean; CI Lint/Tests green (Zizmor red is pre-existing on the base branch — same 4 findings with zizmor run on base, and this PR actually fixed one).

All review points addressed, and the two follow-up fixes are verified by real runs:

  • SGLang smoke greenspec v1.1.1 on H200 (run 41036862025): 20/20 both arms, no 400s — fix_tools/v1.1.1 confirmed on SGLang; base arm correctly has no spec_decode block (the 0.0-gauge fix works), mtp6 arm reports acceptance length 3.7.
  • SGLang smoke speedbench (run 41035309192, pre-fix head): base arm shows acceptance_length: 0.0 — the exact bug d607cb737 fixes.

Merging into refactor/vng-benchmark (merge commit, stacked on by #45).

@thangquang09
thangquang09 merged commit 2d83b55 into refactor/vng-benchmark Oct 31, 2026
3 of 4 checks passed
thangquang09 added a commit that referenced this pull request Oct 31, 2026
Pick up the greenspec v1.1.1 pin, the SGLang 0.0-gauge fix and the lock
private flag (e5ba0c2) merged via #43. Conflicts resolved: lock.yaml
keeps the six speedbench entries beside greenspec-v1.1.1, runner-setup
SKILL.md keeps the wording that names both scenarios. 274 serving tests
pass, ruff clean.
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.

2 participants