config(musespark): tune B300 SGLang AgentX settings per concurrency / config(musespark): 按并发调整 B300 SGLang AgentX 参数 by shyeh25 · Pull Request #4341 · SemiAnalysisAI/InferenceX · GitHub
Skip to content

config(musespark): tune B300 SGLang AgentX settings per concurrency / config(musespark): 按并发调整 B300 SGLang AgentX 参数 - #4341

Open
shyeh25 wants to merge 1 commit into
mainfrom
musespark-fp4-b300-sglang-agentic-per-conc
Open

shyeh25 wants to merge 1 commit into
mainfrom
musespark-fp4-b300-sglang-agentic-per-conc

Conversation

@shyeh25

@shyeh25 shyeh25 commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replace the Muse Spark Open B300 SGLang AgentX search space (TP8/EP8 at concurrency 1–128 with one shared server config) with 11 per-concurrency points, each with its own override_tp{N}_c{conc} section:

  • TP8/EP8, GPU-resident KV: concurrency 1, 4, 8, 14
  • TP4/EP4, GPU-resident KV: concurrency 4
  • TP4/EP4, DRAM HiCache (120–175 GB per rank): concurrency 10, 16, 20, 28, 36, 40

Per point, the recipe sets request admission and decode graph batch limits, memory fraction, SWA/full ratio, prefill-decode interval and chunked prefill; the HiCache points enable layernorm SP with MegaMoE, and concurrency 16 and above use shortest-prefill-first. TP8 concurrency 2 and 16–128 are no longer swept. Except at concurrency 1, the explicit draft attention backend is removed, so SGLang uses the image default. The image, checkpoint and DFlash2 draft settings are unchanged.

AI model disclosure
  • Model/version: claude-opus-5-5 (the identifier exposed by the runtime).
  • Role: ran the tuning campaign (the orchestrating agent and its delegated task agents all used claude-opus-5-5), generated the recipe, master-config and perf-changelog changes from the measured runs, checked them locally, and drafted this PR description.
PR checklist and change type

Type of Change

  • Bug fix
  • New feature
  • Configuration change
  • Documentation update
  • Other (please describe)

Checklist

  • I have completed the AI model disclosure and kept it current
  • I have tested my changes locally
  • I have updated documentation if necessary
  • If python -m infx.matrix.changed --base origin/main lists affected config keys, I have appended one new entry covering them to the physical end of inferencex-e2e/perf-changelog.yaml; if it lists none, I have added none. I have not edited historical entries
  • If this PR appends an inferencex-e2e/perf-changelog.yaml entry, it carries exactly one primary sweep label (a maintainer applies it on fork PRs): full-sweep-fail-fast (recommended), full-sweep-enabled, or non-canary-full-sweep-enabled. Optional modifiers all-evals, evals-only, and agentx-fast require a primary label; the last two block reuse while applied.
  • Before merging via reuse, an authorized maintainer (OWNER/MEMBER/COLLABORATOR) has commented /use <run_id> (or the legacy /reuse-sweep-run) on this PR. Do this only once there is a final full sweep that is all green with evals passing, since after this comment the primary sweep label will no longer automatically kick off new sweeps. Remove and re-add the primary sweep label to force a new sweep.
中文

将 Muse Spark Open B300 SGLang AgentX 的搜索空间(TP8/EP8、并发 1–128、共用同一套服务器配置)替换为 11 个按并发配置的点,每个点有独立的 override_tp{N}_c{conc} 段:

  • TP8/EP8,KV 仅驻留 GPU:并发 1、4、8、14
  • TP4/EP4,KV 仅驻留 GPU:并发 4
  • TP4/EP4,DRAM HiCache(每 rank 120–175 GB):并发 10、16、20、28、36、40

每个点分别设置请求准入与 decode graph 批大小上限、显存占用比例、SWA/full 比例、prefill-decode interval 和 chunked prefill;HiCache 点启用 layernorm SP 与 MegaMoE,并发 16 及以上使用 shortest-prefill-first。TP8 不再压测并发 2 以及 16–128。除并发 1 外,移除显式指定的草稿注意力后端,改用镜像默认值。镜像、模型检查点和 DFlash2 草稿模型设置保持不变。

