Repository navigation
GLM-5.3 Flash: W4AFP8 + HiCache long-context file for gpu02 (both replicas = campaign-2 L2) - #294
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Sep 23, 2026
GLM-5.3 Flash: W4AFP8 base-tier file for gpu03, gpu04 and gpu23 (both replicas = campaign-2 B5)
#295
Merged
PierreLeGuen
force-pushed
the
feat/glm53-w4afp8-long-context
branch
from
September 23, 2026 19:39
80884e1 to
3433b87
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 80884e1f82
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Generate prod/GLM-5.3-Flash-SGL-TP4-W4AFP8-LongContext.yaml from the long-context file with scripts/prepare_glm53_w4afp8_long_context.py. Both replicas run the gpu31 campaign-2 arm L2: graphistry/GLM-5.3-Flash-W4AFP8@99f1fa7 on the signed hicache-w4afp8 image fde25985, 8192-token chunks with --max-prefill-tokens 32768, HiCache with CUDA-owned host memory at a 40% startup budget per replica, no admission reserve, and distinct --dist-init-addr ports. The long-domain routing contract stays byte-identical to the source; telemetry reports the W4AFP8 precision, config variant and engine image. Pin the contract in validate_glm53_prod_config.rb (exact L2 argv, image, environment, per-replica telemetry, equality with the long-context file outside the engines) and in the DCGM validator, cover it with generator and mutation tests wired into CI, and add the gpu02 rollout runbook and a README row.
A percentage budget resolves against MemAvailable when each engine starts, so with two HiCache replicas on one CVM the replica started second got less (about 489 vs 293 GiB on gpu02 at 40%), and every restart moved it again. Default each replica to the qualified L2 value, 406 GiB, which is independent of start order and fails at startup when it does not fit. GLM53_HICACHE_RAM_BUDGET keeps its name and still overrides both replicas.
State the 406 GiB budget check (rank_budget_bytes=108984795136 on both replicas, 2 x 406 GiB within available RAM minus the reserve), and add explicit start, run and cleanup steps for glm53-soak-relay and glm53-perception-check from this file, since a relay left over from the canary still routes :8009 to the removed FP8 r2.
PierreLeGuen
changed the base branch from
feat/glm53-w4afp8-prestage
to
main
September 23, 2026 19:50
PierreLeGuen
force-pushed
the
feat/glm53-w4afp8-long-context
branch
from
September 23, 2026 19:50
f7a0061 to
ce9abda
Compare
PierreLeGuen
added a commit
that referenced
this pull request
Sep 23, 2026
Add explicit start, run and cleanup steps for glm53-soak-relay and glm53-perception-check, which sit behind the verification profile and only start when named. Point the gpu02 soak gate at #294, whose runbook lands with that PR.
lloydmak99
approved these changes
Sep 23, 2026
This was referenced Sep 24, 2026
pranavraja99
added a commit
that referenced
this pull request
Sep 24, 2026
GLM-5.3 Flash's DSA indexer is ReplicatedLinear, so every attention-TP rank computes fp8_mqa_logits and the K-pool top-k for all prefill query rows; at long context that is the only prefill cost that grows with context. With SGLANG_DSA_INDEXER_QSPLIT=1 each rank scores a quarter of the rows against the same gathered keys and the int32 top-k rows are all-gathered. It also shrinks the per-rank logits scratch, which is what lets 16384-token chunks fit on the long tier. Inert unless enabled. Evidence (gpu31/gpu32, 2026-09-24, every A/B in both island orders): stored long-tier traffic paired TTFT 0.81-0.85x with 100% completion; the chunk-16384 burst keeps 9.5 GB free vs 0.65 GB without; GSM8K, passkey retrieval and teacher-forced agreement are at the noise floor. The image built from this recipe passes test-cpu.sh (new step 4) and reproduces the cold-prefill speedup on GPU (+16.4% at 512K, chunk 16384). The publish workflow pins move to the new recipe hashes and the default tag to glm53-hicache-w4afp8-v2, so the v1 image #294 pins is untouched. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
pranavraja99
added a commit
that referenced
this pull request
Sep 24, 2026
r1 stays the #294 control at pdi 1; r2 runs pdi 2, and the replicas' config_variant differs only in pdi1/pdi2 so prod dashboards compare them directly. On stored long-tier traffic (gpu31, 2026-09-24, both island orders) pdi 2 cut TPOT p50 to 0.53-0.72x of pdi 1 at a paired TTFT cost of at most 2%, with 100% completion. The generator sets the interval per replica, the validator pins each replica's argv and variant (and rejects either taking the other's value), and the rollout doc gains an r2-only canary procedure and readout. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
pranavraja99
added a commit
that referenced
this pull request
Sep 25, 2026
…302) * Canary the DSA indexer split and chunk 16384 on the long-context r2 Pins r2 to the v2 engine image published from #300 (8ff1a487b98a), sets SGLANG_DSA_INDEXER_QSPLIT=1 and raises its prefill chunk to 16384. r1 is left completely untouched -- same #294 image, chunk 8192, pdi 1, split unset -- so it stays a live control and a targeted `compose up` recreates r2 alone. Structurally r2 now needs its own image AND environment: a YAML merge key replaces a list rather than extending it, so r2 cannot inherit the anchor's environment and add one variable. The generator derives r2's block from the anchor at generation time rather than duplicating it as a literal, so the two cannot drift. The chunk and the split are one change. At 16384 without the split a concurrent long burst left 0.04-0.65 GB free per GPU, the condition that preceded the gpu02 crash; with it, 9.3-9.5 GB. The validator now rejects --chunked-prefill-size 16384 on any replica that does not also set SGLANG_DSA_INDEXER_QSPLIT=1, and rejects the variable on any image that does not carry the patch. Both gates were verified by mutation, including the case where the expected spec itself is edited -- the first placement of the chunk gate sat in validate_w4afp8_base, where it could never fire. Lab evidence (gpu31, candidate vs #294): TTFT 0.61-0.78x, TPOT 0.53-0.85x, minimum free device memory 3.7 -> 9.3 GB, quality at the noise floor. The all-gather's cost under CC/PPCIe inside a CVM is still unmeasured; gpu31 is bare metal with CC off, so this canary is the first measurement of it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Make the generated header describe the canary, and enforce marker counts Review found the header still claimed "8192-token prefill chunks", "Both pin fde25985...", "flags differ only in --dist-init-addr and r2's canary pdi 2" and "(16384 fell to 0.04 GiB and is rejected)" -- all false once r2 moved to the v2 image at chunk 16384. That header is the rollback and incident reference for a file operators are told not to hand-edit, so a stale one is worse than none: it would have pointed an on-call at the wrong image during a rollback. It now states plainly that the replicas are not identical and lists each one's image, chunk, interval and provenance, plus why the chunk and the split are one change. Also enforce the occurrence count in resolve_engine_image_labels instead of unpacking it and ignoring it. find() silently takes the first hit, so if an "instance:N" marker ever stopped being replica-unique the nearest-placeholder binding could attach the wrong replica's image label. It now fails loudly, matching the exact-count discipline replace_exact uses elsewhere in the script. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This adds a new generated file,
prod/GLM-5.3-Flash-SGL-TP4-W4AFP8-LongContext.yaml, for the dedicated long-context tier (gpu02). Both replicas run the gpu31 campaign-2 arm L2: the W4AFP8 checkpoint with HiCache, 8192-token chunks, a fixed 406 GiB host budget per replica, and no admission reserve.Only the two engines and their telemetry differ from
prod/GLM-5.3-Flash-SGL-TP4-LongContext.yaml; the long-domain routing contract is untouched. gpu13 stays on #290's configuration.Based on
main, which now includes #293 (merged as86d41e5): the W4AFP8 snapshot is pre-staged in themodel-downloaderof every dedicated GLM-5.3 Flash TP4 file (notprod/small-models.yaml).It is independent of the base-host PR (#295). A local test merge showed the two merge cleanly in either order, and the full validator suite passes on the merged tree.
Engines
Both replicas are identical except for
--dist-init-addr(127.0.0.1:29510for r1,:29511for r2).Image
docker.io/nearaidev/sglang@sha256:fde25985aea3ebabf1eb581ae21d53be8540e32933eef942ee8b962a1bfbea20(docker/sglang-glm53-hicache-w4afp8), published by workflow run 35903077821 from #291's merge commitf8106f0(digest comment). I re-verified it before pinning:success;glm53-hicache-w4afp8-v1resolves to this digest;nearai.sglang.*labels are present, among themhicache_fix_revision=230102db…,hcc_host_memory=v4-cuda-hostalloc-opt-in,pooled_transfers=v1-opt-in,admission_reserve=v10,chunked_prefill_pool_clamp=v1,w4afp8_loader_patch=modules-to-not-convert-v1andsource_revision=fc91d24…;org.opencontainers.image.base.digestis3eccc307…and the revision isf8106f09…;cosign verify(v3.0.6) against thepublish-glm53-admission-reserve.yaml@refs/heads/mainidentity passes;Argv
The distinct
--dist-init-addrports are harmless on the bridge network, where each container has its own loopback, and they guard against host networking.Environment
The long-context control environment, plus:
SGLANG_HICACHE_RAM_BUDGET=${GLM53_HICACHE_RAM_BUDGET:-406GiB}: a fixed per-replica budget, the qualified L2 value. A percentage resolves againstMemAvailablewhen each engine starts, so the replica started second would get less.SGLANG_HICACHE_CUDA_HOST_MEMORY=${GLM53_HICACHE_CUDA_HOST_MEMORY:-1}SGLANG_HICACHE_POOLED_TRANSFERS=1SGLANG_HICACHE_STAGING_PAGES=64No admission reserve.
Telemetry
int4-weights-fp8-activations-bf16-kv;config_variantfc91d24-long-context-w4afp8-c8192-hicache-cuda-host-pooled-v1-admission-reserve-disabled-pool-clamp-pdi1-h200-tp4-ep4-eagle-adaptive-5-1-6-strict-budget8192;engine_imagefde25985aea3;model_pathgraphistry/GLM-5.3-Flash-W4AFP8on the engines and DCGM.Unchanged (validator-enforced)
:8001discovery stub;LONG_TIER_ONLY(defaulttrue) and the registrar;model-downloader.No OpenRouter gateway or cloud-api change: the host, ports (
:8000probe,:8444TLS), domains and model-proxy handle all stay the same.Argv parity with campaign-2 arm L2
Compared against
gpu31:/data/inference-optimizer-20260913/results/hicache-w4afp8-real-20260923/campaign2/setup/pm-c2-l2.sh. The argv was rendered withdocker compose configand compared flag by flag: 74 tokens and 40 flags on each side, 35 of them identical.--model-path/root/.cache/huggingface/hub/models--graphistry--GLM-5.3-Flash-W4AFP8/snapshots/99f1fa70…/models/hub/models--graphistry--GLM-5.3-Flash-W4AFP8/snapshots/99f1fa70…--chat-template/root/.cache/huggingface/hub/models--zai-org--GLM-5.3-Flash/snapshots/3f1971b7…/chat_template.jinja/configs/chat_template.jinja--host0.0.0.0127.0.0.1--port800030001--dist-init-addr127.0.0.1:29510(r1) /127.0.0.1:29511(r2)127.0.0.1:29611SGLANG_*environment: identical to L2, the406GiBhost budget included. The only delta isSGLANG_ENABLE_HEALTH_ENDPOINT_GENERATION=0, which is production-only, affects only the health endpoint, and is the same in every GLM-5.3 production file.L2 ran the local
:prbuild of the same recipe: same base3eccc307…, and the patched-file after-hashes pinned insource-manifest.json. This file pins that recipe's published digest.Evidence (gpu31, 2026-09-23, CC off)
reports/glm53-hicache-w4afp8-gpu31-2026-09-23/campaign2/in the lab evidence tree.Changes
prod/GLM-5.3-Flash-SGL-TP4-W4AFP8-LongContext.yaml, generated by the newscripts/prepare_glm53_w4afp8_long_context.py. The generator uses exact-count replacements and fails on source drift.--checkdetects a stale file.scripts/validate_glm53_prod_config.rb: the new file's contract.--dist-init-addr, and the proxy pooling both replicas.model_path.scripts/validate_glm53_dcgm_metrics.rb: covers the new file.scripts/test_glm53_w4afp8_long_context.pyplus a CI step: 10 tests.--dist-init-addr, HiCache IO backend, a re-added--revision, queue size;LONG_TIER_ONLY, the synthetic discovery id, soak-relay routing, proxy pooling;config_variantlabel and log tag,engine_imagelabel and scrape label, precision, DCGMmodel_path;docs/glm53-w4afp8-long-context-rollout.md, which references the existing gpu02 runbook, and a README row.Rollout summary (details in the runbook)
force_recreate: false; never an empty service list;dry_runbefore everyup.GLM53_HICACHE_RAM_BUDGETnow sets both replicas, and defaults to a fixed406GiB. Before step 1, read gpu02's env map and confirm it is unset or406GiB.rank_budget_bytes=108984795136.up --remove-orphans, which removes orphans with a ~10 s stop. Each engine being replaced is stopped first with a scopedcompose/downof the file that defines it (5 m grace), then the new file is broughtup, scoped./backends/liston both model-proxy peers, and the telemetry labels.Validation
A local run of every step in
validate-compose.yaml, with the CI images, passes:nginx -ton this file), public metrics (32 TLS listeners), DS4F, registrar auth, GPU preflight, GLM-5.3 DCGM;--checkand tests, and this PR's generator--checkand tests;docker compose configon every file, the embedded OTel configs, andgit diff --check.Risks (accepted) and decisions
cudaMallocHostpath has never run in a CVM (gpu31 reports CC off). gpu02 is the first soak and a hard gate.--mem-fraction-static 0.78is an untested fallback.GLM53_HICACHE_RAM_BUDGETkeeps its single name, the same contract as gpu13 (Make gpu13 GLM-5.3 Flash a HiCache long-context replica #290), but sets both replicas. Its default is now a fixed406GiBrather than40%, because a percentage resolves againstMemAvailableat each start: at 40%, the replica started second would get about 293 GiB against the first one's 489 GiB. The runbook guards against a leftover override:406GiB);rank_budget_bytes=108984795136.