Skip to content

[Test] [GB300] glm5_3: Add GLM-5.3 E2E tests and a ci_models.yaml entry for the GB300 runner - #92

Merged
YAMY1234 merged 4 commits into
sgl-project:mainfrom
mattteochen:glm52-ll/glm5_3-e2e
Nov 29, 2026
Merged

YAMY1234 merged 4 commits into
sgl-project:mainfrom
mattteochen:glm52-ll/glm5_3-e2e

Conversation

@mattteochen

@mattteochen mattteochen commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

GLM-5.3 / GLM-5.2 has no end-to-end tests and no test/e2e/ci_models.yaml entry, so run-ci-sglang cannot run it. Its TP4 setup fits SGLang's four-GPU GB300 runner. This PR adds that setup's E2E tests, following the DeepSeek-V4.1-Flash layout and the comparison protocol in AGENTS.md: accuracy against native SGLang with the megakernel off, and stock parity with every slot off.

Once the glm5_3 entry is on main, sync-ci-labels.yml creates the run-ci-sglang:glm5_3 label. That label can then run on #75 and on later GLM-5.3 PRs.

Modifications

  • test/e2e/glm5_3_server.py holds the model and the TP4 launch the spec admits, as docs/models/glm5_3.md launches it.
    • The model is nvidia/GLM-5.2-NVFP4 by default; SGLANG_NVIDIA_MEGAKERNEL_E2E_MODEL_PATH overrides it.
    • The launch arguments are --tp 4 --kv-cache-dtype fp8_e4m3 --page-size 64 --attention-backend dsa --dsa-decode-backend trtllm --moe-runner-backend flashinfer_trtllm --disable-shared-experts-fusion, EAGLE 5 steps / top-k 1 / 6 draft tokens, and --max-running-requests 16 --cuda-graph-max-bs-decode 16.
    • The environment is SGLANG_ENABLE_EMBED_REPLICATION=1.
    • Both arms use the same arguments and environment; only --enable-nvidia-megakernel differs.
  • test/e2e/test_glm5_3_server.py compares accuracy against the baseline:
    • It launches the baseline, scores it and stops it, then does the same for the candidate.
    • The evaluation is GSM8K, 5 shots, all 1319 test questions, greedy, 512 new tokens, with real speculative acceptance. Each arm runs it at 8 concurrent requests (every verify step within the TP4 kernel units' widths, up to 48 rows) and at 16 (across the boundary to SGLang's path and back).
    • The verdicts were fixed before any candidate was measured. Accuracy passes if the candidate scores at least the paired baseline minus 1.5 pp. Mean acceptance length passes if the candidate reaches at least 0.9 times the baseline.
    • It also checks engagement. The candidate's log must show NVIDIA megakernel: active with the TP4 kernel units, verify-step captures at 6 and 48 rows, and draft armed (TP4). The baseline's log must show no plugin line.
    • It refuses to start if SGLANG_SIMULATE_ACC_LEN, SGLANG_NVIDIA_MEGAKERNEL_SLOTS or SGLANG_NVIDIA_MEGAKERNEL_PARITY is set.
    • SGLANG_NVIDIA_MEGAKERNEL_E2E_URL scores a server that is already running instead.
  • test/e2e/test_glm5_3_switch.py checks stock parity. It runs with SGLANG_NVIDIA_MEGAKERNEL_SLOTS="", SGLANG_NVIDIA_MEGAKERNEL_PARITY=1 and eager verify steps. Batches of 1, 2, 4 and 8 requests cover 6 to 48 rows. Every parity target_verify line must show logits equal to SGLang's.
  • test/e2e/ci_models.yaml gets the entry glm5_3 (GB300, 4 GPUs, the two files).
  • docs/models/glm5_3.md: the Tests section names the new tests.

No package code changes.

About SGLANG_ENABLE_EMBED_REPLICATION:

How to run

On one host with 4 x GB300, with this package installed into the SGLang environment (pip install --no-deps -e .):

python3 -m pytest -v -rfE test/e2e/test_glm5_3_server.py test/e2e/test_glm5_3_switch.py

Set SGLANG_NVIDIA_MEGAKERNEL_E2E_MODEL_PATH to use a local copy of the checkpoint. In CI, use the run-ci-sglang:glm5_3 label.

Accuracy Tests

These ran on one GB300 tray (4 x GB300, TP4) with the 2026-11-21 SGLang nightly image (SGLang a8ac8659) and Mega d3e545f (this branch on main 4e897b8, which includes #75). The model was nvidia/GLM-5.2-NVFP4. Both files ran exactly as pr-test-megakernel.yml runs them: pip install --no-deps -e, then python3 -m pytest -v -rfE. test_glm5_3_server.py: 4 passed, 1 skipped (the SGLANG_NVIDIA_MEGAKERNEL_E2E_URL case); test_glm5_3_switch.py: 1 passed.

Model / hardware / configuration Test Native SGLang baseline Mega candidate Difference / variation Verdict and evidence
GLM-5.2-NVFP4 / 4 x GB300 / TP4, MTP 5/1/6, 8 concurrent GSM8K-1319, 5-shot, greedy 0.9484 0.9469 -0.15 pp (paired sd 0.54 pp; 26 lost, 24 gained) PASS (rule: >= baseline - 1.5 pp)
Same, 16 concurrent GSM8K-1319, 5-shot, greedy 0.9393 0.9492 +0.99 pp (paired sd 0.50 pp; 15 lost, 28 gained) PASS
Same, 8 / 16 concurrent Mean acceptance length 4.042 / 4.037 4.042 / 4.028 +0.01 % / -0.23 % PASS (rule: >= 0.9 x baseline)
Same Engagement no plugin line active with ll.attention, ll.hops, ll.moe.nvfp4, ll.sparse_mla_fd and the NextN draft on TP0-3; captures at 6 and 48 rows; draft armed (TP4) - PASS
Same, slots off + parity switch, eager Stock parity, 6-48 rows SGLang's forward stock step 272 parity lines, all logits_max_abs=0 PASS

No tracebacks in any server log. The first run of these tests, on main before #75 (76ab864), gave the same verdicts (8 concurrent: 0.9500 vs 0.9484; 16 concurrent: 0.9462 vs 0.9409).

Wall time (model read from a network filesystem; most of the time is server startup):

File Wall Of which
test_glm5_3_server.py 1401 s (23.4 min) two launches and four GSM8K-1319 passes of about 2.5 min each
test_glm5_3_switch.py 1051 s (17.5 min), cold caches one launch (1001 s), about 30 s of requests

Together that is about 41 min here. That fits in the 180-min test step of pr-test-megakernel.yml, alongside deepseek_v41 (about 35 min) when run-ci-sglang runs every model.

Speed Tests and Profiling

Not included. Neither DeepSeek-V4.1-Flash nor Qwen3.5 has a performance-comparison E2E test to follow yet. A matched throughput / TPOT comparison with repeated runs is a follow-up.

SGLang version note

run-ci-sglang installs SGLang main. SGLang main, and the SGLang nightly images from 2026-11-22 on, require megakernel plugin API version 3. This repository's main still declares version 2 (#85 moves it). Until that lands, every run-ci-sglang model stops at startup on the API version, including glm5_3. These tests were therefore validated on the 2026-11-21 SGLang nightly image, the latest that accepts version 2.

Checklist

  • pre-commit run --all-files passes.
  • Tests under test/ cover the change (the new E2E tests; collection checked in the image).
  • Required SGLang bindings passed normal SGLang CI and are merged, or no binding change is needed.
  • The tested SGLang and Mega SHAs are named above (run by hand; no integration run link yet).
  • Accuracy E2E results against the matched baseline are attached for the affected supported configuration (GLM-5.2-NVFP4, 4 x GB300, TP4); no performance test.
  • Required E2E cases ran on the appropriate hardware; missing coverage: TP8 and TP16 have no E2E test (no runner); no performance test.
  • A new model adds one line to .github/CODEOWNERS that names its owner (already present for glm5_3).

Review and Merge Process

  1. The lint and Check PR title checks must pass.
  2. Ask a code owner from .github/CODEOWNERS to review.
  3. Merge with "Squash and merge": the PR title becomes the commit title on main.

🤖 Generated with Claude Code

@YAMY1234 YAMY1234 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The run-ci-sglang:glm5_3 label only exists after this merges, so the first CI run needs the all-models run-ci-sglang label; please link that run (SGLang main needs API v3, which #81 brought in).

Comment thread test/e2e/glm5_3_server.py
# set the variable (the spec checks its environment per TP size, outside
# Requirements.env, so SGLang's FLAG_SETS_ENV skips it). The baseline gets it too, so
# the arms differ only in the flag; SGLang's defaults give the rest of spec.ENV.
ENV = {"SGLANG_ENABLE_EMBED_REPLICATION": "1"}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep this after #95 lands: the baseline arm never gets the flag's automatic setting, so the helper is what keeps the two arms identical. The comment could say so instead of describing the flag as not setting it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, the helper stays: the baseline runs without the flag, so #95's automatic setting never reaches it. The comment now says that (same embedding layout in both arms, so they differ only in the flag) instead of saying the flag doesn't set the variable. Changed in d7d5bd2.

The branch is now rebased onto main 5b85682 (megakernel API 3; ci_models.yaml conflict with minimax_m31 resolved, both entries kept).

Unit CI is red on these heads with the same 28 failures as main's own 5b85682 run (pre-existing minimax_m31 / qwen3_5 contract drift against SGLang main, not from this PR): https://github.com/sgl-project/sgl-nvidia-mega/actions/runs/45954794966

Comment thread test/e2e/test_glm5_3_server.py Outdated
# the candidate's log: the TP4 kernel units serve (the active line names them), the
# verify widths they capture, and the NextN draft composed from its units
ACTIVE = re.compile(
r"NVIDIA megakernel: active \(GLM-5\.3 / GLM-5\.2: TP4 kernel units \['ll\."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: matching TP4 kernel units \['ll\. depends on the unit order in the log; TP4 kernel units \[ would be enough.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in d7d5bd2: the check now matches TP4 kernel units \[. It still rejects the none (stock) form, so it keeps requiring that units run.

mattteochen and others added 3 commits November 27, 2026 11:21
Adds GLM-5.3 / GLM-5.2 (NVFP4) end-to-end tests for the four-GPU GB300 runner,
following the DeepSeek-V4.1-Flash layout:

- test/e2e/glm5_3_server.py: the model path, the TP4 MTP launch the spec
  admits (EAGLE 5 steps / topk 1 / 6 draft tokens, DSA + TRT-LLM decode,
  fp8_e4m3 KV at page 64, flashinfer_trtllm MoE, shared-experts fusion off).
- test/e2e/test_glm5_3_server.py: baseline (flag off) then candidate (flag
  on) on GSM8K-1319, 5 shots, greedy, real acceptance, at 8 and 16 concurrent
  requests; per-question paired verdicts (candidate >= baseline - 1.5 pp) and
  an acceptance-length verdict (>= 0.9x baseline); engagement checked in both
  logs. SGLANG_NVIDIA_MEGAKERNEL_E2E_URL scores a running server instead.
- test/e2e/test_glm5_3_switch.py: every slot off plus the parity switch; each
  eager verify step of 6 to 48 rows must match SGLang's logits bit for bit.
- ci_models.yaml entry glm5_3 and the model page's Tests section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ronment

Since sgl-project#19 the GLM-5.3 spec checks its environment per TP size instead of in
Requirements.env, so SGLang's FLAG_SETS_ENV no longer sets
SGLANG_ENABLE_EMBED_REPLICATION for --enable-nvidia-megakernel, and the
candidate arm stopped at startup ("SGLANG_ENABLE_EMBED_REPLICATION False is
not True"). The helper now launches both arms with it, as the model page
launches the megakernel, so the arms still differ only in the flag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… match the active line by prefix

The baseline arm runs without the flag, so the flag's own setting of the
variable never reaches it: the helper keeps the two arms' embedding layout
the same, also once the flag sets the variable for the candidate. The
active-line check now matches the start of the unit list instead of its
first entry, which depends on the unit names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mattteochen

Copy link
Copy Markdown
Contributor Author

Rebased onto main 5b85682 (API 3, ci_models.yaml conflict resolved). Since run-ci-sglang:glm5_3 only exists after merge, could a maintainer add run-ci-sglang for the first E2E run? I'll link the run and both SHAs here.

@mattteochen
mattteochen requested a review from YAMY1234 November 27, 2026 11:22
@YAMY1234 YAMY1234 added the run-ci-sglang:glm5_3 Run the glm5_3 e2e tests on SGLang CI label Nov 29, 2026

@YAMY1234 YAMY1234 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GLM-5.3 E2E passed on SGLang CI (run 46314164531, 4x GB300): 5 passed, 1 skipped (the running-server GSM8K case).

@YAMY1234
YAMY1234 merged commit 0f6dd47 into sgl-project:main Nov 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci-sglang:glm5_3 Run the glm5_3 e2e tests on SGLang CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants