Skip to content

fix(benchmark/sglang): keep the radix cache when the caller enables HiCache - #127

Open
jiejingzhangamd wants to merge 1 commit into
AMD-AGI:mainfrom
jiejingzhangamd:fix/sglang-hicache-keeps-radix-cache
Open

jiejingzhangamd wants to merge 1 commit into
AMD-AGI:mainfrom
jiejingzhangamd:fix/sglang-hicache-keeps-radix-cache

Conversation

@jiejingzhangamd

Copy link
Copy Markdown

Motivation

sglang_mi300x.sh / sglang_mi355x.sh add --disable-radix-cache to every server launch unless EXTRA_SGLANG_ARGS already contains it. SGLang refuses that flag next to --enable-hierarchical-cache (HiCache sits on the radix cache):

ValueError: The arguments enable-hierarchical-cache and disable-radix-cache are mutually exclusive and cannot be used at the same time. Please use only one of them.

So any recipe that enables HiCache — e.g. the SGLang cookbook GLM-5.2 MXFP4 MI355X high-throughput cell (--enable-hierarchical-cache --hicache-ratio 1.0) — cannot start through Magpie, and there is no caller-side workaround: passing --disable-radix-cache to suppress the default conflicts the same way. In one Hyperloom session this failed 8 times (baseline, roofline profiling ×3, explore candidates ×3, plus a second node).

Change

In both scripts' default-args loop, skip the --disable-radix-cache default when EXTRA_SGLANG_ARGS enables the hierarchical cache. Every other recipe keeps today's defaults (--mem-fraction-static=0.8, --disable-radix-cache).

Fixes #126. Related: AMD-AGI/Hyperloom#1601 (the same default as a prefix-cache regression on the AgentX path) and AMD-AGI/Hyperloom#1930.

Verification

  • tests/test_sglang_default_args.py (new): runs each real script's server phase with a stub setsid that records the launch argv. HiCache recipe → --enable-hierarchical-cache present, --disable-radix-cache absent (fails before this change); plain recipe → both defaults still added. With tests/test_eval_concurrency_scripts.py: 58 passed. ruff check / ruff format --check clean on the new test (make lint reports the same 1555 pre-existing findings on main; this change touches no Python under Magpie/).
  • Hardware, Docker, 8× MI355X (gfx950), image lmsysorg/sglang-rocm:v0.5.20-rocm720-mi35x-20260923 (SGLang 0.5.20, torch 2.9.1+rocm7.2.0), model amd/GLM-5.2-MXFP4, TP4/EP4: patched sglang_mi355x.sh with MAGPIE_RUN_PHASE=server and the cookbook flags (--kv-cache-dtype fp8_e4m3 --dsa-*-backend triton, EAGLE 5/1/6, --enable-hierarchical-cache --hicache-ratio 1.0, --mem-fraction-static 0.85, --context-length 11264). Server args: enable_hierarchical_cache: True, disable_radix_cache: False; log Tree cache initialized: ... hicache_attached=True; /health 200 after ~180 s; /v1/completions "The capital of France is" → " Paris. It is one of the most". Before the change the same launch exits in argument parsing.
    (Without --context-length, that recipe OOMs at the model's default context in the DSA indexer's paged MQA logits — unrelated to this change; noted for anyone reproducing.)

🤖 Generated with Claude Code

…iCache

sglang_mi300x.sh and sglang_mi355x.sh append --disable-radix-cache unless
EXTRA_SGLANG_ARGS already names it. SGLang rejects that flag next to
--enable-hierarchical-cache (HiCache is built on the radix cache), so every
recipe that enables HiCache - e.g. the SGLang cookbook's MI355X
high-throughput cells - failed during argument parsing, and the only way
to suppress the default (passing --disable-radix-cache) conflicts the same
way.

Skip the --disable-radix-cache default when the caller enables the
hierarchical cache; every other recipe keeps today's defaults.

Fixes AMD-AGI#126

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HktBcjPwjE7QgkA8MgKH6q

This branch has not been deployed

No deployments
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.

sglang_mi355x.sh / sglang_mi300x.sh: default --disable-radix-cache makes any --enable-hierarchical-cache recipe fail to start

1 participant