Repository navigation
[Test] [GB300] glm5_3: Add GLM-5.3 E2E tests and a ci_models.yaml entry for the GB300 runner - #92
Conversation
e025c35 to
d3e545f
Compare
| # 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"} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
| # 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\." |
There was a problem hiding this comment.
Nit: matching TP4 kernel units \['ll\. depends on the unit order in the log; TP4 kernel units \[ would be enough.
There was a problem hiding this comment.
Done in d7d5bd2: the check now matches TP4 kernel units \[. It still rejects the none (stock) form, so it keeps requiring that units run.
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]>
d3e545f to
d7d5bd2
Compare
|
Rebased onto main 5b85682 (API 3, ci_models.yaml conflict resolved). Since |
YAMY1234
left a comment
There was a problem hiding this comment.
GLM-5.3 E2E passed on SGLang CI (run 46314164531, 4x GB300): 5 passed, 1 skipped (the running-server GSM8K case).
Motivation
GLM-5.3 / GLM-5.2 has no end-to-end tests and no
test/e2e/ci_models.yamlentry, sorun-ci-sglangcannot 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 inAGENTS.md: accuracy against native SGLang with the megakernel off, and stock parity with every slot off.Once the
glm5_3entry is onmain,sync-ci-labels.ymlcreates therun-ci-sglang:glm5_3label. That label can then run on #75 and on later GLM-5.3 PRs.Modifications
test/e2e/glm5_3_server.pyholds the model and the TP4 launch the spec admits, asdocs/models/glm5_3.mdlaunches it.nvidia/GLM-5.2-NVFP4by default;SGLANG_NVIDIA_MEGAKERNEL_E2E_MODEL_PATHoverrides it.--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.SGLANG_ENABLE_EMBED_REPLICATION=1.--enable-nvidia-megakerneldiffers.test/e2e/test_glm5_3_server.pycompares accuracy against the baseline:NVIDIA megakernel: activewith the TP4 kernel units, verify-step captures at 6 and 48 rows, anddraft armed (TP4). The baseline's log must show no plugin line.SGLANG_SIMULATE_ACC_LEN,SGLANG_NVIDIA_MEGAKERNEL_SLOTSorSGLANG_NVIDIA_MEGAKERNEL_PARITYis set.SGLANG_NVIDIA_MEGAKERNEL_E2E_URLscores a server that is already running instead.test/e2e/test_glm5_3_switch.pychecks stock parity. It runs withSGLANG_NVIDIA_MEGAKERNEL_SLOTS="",SGLANG_NVIDIA_MEGAKERNEL_PARITY=1and eager verify steps. Batches of 1, 2, 4 and 8 requests cover 6 to 48 rows. Everyparity target_verifyline must show logits equal to SGLang's.test/e2e/ci_models.yamlgets the entryglm5_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:Requirements.env. SGLang'sFLAG_SETS_ENVtherefore no longer sets the variable, and--enable-nvidia-megakernelalone stops at startup withSGLANG_ENABLE_EMBED_REPLICATION False is not True. The first GPU run of these tests hit exactly that.How to run
On one host with 4 x GB300, with this package installed into the SGLang environment (
pip install --no-deps -e .):Set
SGLANG_NVIDIA_MEGAKERNEL_E2E_MODEL_PATHto use a local copy of the checkpoint. In CI, use therun-ci-sglang:glm5_3label.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
main4e897b8, which includes #75). The model wasnvidia/GLM-5.2-NVFP4. Both files ran exactly aspr-test-megakernel.ymlruns them:pip install --no-deps -e, thenpython3 -m pytest -v -rfE.test_glm5_3_server.py: 4 passed, 1 skipped (theSGLANG_NVIDIA_MEGAKERNEL_E2E_URLcase);test_glm5_3_switch.py: 1 passed.activewithll.attention,ll.hops,ll.moe.nvfp4,ll.sparse_mla_fdand the NextN draft on TP0-3; captures at 6 and 48 rows;draft armed (TP4)logits_max_abs=0No tracebacks in any server log. The first run of these tests, on
mainbefore #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):
test_glm5_3_server.pytest_glm5_3_switch.pyTogether that is about 41 min here. That fits in the 180-min test step of
pr-test-megakernel.yml, alongsidedeepseek_v41(about 35 min) whenrun-ci-sglangruns 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-sglanginstalls SGLangmain. SGLangmain, and the SGLang nightly images from 2026-11-22 on, require megakernel plugin API version 3. This repository'smainstill declares version 2 (#85 moves it). Until that lands, everyrun-ci-sglangmodel stops at startup on the API version, includingglm5_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-filespasses.test/cover the change (the new E2E tests; collection checked in the image)..github/CODEOWNERSthat names its owner (already present forglm5_3).Review and Merge Process
lintandCheck PR titlechecks must pass..github/CODEOWNERSto review.main.🤖 Generated with Claude Code