You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(vllm): GLM-5.2-MXFP4 vLLM P4D4 example on one MI355X node, image, and the infera changes it needs - #256
Adds a runnable kit for GLM-5.2-MXFP4 served with vLLM, PD-disaggregated inside one 8×MI355X node (P4D4): a TP1 × PP4 prefill with a CPU KV tier on GPUs 0-3, a DP4 decode on GPUs 4-7, MTP 4, KV over Mooncake RDMA loopback (both ends on the same-named NIC, never HIP IPC), and the infera router choosing the decode DP rank. It comes with its image and the infera changes it depends on. Same layout as the SGLang kits of #210.
examples/vllm_p4d4_glm5.2: the kit (env.sh + engine/), InferenceX d490919c client, GSM8K and AL gate.
Not an InferenceX submission: InferenceX maps GLM-5.2 to SGLang (inferencex-e2e/docs/MODELS.md, "Engine submission policy"), and the image carries unmerged patches. The kit measures with InferenceX's own client, eval and scoring as an internal reference for vLLM PD on MI355X.
Type of change
Documentation change (change only to the documentation, either a fix or a new content)
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to not work as expected)
Infra/Build change
Code refactoring
Changes
infera
Rust router, --vllm-mooncake-serial (from feat(router): serial vLLM Mooncake legs (INFERA_VLLM_MOONCAKE_SERIAL=1) #246, now a flag): posts a vLLM Mooncake PD request's decode leg only after the prefill has answered. Concurrent legs could deadlock a prefill that reorders its queue (cache-aware admission) against a decode that had reserved KV. Requires --request-transport http (the serial legs are HTTP; this answers the review on feat(router): serial vLLM Mooncake legs (INFERA_VLLM_MOONCAKE_SERIAL=1) #246 about NATS-registered workers skipping the NATS backlog limits). Forwarded by the Python launcher; Rust-only like --pd-prefill-guard-release. Rust test for the ordering and the failed-prefill case; config and launcher tests.
vLLM engine: infera.engine.vllm.gem_mooncake, vLLM's MooncakeConnector with its KV cache in amdgpu GEM BOs (kv_connector_module_path; allocator named by INFERA_AMD_GEM_ALLOCATOR, unset = upstream). amdgpu 6.19, and 6.16 without peer memory, charge NIC-pinned VRAM twice in the KFD limit through dma-buf.
Tests: tests/unit/engine/test_vllm_gem_mooncake.py, test_vllm_server_arg_parser.py, tests/unit/server/test_nofile_limit.py, test_launch_rust.py; Rust config and disagg tests. manual/reference/cli.md lists the new flag.
Image (deploy/docker/Dockerfile.vllm.glm52, new file next to the canonical Dockerfile.vllm, which stays on v0.25.1)
Base pinned by digest (nightly tags roll off Docker Hub).
scripts/build_mooncake_vllm.sh + patches/mooncake_v0314/: the transfer engine the base installs from PyPI, rebuilt with MC_RDMA_WRITE_PREFER_DEST_NIC (#4540) and MC_IB_TIMEOUT (#4541).
gem/hip_gem_alloc.c: the GEM allocator (/opt/infera-gem/libhip_gem_alloc.so).
Entrypoint: the existing infera_inject_host_ionic.sh.
Example (examples/vllm_p4d4_glm5.2)
One site file (env.sh); engine/up.sh, worker.sh, smoke.sh, eval.sh, agentx/agentx.sh, down.sh, and a read-only check_node.sh (driver / peer memory → GEM, NICs, host memory). Each run records its settings; up.sh waits until the previous deployment's VRAM is free.
Recipe: prefill TP1 × PP4 (layers 20/20/20/18), chunk 4096, cache-aware admission, 1.9 TB CPU KV tier; decode DP4, chunk 2048, --stream-interval 30; FP8 KV, prefix cache, MTP 4 on both legs; MXFP4 indexer K cache and online FP8 dense projections on target layers 0-77, draft layer 78 at shipped precision; router kv-aware with prefill session affinity and --decode-input-demand on --decode-request-weight W.
README: KV registration per driver (GEM), the recipe, validation, reference numbers for C16-C152 (conventional and E2E-normalized interactivity), how to choose W (125000 while the decode is saturated, 1000000 below), notes.
Pareto (MI355X, AgentX, InferenceX d490919c)
Each point on a freshly started deployment, 3,600 s measured, 10 warm-up requests per lane, forced MTP acceptance 3.33 (MTP 4); throughput per GPU over all 8 GPUs. C152 is this PR's validation run; full table in the README.
E2E normalized interactivity (right, the InferenceX dashboard default): C152 / C128 move left (TTFT p90 17.8 / 6.5 s); from C32 down the MI355X SGLang line is level or higher.
Image built from this branch (at 8519af1) on one 8×MI355X node (amdgpu 6.16.13 with peer memory, GEM=0), then the kit as its README says. Since then the serial legs became the --vllm-mooncake-serial router flag (same dispatch code), the base image is pinned by digest (same image), and patches / docs were renamed; at the head, CI-equivalent pytest and Rust checks pass; the image was rebuilt at 8f2c9d0a (before the patch renames), and smoke.sh on it passes 6/6 with the router running --vllm-mooncake-serial. The Mooncake topology now lists host buffers only (its cuda:<i> GPU entries never matched the HIP build's hip:<i> locations; pinning GPUs with hip:<i> entries broke transfers on these one-rail-per-NIC hosts, 27,731 tok/s/GPU at C152), the same resolved topology as the measured runs; smoke 6/6 at 85488ee.
item
result
pytest -m "not slow and not integration" (Python 3.10, as CI)
The same engine and router settings (with the inactive llying-001/vllm#7 also in the series) gave 70,672 / 70,209 / 70,647 / 70,122 at C152 on three other nodes, GEM and non-GEM, and the C16-C128 points in the README.
AI assistance was used to write this change and description.
Checklist:
The functionality is complete
I have commented my code, particularly in hard-to-understand areas
I have made corresponding changes to the documentation
My changes generate no new warnings
I have added tests that prove my fix is effective or that my feature works
New and existing unit tests pass locally with my changes
…g after the prefill answers
With vLLM's MooncakeConnector the router posts the prefill and decode legs of a PD request at once.
The decode reserves KV for a request as soon as its leg arrives, while a prefill that reorders its
queue (cache-aware admission, priority) can hold finished KV the decode has not reserved; under
memory pressure each side waits on the other (a GLM-5.2 PD deployment stalled with the prefill at
0 running / 76 waiting / 99.7% KV and zero prompt throughput).
--vllm-mooncake-serial (Rust backend, forwarded by the Python launcher) posts the decode leg only
after the prefill has answered, through serial_decode shared with ATOM's serial pull; a failed
prefill is returned to the client and never reaches the decode. The serial legs go over HTTP, so
the flag requires --request-transport http (NATS-registered workers would otherwise be dialled
directly and skip the NATS backlog limits). Default: concurrent legs, unchanged.
Signed-off-by: liyingli <liyingli@amd.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every proxied PD request holds a client, a prefill and a decode
connection, so a container's default soft limit of 1024 open files runs
out at a few hundred concurrent requests: accept() fails with EMFILE and
the router answers 502. Lift the soft limit to the hard limit (1M when the
hard limit is unlimited) before the backend is chosen, so the Rust router
inherits it across exec.
Tests: tests/unit/server/test_nofile_limit.py (raised to the hard limit,
unlimited hard limit, already at the limit, setrlimit failure).
Signed-off-by: liyingli <liyingli@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
vLLM 0.34 moved make_arg_parser from vllm.entrypoints.openai.cli_args to
vllm.entrypoints.common.cli_args and expects its FlexibleArgumentParser, so
the vLLM worker launcher died with an ImportError before starting vllm
serve. _vllm_server_arg_parser() imports the new location first and falls
back to the old one for earlier releases.
Tests: stub modules for both layouts (runs without vLLM); in a vLLM 0.34
container tests/engine/vllm/test_disagg_allow_tcp_args.py fails without
this change and passes with it.
Signed-off-by: liyingli <liyingli@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…er objects
amdgpu-dkms 6.16 .. 7.1 charges a KFD allocation pinned by an RDMA NIC through dma-buf twice
in the KFD limit, and hosts without a peer-memory client can only register VRAM through
dma-buf; a large KV cache then leaves the engine out of memory well below its utilization
target. infera.engine.vllm.gem_mooncake (kv_connector_module_path) allocates the KV cache from
a GEM-BO pluggable allocator named by INFERA_AMD_GEM_ALLOCATOR; unset, it is the upstream
connector.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: liyingli <liyingli@amd.com>
TP1 x PP4 prefill (GPUs 0-3, CPU KV tier) and DP4 decode (GPUs 4-7), MTP 4, Mooncake RDMA loopback
with one NIC per GPU, GEM or peer-memory KV registration per driver, and the infera router choosing
the decode DP rank (--decode-request-weight). InferenceX d490919c client, GSM8K and AL gate.
patch.upstream.status.md records the image's vLLM patch series.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: liyingli <liyingli@amd.com>
- Dockerfile.vllm.glm52: pin the nightly base by digest (nightly tags roll off Docker Hub).
- up.sh: --vllm-mooncake-serial on the router instead of the environment variable.
- worker.sh: say why MC_HIP_KFD_PIN_FIX=0 is set (the GEM allocator refuses to start otherwise).
- agentx.sh: say why a one-node PD shape sets IS_MULTINODE=true.
- One description of which amdgpu releases double-charge pinned VRAM (gem_mooncake, hip_gem_alloc.c, README).
- README: C152 from this image; Pareto figure and text with PR #235's points; cli.md lists the new flag.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: liyingli <liyingli@amd.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved issues alter prefill-load accounting and stream-completion semantics, allow failed or unmeasurable acceptance checks to pass, and prevent worker startup when optional host groups are absent.
Adds a GLM-5.2-MXFP4 vLLM deployment kit for prefill/decode disaggregation on one eight-GPU MI355X node, alongside its image and required Infera support. Benchmarks use InferenceX as an internal reference, not an official submission.
Changes:
Adds optional serial Mooncake dispatch, startup file-limit handling, vLLM parser compatibility, and GEM-backed KV allocation.
Provides a pinned ROCm image with vLLM and Mooncake patches.
Adds deployment, correctness, evaluation, and AgentX scripts with configuration and reference results.
File
Description
tests/unit/server/test_nofile_limit.py
Tests startup file-limit handling.
tests/unit/server/test_launch_rust.py
Tests serial flag forwarding and backend validation.
…letion tracking; kit checks
- rust router: serial vLLM Mooncake releases the prefill's load early only in
--pd-prefill-guard-release completion mode (take_prefill_guard, as the concurrent path),
and its decode stream keeps SSE terminator tracking ([DONE] marks completion). New test:
serial_vllm_holds_prefill_load_until_decode_unless_completion_mode.
- eval.sh: the AL gate is report-only; require its verdict to be pass.
- worker.sh: a host without a video or render group no longer aborts the worker.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: liyingli <liyingli@amd.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The ROCm topology uses cuda: keys instead of Mooncake HIP’s hip: keys, causing GPU buffers to fall back to all-NIC routing and allowing cross-socket KV traffic.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Use hip: keys for ROCm GPU topology entries
examples/vllm_p4d4_glm5.2/engine/worker.sh:34
The rebuilt Mooncake HIP backend names GPU locations hip:<i>, not cuda:<i> (GPU_PREFIX definition, also verified at the pinned v0.3.14 tag). Consequently, GPU buffers never match these topology entries and NIC selection falls back to the all-NIC wildcard, defeating the recipe's one-NIC-per-GPU routing and allowing cross-socket KV traffic. Generate hip: keys for this ROCm-only kit.
The topology keyed GPUs as cuda:<i>, which Mooncake's HIP build never matches (it names GPU
locations hip:<i>), so GPU buffers have always used the all-NIC wildcard, with
MC_RDMA_WRITE_PREFER_DEST_NIC putting both ends of a write on the same-named NIC. Keying them
hip:<i> pins each GPU to its nearest NIC instead, and on these hosts (ionic_k reaches only
ionic_k) prefill / decode pairs on different NICs cannot reach each other: at C152 the decode
logged 182 failed KV receives and throughput fell to 27,731 tok/s/GPU (5% failed requests).
Drop the GPU entries (the same resolved topology as before) and say why (review on #256).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: liyingli <liyingli@amd.com>
Re the "Use hip: keys for ROCm GPU topology entries" finding: the diagnosis is right — Mooncake's HIP build names GPU locations hip:<i>, so the cuda:<i> entries never matched and GPU buffers used the all-NIC wildcard. But switching to hip:<i> (each GPU pinned to its nearest NIC) broke the deployment: on these hosts ionic_k only reaches ionic_k, so prefill / decode pairs pinned to different NICs cannot reach each other. Measured on the same node and image at C152: the decode logged 182 failed KV receives, 5.1% of requests failed and throughput fell from 70,432 to 27,731 tok/s/GPU.
The working path is the one we had measured: GPU buffers not pinned, and MC_RDMA_WRITE_PREFER_DEST_NIC=1 (Mooncake#4540) putting both ends of a write on the same-named NIC. 85488ee makes that explicit: the topology now lists only the host-buffer (cpu:<socket>) entries — the same resolved topology as before, since the cuda: entries were never used — and worker.sh / README note 5 say why the GPUs are not pinned, with the numbers above. Smoke on 85488ee: 6/6, 0 failed KV receives.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: liyingli <liyingli@amd.com>
This branch has not been deployed
No deployments
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
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.
Description
Adds a runnable kit for GLM-5.2-MXFP4 served with vLLM, PD-disaggregated inside one 8×MI355X node (P4D4): a TP1 × PP4 prefill with a CPU KV tier on GPUs 0-3, a DP4 decode on GPUs 4-7, MTP 4, KV over Mooncake RDMA loopback (both ends on the same-named NIC, never HIP IPC), and the infera router choosing the decode DP rank. It comes with its image and the infera changes it depends on. Same layout as the SGLang kits of #210.
examples/vllm_p4d4_glm5.2: the kit (env.sh+engine/), InferenceXd490919cclient, GSM8K and AL gate.deploy/docker/Dockerfile.vllm.glm52: vLLM ROCm nightly of mainde7cf7f8+ a GLM-5.2 patch series (each patch an upstream or fork PR's diff, unchanged), Mooncake v0.3.14 rebuilt with [TransferEngine] Add opt-in destination-local GPU write rails kvcache-ai/Mooncake#4540 / #4541, and an amdgpu GEM KV allocator.Not an InferenceX submission: InferenceX maps GLM-5.2 to SGLang (
inferencex-e2e/docs/MODELS.md, "Engine submission policy"), and the image carries unmerged patches. The kit measures with InferenceX's own client, eval and scoring as an internal reference for vLLM PD on MI355X.Type of change
Changes
infera
--vllm-mooncake-serial(from feat(router): serial vLLM Mooncake legs (INFERA_VLLM_MOONCAKE_SERIAL=1) #246, now a flag): posts a vLLM Mooncake PD request's decode leg only after the prefill has answered. Concurrent legs could deadlock a prefill that reorders its queue (cache-aware admission) against a decode that had reserved KV. Requires--request-transport http(the serial legs are HTTP; this answers the review on feat(router): serial vLLM Mooncake legs (INFERA_VLLM_MOONCAKE_SERIAL=1) #246 about NATS-registered workers skipping the NATS backlog limits). Forwarded by the Python launcher; Rust-only like--pd-prefill-guard-release. Rust test for the ordering and the failed-prefill case; config and launcher tests.RLIMIT_NOFILEsoft limit to the hard limit at start-up; a container's 1024 ran out at C104 (accept()EMFILE).vllm serveargs with vLLM >= 0.34 (make_arg_parsermoved tovllm.entrypoints.common.cli_argsand needs itsFlexibleArgumentParser).infera.engine.vllm.gem_mooncake, vLLM's MooncakeConnector with its KV cache in amdgpu GEM BOs (kv_connector_module_path; allocator named byINFERA_AMD_GEM_ALLOCATOR, unset = upstream). amdgpu 6.19, and 6.16 without peer memory, charge NIC-pinned VRAM twice in the KFD limit through dma-buf.tests/unit/engine/test_vllm_gem_mooncake.py,test_vllm_server_arg_parser.py,tests/unit/server/test_nofile_limit.py,test_launch_rust.py; Rustconfiganddisaggtests.manual/reference/cli.mdlists the new flag.Image (
deploy/docker/Dockerfile.vllm.glm52, new file next to the canonicalDockerfile.vllm, which stays on v0.25.1)patches/vllm_glm52/series.txt, 11 patches, status per patch inpatch.upstream.status.md: vllm-project/vllm #61985 (MXFP4 indexer K cache), #69540 and #68845 (CPU KV tier), #69616 (fused shared experts under DP), and llying-001/vllm fork PRs ci: docs-only changes skip code jobs + add Sphinx manual build #11 (#58710 rebased), feat(kvd): auto-offload plain GQA/MHA fp8 KV cache to L3 #12 (MTP draft keeps the FP8 indexer cache), test(e2e): add mixed + kvd L3 offload test to CI #13 (AITER AG/RS in FULL graphs), remove unused reference #14 (#60909 with the CPU KV half), Upgrade SGLang base image to v0.5.15.post1 (official release repo) #15 / ci: skip code jobs for examples/ and *.md/LICENSE #16 (MXFP4 MoE dispatch, one packed all-gather) and fix(release): unblock manual job — build docs on Python 3.12 #17 (exact Triton DSA decode top-k). Upgrade SGLang base image to v0.5.15.post1 (official release repo) #15-fix(release): unblock manual job — build docs on Python 3.12 #17 are off by default and switched on by the kit.scripts/build_mooncake_vllm.sh+patches/mooncake_v0314/: the transfer engine the base installs from PyPI, rebuilt withMC_RDMA_WRITE_PREFER_DEST_NIC(#4540) andMC_IB_TIMEOUT(#4541).gem/hip_gem_alloc.c: the GEM allocator (/opt/infera-gem/libhip_gem_alloc.so).infera_inject_host_ionic.sh.Example (
examples/vllm_p4d4_glm5.2)env.sh);engine/up.sh,worker.sh,smoke.sh,eval.sh,agentx/agentx.sh,down.sh, and a read-onlycheck_node.sh(driver / peer memory →GEM, NICs, host memory). Each run records its settings;up.shwaits until the previous deployment's VRAM is free.--stream-interval 30; FP8 KV, prefix cache, MTP 4 on both legs; MXFP4 indexer K cache and online FP8 dense projections on target layers 0-77, draft layer 78 at shipped precision; router kv-aware with prefill session affinity and--decode-input-demand on --decode-request-weight W.GEM), the recipe, validation, reference numbers for C16-C152 (conventional and E2E-normalized interactivity), how to chooseW(125000 while the decode is saturated, 1000000 below), notes.Pareto (MI355X, AgentX, InferenceX
d490919c)Each point on a freshly started deployment, 3,600 s measured, 10 warm-up requests per lane, forced MTP acceptance 3.33 (MTP 4); throughput per GPU over all 8 GPUs. C152 is this PR's validation run; full table in the README.
918524ffclient.Validation
Image built from this branch (at 8519af1) on one 8×MI355X node (amdgpu 6.16.13 with peer memory,
GEM=0), then the kit as its README says. Since then the serial legs became the--vllm-mooncake-serialrouter flag (same dispatch code), the base image is pinned by digest (same image), and patches / docs were renamed; at the head, CI-equivalent pytest and Rust checks pass; the image was rebuilt at 8f2c9d0a (before the patch renames), andsmoke.shon it passes 6/6 with the router running--vllm-mooncake-serial. The Mooncake topology now lists host buffers only (itscuda:<i>GPU entries never matched the HIP build'ship:<i>locations; pinning GPUs withhip:<i>entries broke transfers on these one-rail-per-NIC hosts, 27,731 tok/s/GPU at C152), the same resolved topology as the measured runs; smoke 6/6 at 85488ee.pytest -m "not slow and not integration"(Python 3.10, as CI)cargo fmt --check,cargo clippy --locked --all-targets -- -D warnings,cargo test --lockedsmoke.sh(real acceptance)infx.bench eval, 1,319 questions, concurrency 152, real acceptance)infx.bench al-gate, MTP 4)infx.bench agentic, 3600 s,SIM_ACCEPT_LEN=3.33)The same engine and router settings (with the inactive llying-001/vllm#7 also in the series) gave 70,672 / 70,209 / 70,647 / 70,122 at C152 on three other nodes, GEM and non-GEM, and the C16-C128 points in the README.
AI assistance was used to write this change and description.
Checklist:
🤖 Generated with Claude Code