Skip to content

[WIP] bench: add GLM-5.2 PD AgentX workflow - #161

Draft
llying-001 wants to merge 6 commits into
mainfrom
llying/bench/sglang_glm5p2_agentx
Draft

[WIP] bench: add GLM-5.2 PD AgentX workflow#161
llying-001 wants to merge 6 commits into
mainfrom
llying/bench/sglang_glm5p2_agentx

Conversation

@llying-001

Copy link
Copy Markdown
Contributor

Description

Summary

This WIP PR adds a reproducible GLM-5.2 1P1D benchmark and validation workflow for two MI355X nodes.

Planned benchmark coverage includes:

  • Pinned xiaobochen SGLang/AITER optimization layer
  • Two-stage image build and cross-node digest verification
  • Node inventory and selection
  • Diagnostic RDMA/Mooncake preflight
  • Correctness, long-context, tool-call, and GSM8K validation
  • KV-aware AgentX C8/3600s measurement
  • Analysis and evidence reporting

Supporting changes already included

  • Avoid ephemeral-port reuse for delayed KV-event publishers.
  • Add explicit Mooncake producer-write diagnostics while retaining READ as the public default.
  • Fix engine-ready timeout and RDMA mount propagation in the GLM-5.2 example.
  • Isolate the fork-specific rejection-sampling patch behind an explicit build opt-in.
  • Support the fork’s /sglang source layout.

WIP status

The supporting shared changes have been pushed. bench/glm5p2_1p1d/ is still local and has not yet been committed to this PR.

Validation

  • Focused unit tests: 49 passed
  • Complete tests/unit/tools: 31 passed
  • Ruff, formatting, shell syntax, and DCO checks passed

Remaining validation

The main libionic1-only image still needs to be rebuilt and rerun for production Mooncake WRITE on the target cluster.

llying-001 and others added 5 commits September 8, 2026 14:03
Signed-off-by: liyingli <liyingli@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: liyingli <liyingli@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: liyingli <liyingli@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: liyingli <liyingli@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: liyingli <liyingli@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI lite review requested due to automatic review settings September 8, 2026 14:17
@llying-001
llying-001 marked this pull request as draft September 8, 2026 14:17

Copilot AI 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.

🟡 Changes recommended

The new ready-timeout unit test injects stub sglang modules into sys.modules without restoring them, which can leak into other tests and cause session-level flakiness.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds supporting infrastructure for a reproducible GLM-5.2 PD benchmark workflow by tightening engine startup/port-allocation contracts, expanding Mooncake KV preflight diagnostics to cover producer-push (WRITE), and scoping a fork-only SGLang patch behind an explicit build opt-in.

Changes:

  • Add Mooncake preflight read/write operation selection and WRITE-side verification, with accompanying unit tests and documentation.
  • Make delayed-bind publishers avoid ephemeral-port reuse by consistently using free_tcp_port_block(1) and by hardening free_tcp_port_block’s contract.
  • Introduce a fork-only SGLang rejection-sampling patch applied only when explicitly enabled at image build time, and document its scope/status.
File summaries
File Description
tests/unit/tools/test_preflight_kv.py Adds unit coverage for Mooncake preflight opcode selection, WRITE dispatch, and target-side verification.
tests/unit/engine/test_ready_timeout.py Adds tests asserting the INFERA_ENGINE_READY_TIMEOUT contract across SGLang/vLLM wrappers.
tests/unit/common/test_net_ports.py Updates port-allocation tests for non-ephemeral single-port blocks and invalid count handling.
manual/reference/environment.md Documents INFERA_PREFLIGHT_MOONCAKE_OPCODE and INFERA_ENGINE_READY_TIMEOUT.
infera/tools/preflight/network/mooncakeperf.py Adds WRITE-mode (producer-push) Mooncake probe support plus verification/reporting updates.
infera/engine/vllm/main.py Uses free_tcp_port_block(1) for KV-events port selection to avoid ephemeral reuse during long startup.
infera/engine/sglang/worker.py Uses free_tcp_port_block(dp_size) even for DP=1 to avoid ephemeral reuse during long startup.
infera/engine/atom/main.py Uses free_tcp_port_block(1) for ATOM KV-events port selection to avoid ephemeral reuse during long startup.
infera/common/net.py Clarifies free_tcp_port vs free_tcp_port_block guidance and rejects non-positive block sizes.
examples/sglang_1p1d_glm5.2/engine/up.sh Passes through HOST_RDMA_MOUNT into the container environment.
examples/sglang_1p1d_glm5.2/engine/leg.sh Renames the example startup timeout env var to INFERA_ENGINE_READY_TIMEOUT.
deploy/docker/patches/sglang_disagg/README.md Updates patch documentation and describes the fork-only rejection-sampling patch rationale.
deploy/docker/patches/sglang_disagg_fork/patch_pd_disable_implicit_rocm_rejection_sampling.py New fork-specific patch script disabling implicit ROCm rejection sampling for PD decode.
deploy/docker/patch.upstream.status.md Documents the fork-only patch scope and retirement criteria.
deploy/docker/Dockerfile.sglang Derives SGLANG_DIR from the installed package location and applies the fork-only patch behind a build arg.
Review details
  • Files reviewed: 15/15 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 375 to +379
json.dump(info, fh)
os.replace(tmp, os.path.join(sig, "target.json"))
_wait_file(os.path.join(sig, "done"), _DONE_TIMEOUT)
if operation == "write" and info.get("ok") and buf is not None:
verified = _verify(buf.host_bytes(), gpu_id, buf.chunk, buf.nchunk)
Comment on lines +20 to +37
def _load_sglang_ready_timeout():
# The dev/unit-test extra intentionally does not install the vendor SGLang
# package. The worker only needs this type at import time for these tests.
if importlib.util.find_spec("sglang") is None:
sglang = ModuleType("sglang")
sglang.__path__ = []
srt = ModuleType("sglang.srt")
srt.__path__ = []
server_args = ModuleType("sglang.srt.server_args")
server_args.ServerArgs = object
sys.modules.update(
{
"sglang": sglang,
"sglang.srt": srt,
"sglang.srt.server_args": server_args,
}
)
return import_module("infera.engine.sglang.worker")._ready_timeout
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.

2 participants