AI 模型使用说明:运行环境提供的模型标识为 claude-opus-5-5。工作内容包括执行调优(编排代理及其委派的任务代理均使用 claude-opus-5-5)、根据实测结果生成配方、主配置和性能变更记录的改动、在本地检查,以及起草本 PR 说明。

🤖 Generated with Claude Code

Replace the Muse Spark Open B300 SGLang AgentX search space with 11
per-concurrency points: TP8/EP8 with GPU-resident KV at concurrency 1, 4,
8 and 14; TP4/EP4 with GPU-resident KV at concurrency 4; TP4/EP4 with DRAM
HiCache at concurrency 10, 16, 20, 28, 36 and 40.

将 Muse Spark Open B300 SGLang AgentX 搜索空间替换为 11 个按并发配置的点:
TP8/EP8 仅 GPU KV(并发 1、4、8、14);TP4/EP4 仅 GPU KV(并发 4);
TP4/EP4 DRAM HiCache(并发 10、16、20、28、36、40)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

@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.

I reviewed this PR and didn't find any bugs. It's a per-concurrency performance retune of files with code owners, so a look from one of the NVIDIA config owners would still be worthwhile.

What was reviewed:

  • The 11 override_tp{N}_c{conc} blocks against the three nvidia-master search-space entries. TP, EP, KV offloading and CONC line up one-to-one: TP8 none at 1/4/8/14, TP4 none at 4, and TP4 dram at 10/16/20/28/36/40.
  • The base move to 4 GPUs with TP4/EP4. Every TP8 block overrides gpus and TP/EP back to 8, and only c1 keeps the fa4 draft attention backend.
  • The tuning choices an owner may want to confirm: at TP8 c4/c8 and TP4 c4, max-running-requests (2) is below CONC, and at TP4 c28/c36/c40 it is above CONC (56/72/80).
  • The changelog entry is appended at the tail, in English, and covers the single affected config key. Its pr-link is still the pull/XXX placeholder.
Extended reasoning...

The change rewrites the Muse Spark Open B300 SGLang agentic DFlash srt-slurm recipe into 11 per-concurrency overrides, updates the matching nvidia-master.yaml search space and appends one perf-changelog entry. It touches no security-sensitive surface: only benchmark server flags, env vars and sweep points. The recipe overrides and the master search space match on TP/EP, KV offloading and concurrency. I deferred instead of approving because CODEOWNERS assigns both nvidia-master.yaml and the b300 srt-slurm recipes to named NVIDIA config owners. The per-point admission and memory settings are also measured tuning choices that the owners should confirm.

@shyeh25 shyeh25 added the full-sweep-fail-fast Full sweep with canary gate; first failure cancels the rest of that matrix (recommended) label Oct 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@nvpohanh

Copy link
Copy Markdown
Collaborator

[by Claude Code] The SGLang cookbook integration of this PR's AgentX config (musespark-fp4-b300-sglang-agentic-dflash) will happen in sgl-project/sglang#45513, in the Agentic Long-Context Deployment section of the Muse Spark Open cookbook page.

This PR has no authorized /use <run_id> comment yet, so the cookbook shows the recipe at this PR's head (37ce29641) as "in progress". A later cookbook PR switches it to the measured run once a run is pinned or this PR merges.

@nvpohanh

Copy link
Copy Markdown
Collaborator

[by Claude Code] sgl-project/sglang#45513 has been merged. This PR's AgentX config (musespark-fp4-b300-sglang-agentic-dflash) is now in the Agentic Long-Context Deployment section of the SGLang Muse Spark Open cookbook: https://docs.sglang.io/cookbook/autoregressive/Meta/MuseSparkOpen#agentic-long-context-deployment

