Skip to content

fix: size the GLM-5.2 MI355X eval HiCache pool absolutely - #2983

Merged
Oseltamivir merged 3 commits into
mainfrom
dev/jiejing/glm5.2-eval-hicache-budget
Sep 11, 2026
Merged

fix: size the GLM-5.2 MI355X eval HiCache pool absolutely#2983
Oseltamivir merged 3 commits into
mainfrom
dev/jiejing/glm5.2-eval-hicache-budget

Conversation

@jiejingzhangamd

@jiejingzhangamd jiejingzhangamd commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Problem

The GSM8K eval for glm5.2_tp4_conc12_kvdram-hicache_spec-mtp reported no score because the SGLang server was SIGKILLed mid-eval (runner mi355x-amds_07).

EVAL_ONLY inherited the agentic corpus' host-pool sizing. --hicache-ratio is relative to the device pool, so ratio 1.5 resolved to 169.73 GB per rank — 679 GB across the 4 TP ranks.

A TP4 server on cluster:mi355x-amds is budgeted TOTAL_CPU_DRAM_GB=1199, not the node's RAM: agentic_dram_offload_gb() clamps node DRAM to MAX_AGENTIC_AVAILABLE_CPU_DRAM_MIB, scales by dram-utilization, then by gpu_count/gpus-per-node, so a job on the node's other 4 GPUs owns an equal share. The pool therefore claimed 57% of this server's share, and being pinned it is unreclaimable.

Overshooting a pinned pool does not fail at allocation time, which is why this looked like a mystery kill:

time (UTC) event
18:27:24 host pool allocated on all 4 ranks, 169.73 GB each
18:28:22 server reports ready, warmup /generate 200 OK
18:29:28 lm_eval starts its first batch
18:30:35 132625 Killed — OOM killer, connection refused

Fix

GSM8K serves ~1k-token 5-shot prompts at conc 12 and never fills a pool that size, so size it absolutely under EVAL_ONLY: 16 GB/rank = 64 GB across ranks, 5% of the share.

HiCache stays enabled deliberately — covering the host↔device KV copy path is most of what this eval is worth (cf. the recent upstream HiCache correctness fixes in pointer handling and copy round widths). At 16 GB/rank the pool still holds ~350k tokens, so the write policy's DRAM writes and the 5-shot prefix hits both keep going through the host tier.

Throughput sweeps are untouched. They keep ratio-based sizing; --hicache-size 0 leaves the ratio in charge and is already the server default, so the sweep serve shape is behaviourally identical to main:

eval : --enable-hierarchical-cache --hicache-size 16   --hicache-write-policy write_through_selective --hicache-io-backend direct --hicache-mem-layout page_first_direct
sweep: --enable-hierarchical-cache --hicache-ratio 1.5 --hicache-size 0 --hicache-write-policy write_through_selective --hicache-io-backend direct --hicache-mem-layout page_first_direct

Verification

The emitted CACHE_ARGS were checked by executing the script's cache block in isolation (its prologue downloads weights and waits on GPUs, so the block is exercised on its own) across the eval path, both sweep arms, the Mooncake arm, and the HICACHE_EVAL_SIZE_GB override — including that --hicache-size is emitted exactly once, since it overrides --hicache-ratio. Confirmed by mutation: reverting the EVAL_ONLY branch makes those checks fail.

No perf-changelog.yaml entry: this changes no throughput serve shape, and run-sweep.yml only triggers on that file.


Note

Low Risk
Benchmark launch-script tuning only; no change to throughput sweep serve flags beyond clearer pooling of existing ratio-based args.

Overview
Fixes GSM8K eval-only runs on the GLM-5.2 MI355X agentic benchmark script that were dying mid-lm_eval when the host HiCache pool was sized with the agentic ratio (1.5× device pool → ~170 GB/rank), consuming most of the job’s pinned CPU DRAM share and triggering the OOM killer.

When EVAL_ONLY=true, the script now passes --hicache-size (default 16 GB/rank, overridable via HICACHE_EVAL_SIZE_GB) instead of --hicache-ratio, while keeping HiCache enabled for the host↔device KV path. Throughput sweeps are unchanged: they still emit --hicache-ratio plus --hicache-size 0.

Both hicache and mooncake arms share new HICACHE_POOL_ARGS / HICACHE_POOL_DESC so logs and CACHE_ARGS stay consistent.

Reviewed by Cursor Bugbot for commit cff6c0c. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the contribution! Please reach out to respective companies' CODEOWNER to fill in the latest PR_REVIEW_CHECKLIST.md before pinging core maintainer on Slack for review. In order for the signoff PR check bot to trigger, you must follow the PR_REVIEW_CHECKLIST.md template correctly, including the phrase As a PR reviewer and CODEOWNER, I have reviewed this and have.

For PR verification, add the full-sweep-fail-fast label (strongly recommended) to this PR — the benchmark sweep only runs on labeled PRs. Use full-sweep-enabled only if you need matrix jobs to keep running past a failure.

PR authors are responsible for ensuring that after merging, all GitHub Action jobs fully pass. A lot of the time, failures are just flakes and simply re-running the failed jobs will fix it. See GitHub's docs on re-running failed jobs


感谢你的贡献!请联系相应公司的 CODEOWNER 填写最新的 PR_REVIEW_CHECKLIST.md,然后再在 Slack 上联系核心维护者进行审阅。为了触发 signoff PR 检查机器人,你必须正确遵循 PR_REVIEW_CHECKLIST.md 模板,包括保留英文语句 As a PR reviewer and CODEOWNER, I have reviewed this and have

如需进行 PR 验证,请为此 PR 添加 full-sweep-fail-fast 标签(强烈推荐)— 基准测试 sweep 仅在带有标签的 PR 上运行。仅当需要矩阵任务在失败后继续运行时才使用 full-sweep-enabled

PR 作者有责任确保合并后所有 GitHub Action 任务完全通过。 很多时候失败只是偶发抖动(flake),重新运行失败的任务即可解决。参见 GitHub 关于重新运行失败任务的文档

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good — a small, well-scoped bash fix. Reviewed the EVAL_ONLY branch added to glm5.2_fp4_mi355x_sglang_mtp.sh (confirmed the sweep path's --hicache-ratio "$HICACHE_RATIO" --hicache-size 0 args are byte-for-byte unchanged, just routed through the new HICACHE_POOL_ARGS variable), the new test_agentic_eval_hicache.py (executes the real CACHE_ARGS block via bash stubs, not a reimplementation), and the CI workflow path/list additions in test-changelog-gate.yml. No perf-changelog.yaml entry is needed since the throughput-sweep serve shape is unchanged.

Extended reasoning...

Overview

The diff touches three files: a benchmark shell script (adds an EVAL_ONLY branch that sizes the HiCache host pool absolutely via --hicache-size $HICACHE_EVAL_SIZE_GB instead of the ratio-based --hicache-ratio, refactored through shared HICACHE_POOL_ARGS/HICACHE_POOL_DESC variables used by both the plain-HiCache and HiCache+Mooncake code paths), a new pytest file that extracts and executes the script's CACHE_ARGS block in bash-stub isolation, and a CI workflow YAML that adds both files to the path-trigger list and the new test to the pytest invocation.

Security risks

None. This is an internal benchmark/eval script for sizing a memory pool; no user input, auth, or external data handling is involved. The new test spawns bash -c with a fixed, hardcoded script body and stubbed builtins — no injection surface.

Level of scrutiny

Low-to-moderate is appropriate: this is a narrowly-scoped bash conditional gated by an existing EVAL_ONLY env var, and I traced through the full script to confirm the non-eval (sweep) path's emitted args are unchanged from before the diff (--hicache-ratio "$HICACHE_RATIO" --hicache-size 0), just refactored into a variable. The new if/else only changes behavior when EVAL_ONLY=true, which per AGENTS.md/PR description is exactly the previously-broken case (server OOM-killed during GSM8K eval). I also verified the CI YAML additions are simple, mechanical path/list entries matching the new/changed files, with no other edits.

Other factors

The PR includes a detailed, verifiable root-cause narrative (timestamps, ratio math, DRAM-share budget) and states the change was verified by mutation testing (reverting the branch fails 3 of the 8 new tests). The new tests exercise the actual script logic rather than a reimplementation, matching the repo's stated test-quality bar. A previously-investigated candidate issue (that HICACHE_EVAL_SIZE_GB="${HICACHE_EVAL_SIZE_GB:-16}" doesn't handle an explicit 0 override specially) was already flagged as a minor/inline finding rather than a blocking bug, and does not change my overall assessment of correctness for the intended use case. No perf-changelog.yaml entry is needed since the sweep serve shape is unchanged, consistent with AGENTS.md's requirement (which is about benchmark-affecting changes) and the PR author's own explanation.

EVAL_ONLY inherited the agentic corpus' host-pool sizing. --hicache-ratio is
relative to the device pool, so ratio 1.5 resolves to 169.73 GB per rank, or
679 GB across the 4 TP ranks. A TP4 server on cluster:mi355x-amds is budgeted
TOTAL_CPU_DRAM_GB=1199: agentic_dram_offload_gb() clamps the node's DRAM to
MAX_AGENTIC_AVAILABLE_CPU_DRAM_MIB, scales it by dram-utilization, then by
gpu_count/gpus-per-node, so a job on the node's other 4 GPUs owns an equal
share. The pool claims 57% of that share, and because it is pinned it is
unreclaimable.

Overshooting does not fail at allocation time. In the GSM8K eval run the pool
allocated on all 4 ranks, the server reported ready and served its warmup
/generate, and the OOM killer then SIGKILLed it as soon as lm_eval's first
batch started touching those pages. The eval reported no score.

GSM8K serves ~1k-token 5-shot prompts at conc 12 and never fills a pool that
size, so size it absolutely for EVAL_ONLY: 16 GB/rank is 64 GB across the
ranks, 5% of the share. HiCache stays enabled, since covering the
host<->device KV copy path is most of what this eval is worth, and 16 GB/rank
still holds ~350k tokens so the write policy's DRAM writes and the 5-shot
prefix hits both keep going through the host tier.

Throughput sweeps keep their ratio-based sizing untouched; --hicache-size 0
leaves the ratio in charge, which is already the server default, so their
serve shape is unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jiejingzhangamd
jiejingzhangamd force-pushed the dev/jiejing/glm5.2-eval-hicache-budget branch from dfc3b10 to e793701 Compare September 10, 2026 21:43
@chunfangamd

Copy link
Copy Markdown
Collaborator

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cff6c0c. Configure here.

Comment thread benchmarks/single_node/agentic/glm5.2_fp4_mi355x_sglang_mtp.sh

@Oseltamivir Oseltamivir left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Oseltamivir
Oseltamivir merged commit a5f23f4 into main Sep 11, 2026
23 checks passed
@Oseltamivir
Oseltamivir deleted the dev/jiejing/glm5.2-eval-hicache-budget branch September 11, 2026 02:54
functionstackx added a commit that referenced this pull request Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants