Repository navigation
fix(benchmark/sglang): keep the radix cache when the caller enables HiCache - #127
Open
jiejingzhangamd wants to merge 1 commit into
Open
jiejingzhangamd wants to merge 1 commit into
jiejingzhangamd wants to merge 1 commit into
Conversation
…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
jiejingzhangamd
requested review from
a team,
haofrank and
sinarafati-amd
as code owners
October 16, 2026 07:55
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
sglang_mi300x.sh/sglang_mi355x.shadd--disable-radix-cacheto every server launch unlessEXTRA_SGLANG_ARGSalready contains it. SGLang refuses that flag next to--enable-hierarchical-cache(HiCache sits on the radix cache):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-cacheto 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-cachedefault whenEXTRA_SGLANG_ARGSenables 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 stubsetsidthat records the launch argv. HiCache recipe →--enable-hierarchical-cachepresent,--disable-radix-cacheabsent (fails before this change); plain recipe → both defaults still added. Withtests/test_eval_concurrency_scripts.py: 58 passed.ruff check/ruff format --checkclean on the new test (make lintreports the same 1555 pre-existing findings onmain; this change touches no Python underMagpie/).lmsysorg/sglang-rocm:v0.5.20-rocm720-mi35x-20260923(SGLang 0.5.20, torch 2.9.1+rocm7.2.0), modelamd/GLM-5.2-MXFP4, TP4/EP4: patchedsglang_mi355x.shwithMAGPIE_RUN_PHASE=serverand 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; logTree cache initialized: ... hicache_attached=True;/health200 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