This PR has no authorized /use <run_id> comment yet, so the cookbook shows the recipe at this PR's head (37ce29641) as "in progress". A later cookbook PR switches it to the measured run once a run is pinned or this PR merges.

@nvpohanh

Copy link
Copy Markdown
Collaborator

/use 39385088584

@github-actions

Copy link
Copy Markdown
Contributor

@nvpohanh staging run 39385088584. Existing staged runs will be preserved; a completion link will be posted here.

@nvpohanh

Copy link
Copy Markdown
Collaborator

As a PR reviewer and CODEOWNER, I have reviewed this and have:

  • Verified that as of the moment of typing this, this is the latest version of PR_REVIEW_CHECKLIST.md
  • Verified that the general code quality meets the InferenceX standard and does not make the code quality any worse.
  • Verified that this PR has passed PR validation. Please link to GitHub Action workflow that shows this.
  • Verified that this PR passes evals. Please link to GitHub Action workflow that shows this.
  • Verified that speculative decoding PRs uses chat templates to align the AL distribution to real world
  • Verified that every draft model and draft head is served as it ships: the draft that ships with the served checkpoint, at its stored precision, through the pinned upstream image's default handling, with the shipped and effective draft precision recorded in the additional detail section. No submission-side quantization, dtype override, checkpoint substitution, or patch may lower draft precision below that default, regardless of eval results or AL. Explicitly verified that SGLANG_NVFP4_CKPT_FP8_NEXTN_MOE is not enabled in the effective recipe, including inherited settings; enabling it is prohibited going forward, and historical runs do not grant an exception. See Draft-model precision for what counts as the default and the MLPerf comparison.
  • For agentic workloads: verified that speculative-decoding configs (EAGLE / MTP / draft models) run with simulated synthetic acceptance, with the acceptance-length value taken from the committed golden AL curve in infx/golden_al_distribution/ for that model, thinking mode, and draft length. A submission may choose any supported draft length, but it may not substitute a different acceptance target.
  • Verified against the current MODELS.md that this PR does not submit a deprecated model, scenario, or model-scenario combination.
  • Verified that the model architecture isn't changed with benchmark hacks like using --hf-overrides to skipping indexer for every x layers on models that don't natively support this. As a general rule, we won't accept optimizations that reduces the number of model architecture FLOPs. Anything that makes that same computation run faster is fair game; target/verifier FLOPs at lower precisions is fine, given that the config passes private evals, but this does not permit lowering draft-model or draft-head precision below what ships. As an general north star princple, we should only use optimizations which is used in production by customers that care about accuracy
  • For affected Dynamo TRT-LLM benchmarks, verified that iteration/KV-cache metrics are collected and published under the pinned Dynamo implementation and effective engine settings. Resolve the installed Dynamo version separately from the container tag; use supported metrics controls without requiring KV events. Record the version and configuration evidence in the additional detail section. See verifier Check 17. N/A for unaffected serving paths or frameworks without these Dynamo settings.
  • If an company claims that they support vLLM/SGLang as first class LLM inference engines on their hardware, I have verified that the respective vLLM submission made using upstream https://hub.docker.com/u/vllm docker repo, upstream SGLang https://hub.docker.com/u/lmsysorg docker repo. The only exceptions are for new hardware, such as MI455X UALoE72, Vera Rubin NVL72, Rubin NVL8, etc., and for new model architectures where there is an actual reason why vLLM/SGLang does not fundamentally support them yet as supported by vLLM/SGLang community maintainers
  • If an company claims that they support vLLM/SGLang as first class upstream in-tree LLM inference engines on their hardware, I have have verified that the respective vLLM/SGLang submission has been made before additional frameworks (TRT-LLM, ATOM, etc.). The only exceptions are for new hardware, such as MI455X UALoE72, Vera Rubin NVL72, Rubin NVL8, etc., and for new model architectures where there is an actual reason why vLLM/SGLang does not fundamentally support them yet.
  • Verified that every affected vLLM/SGLang production serving configuration in this PR, including Dynamo deployments, is documented in the official vLLM recipes and/or the SGLang cookbook, for both single-node and multi-node aggregated and disaggregated serving. The documentation covers production-useful flags, environment variables, and launch commands (including prefill, decode, and router/frontend commands for disaggregation); InferenceX-only benchmark/harness settings are excluded with reasoning in the additional detail section:
    • I linked the corresponding upstream PR in the vLLM recipe repo or SGLang cookbook source repo and verified that it is MERGED before this InferenceX PR merges. An opened, draft, or closed-without-merge upstream PR does not satisfy this requirement. If the matching recipe was already published, I linked the published recipe/cookbook page in the additional detail section below.
  • Verified that this PR does not patch the inference engine or serving stack — the pinned image must run as shipped. This covers .patch files / git apply / patch, inline patches embedded in benchmark scripts (e.g. a python3/sed heredoc that rewrites installed engine sources before serving), in-place edits of site-packages, monkey-patching, overwriting container files, and installing forked/rebuilt engine wheels on top of the pinned image. The only exception is a patch covered by a filled-out waiver at docs/waiver/<PR_NUMBER>.md — named after the PR that introduces the patch and filed in that same PR, stating what is patched, why the unmodified upstream image cannot run this benchmark, the upstream PR/issue link, and the removal plan — which I have linked below in the additional detail section.
  • If this PR uses append-only: true, verified that it only adds generated points or recipe variants inside a selected existing config/scenario and existing same-image visual curve: every previously generated point remains present with the same recipe, no prior point is removed or rerun, and every benchmark-affecting change in the complete diff can affect only the corresponding newly appended points (never an existing point), regardless of which file contains it.
  • If any of the above criteria cannot reasonably be satisfied, I have provided additional reasoning below.
  • Reported measured throughput/E2EL Pareto counts and evidence per affected curve (≥5 points strongly recommended). Below 5 or unverifiable: tag a core maintainer for review; recorded admin bypass required before merge. N/A if no curves are affected. Details.

Additional detail section:

  • Scope: one config, musespark-fp4-b300-sglang-agentic-dflash. It is a single-node aggregated SGLang deployment on B300 with DFlash2, agentic-coding only.
    • Changed files: musespark/sglang/b300-fp4-mtp/agentic.yaml (11 per-concurrency override_tp{N}_c{conc} sections), nvidia-master.yaml (three search-space rows), and one appended perf-changelog.yaml entry.
    • The search-space rows are: TP8/EP8 with GPU KV at c1/4/8/14; TP4/EP4 with GPU KV at c4; TP4/EP4 with DRAM HiCache at c10/16/20/28/36/40.
    • Assessed head: 37ce29641296bf4e64eaf8e121e17a4f04d4e5b9.
  • PR validation: Run Sweep 39385088584 ran on head 37ce2964 (attempt 1, pull_request).
    • All 11 agentic / jobs (TP8 c1/4/8/14, TP4 c4, TP4 HiCache c10/16/20/28/36/40) succeeded, and so did the agentic eval / job.
    • The fixed-sequence and multi-node lanes were skipped because this PR has no such configs.
    • Result artifacts (bmk_agentic_*, eval_results_all) are unexpired. The run is pinned with /use 39385088584.
    • Every point used the full semianalysis_cc_traces_weka_062126 corpus (semianalysisai/cc-traces-weka-062126).
  • Evals: the agentic eval / job ran the TP4 HiCache c40 recipe on the same image digest sha256:8cfc5a72…bb2b0a.
    • gsm8k em_strict = 0.9773 (± 0.0041, n=1319). This clears the 0.90 default threshold in infx/evals/thresholds.yaml, which has no musespark override.
    • Artifact: eval_results_all from run 39385088584.
  • Chat template: AgentX replay (agentx profile) uses an AIPerf endpoint of type: chat (streaming) at all 11 points (profile_export_aiperf.json → input_config.endpoint). The server applies chat_template=/model/chat_template.jinja.
  • Draft precision (served as shipped): the draft is RadixArk/Muse-Spark-Open-DFlash2 (HF revision main, sha 46c90f41).
    • Shipped precision: BF16. Its config.json has dtype: bfloat16, there is no quantization config or hf_quant_config.json, and the safetensors hold 4.89B BF16 params.
    • No draft overrides: the recipe sets no draft quantization, dtype, revision, draft KV dtype or checkpoint override. This PR only removes the explicit speculative-draft-attention-backend: fa4 except at TP8 c1.
    • Server-log evidence: all 11 server logs show _speculative_draft_quantization_explicitly_set=False and speculative_draft_kv_cache_dtype=None. The draft loads through the default loader without a quant tag, unlike the target's quant=modelopt_fp4, quant_algo=NVFP4.
    • Memory check: draft weight memory is 3.61–3.63 GB per GPU at TP4 and 2.60 GB per GPU at TP8. That solves to about 9.8 GB in total, which matches the 9.77 GB BF16 checkpoint; NVFP4 would be about 2.7 GB.
    • Effective draft weight precision: BF16 = shipped precision.
    • Draft KV cache at TP8 c1: the retained fa4 draft backend makes the image force BF16 draft KV (DFLASH fa4 draft: overriding KV cache dtype float8_e4m3fn -> bfloat16).
    • Draft KV cache at the other 10 points: the image's default draft backend (trtllm_mha) inherits the target's fp8_e4m3 KV cache. This is the framework's default handling, an upstream-supported KV dtype applied consistently to target and draft.
    • SGLANG_NVFP4_CKPT_FP8_NEXTN_MOE does not appear in the recipe, the master config, the generated config.yaml/sbatch, or any of the 11 server logs and log tarballs. It is not enabled. DFlash2 is a dense Qwen3-style draft with no NextN MoE.
  • Golden AL: the harness maps DFlash speculative-num-draft-tokens: 8 to num_speculative_tokens = 7.
    • musespark_dflash.yaml gives muse-spark-open-816b-a42b-nvfp4 / thinking_on / 7 = 4.05.
    • All 11 server logs show SGLANG_SIMULATE_ACC_LEN=4.05, SGLANG_SIMULATE_ACC_METHOD=match-expected and SGLANG_SIMULATE_ACC_TOKEN_MODE=real-draft-token. The recipe hard-codes none of them.
  • MODELS.md: musespark (Muse Spark Open 816B-A42B, added 2026-10-15) lists Agentic coding with the SGLang DFlash2 draft as active, with no deprecated scenarios.
  • No architecture hacks: there are no --hf-overrides or json-model-override-args (effective json_model_override_args='{}'), and no layer, expert or indexer skipping. The changes are TP/EP, admission and graph-batch limits, memory fraction, SWA ratio, prefill-decode interval, chunked prefill, schedule policy, layernorm-SP/MegaMoE, HiCache sizing, and cache-slot tuning only.
  • Dynamo TRT-LLM metrics: N/A. This is a direct SGLang deployment with no Dynamo TRT-LLM serving path.
  • Upstream image / engine order: the image is lmsysorg/sglang:dev-muse-spark-open@sha256:8cfc5a72cb296771f5f8a4a4688cb6d05685610a830cbb616fa4ab0eb7bb2b0a. It comes from the upstream lmsysorg org and this PR does not change it. This is an SGLang submission, so the engine-first ordering is satisfied.
  • Upstream recipe: sgl-project/sglang#45513 is MERGED (2026-10-21T05:22:39Z, merge commit 1689cb2d).
    • It is published at https://docs.sglang.io/cookbook/autoregressive/Meta/MuseSparkOpen#agentic-long-context-deployment, from docs/src/snippets/agentx/meta-models/muse-spark-open.jsx with provenance pr 4341, sha 37ce2964.
    • B300 Agg TP8·EP8 entry: documents the full python3 -m sglang.launch_server command.
      • Args: TP8/EP8, modelopt_fp4, flashinfer_trtllm MoE, trtllm_mha, fp8_e4m3 KV, page size 128, breakable prefill CUDA graph, DFLASH with DFlash2 and 8 draft tokens, block verification, fa4 draft attention, mem-fraction-static 0.88, swa-full-tokens-ratio 0.3, muse parsers, mm-feature-transport cpu, tokenizer-worker-num 4, enable-http2.
      • Env: SGLANG_DFLASH_EAGER_DRAFT_SAMPLER, SGLANG_OPT_UNIFIED_CACHE_FREE_OUT_OF_WINDOW_SLOTS, SGLANG_UNIFIED_RADIX_TREE_CORE_BACKEND, SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN, SGLANG_TIMEOUT_KEEP_ALIVE, TVM_FFI_CUDA_ARCH_LIST, OMP_NUM_THREADS, PYTORCH_CUDA_ALLOC_CONF.
      • Per-point patches for c1/c4/c8/c14: max-running-requests/cuda-graph-max-bs-decode 1/2/2/14, prefill-decode-interval 64, and draft-backend removal from c4.
    • B300 Agg TP4·EP4 entry: documents c4 (TP4/EP4, limit 2, interval 64) and every HiCache point c10/16/20/28/36/40.
      • Args: max-running-requests/cuda-graph-max-bs-decode 4/12/20/56/72/80, chunked-prefill-size/max-prefill-tokens 8192/16384, mem-fraction-static, swa-full-tokens-ratio, schedule-policy shortest-prefill-first, prefill-decode-interval 96/80/80/24/64, layernorm-SP/MegaMoE, hicache-size 120/120/170/170/175/170.
      • Env: SGLANG_OPT_DEEPGEMM_MEGA_MOE_NUM_MAX_TOKENS_PER_RANK 2048/4096, and PYTORCH_CUDA_ALLOC_CONF removed from c16.
      • I matched these against the effective server_args in each run log.
    • InferenceX-only settings excluded from upstream coverage:
      • enable-metrics and enable-cache-report, which the AIPerf harness scrapes.
      • PYTHONNOUSERSITE/PYTHONUNBUFFERED and HF_HUB_OFFLINE, for the staged checkpoint.
      • The watchdog-timeout and health-check polling, which are cold-load plumbing.
      • All benchmark.env client settings (TOKENIZER, AIPERF_*, CONC, KV_OFFLOADING).
      • The cluster-local served-model-name/staged /model plumbing.
      • The synthetic-acceptance env injected by the harness.
  • No engine patches: the diff changes only YAML. The recipe has no setup scripts, patches, pip install, file overwrites, or monkey-patching, so no waiver is needed.
  • append-only: true: N/A. The appended changelog entry does not use append-only.
  • Pareto coverage: one affected curve: Muse-Spark-Open · agentic-coding · b300_sglang · FP4.
    • No other config maps to this series; the other musespark SGLang configs are on B200/GB200/GB300/H100/H200.
    • I measured from the 11 bmk_agentic_musespark_* artifacts of run 39385088584 (head 37ce2964, same image), with x = E2EL (s) and y = request_metrics.throughput.per_gpu.total_tput_tps, computed with infx.workflows.pareto_coverage:
    • P90 E2EL: 7 frontier points / 11 measured: TP8 c14 (8.61 s, 10164), TP4 c10 (12.61 s, 16810), c16 (16.62 s, 24357), c20 (18.25 s, 31115), c28 (23.19 s, 38798), c40 (29.38 s, 41874), c36 (35.42 s, 42588).
    • P75 E2EL (reported separately): 7 frontier points / 11 measured, the same seven points.
    • There are no invalid or missing points.
  • The PR branch currently conflicts with main only in the append-only inferencex-e2e/perf-changelog.yaml tail, which is resolved at merge. main has not changed the musespark-fp4-b300-sglang-agentic-dflash master-config entry or the B300 recipe since this PR's base.

Signed: nvpohanh

@github-actions

Copy link
Copy Markdown
Contributor

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

full-sweep-fail-fast Full sweep with canary gate; first failure cancels the rest of that matrix (recommended)

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants