Skip to content

feat(glm): coalesce GB10 continuation prefill with retained checkpoints - #12

Draft
FujitsuPolycom wants to merge 8 commits into
base/upstream-jovian-judgement-2a979314from
feat/gb10-continuation-prefill
Draft

FujitsuPolycom wants to merge 8 commits into
base/upstream-jovian-judgement-2a979314from
feat/gb10-continuation-prefill

Conversation

@FujitsuPolycom

@FujitsuPolycom FujitsuPolycom commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Purpose

Extend the maintained single-checkpoint GLM/B12X path to up to four retained
KDA destinations on the tested DCP4/MTP3 layout, including aligned continuation
chunks.
The scheduler binds an exact query span and checkpoint positions; allocation
preserves physical state ownership; V2/GLM metadata carries the plan in packed
request order; recurrent and convolution exports use the planned destinations.
For an 8K prompt on the physical/lookup-512, scheduler-2048 grid, retained states
are at 4096, 6144, 7168, and 7680 tokens. B12X exports these states within one
bounded prefill invocation, avoiding extra full-model passes for their retention.

The implementation builds on the internal-checkpoint mechanism already present
in the review base: upstream PR #52789
added Kimi-K3/FlashKDA prefix/checkpoint/suffix execution inside one full-model
forward. The maintained GLM/B12X base already reserves and binds one internal
checkpoint. This extension supplies the four-destination B12X export contract and
GLM scheduler-to-allocator-to-metadata ownership needed by DCP4 retention and
MTP3 continuations. Related retention-aware scheduling PR #53479
is open but identifies its branch as a superseded draft; its chunk-stop and
speculative-backoff changes are separate from four-destination B12X export.

VLLM_B12X_KDA_PREFILL_COALESCING defaults off. The opt-in is bounded to the
documented GLM/GB10 BF16 TP4/DCP4 configuration with aligned native prefix
caching and at most 8,192 scheduled tokens. Unsupported, mixed-service,
cache-hit, and preempted cases retain their ordinary fallback rules. The
implementation requires B12X four-checkpoint export, independently of mHC.

Fork review target: FujitsuPolycom/vllm, base
base/upstream-jovian-judgement-2a979314 at
2a979314dc97b03173a0a76fc15664ec924db32b. Standalone implementation:
1bf41ecb19ff82bd4bca1195cd1ab8f63e7e0717; B12X dependency:
70fe41974ef4b18f61caaa2579c81cdc05d1265f. The CP branch contains no mHC feature.

Test Plan

Exercise scheduler/allocator ownership, full-prompt admission, retained prefix
boundaries, V2 packed metadata, GLM overrides, B12X binding, and one-slot
compatibility when the feature is disabled. Check actual model-derived cache
geometry through platform alignment, grouping, and KVCacheManager before GPU
state/history checks and serving measurements.

.venv/bin/python -m pytest \
  tests/v1/core/test_recurrent_prefill_checkpoint.py \
  tests/v1/attention/test_gdn_metadata_builder.py \
  tests/v1/worker/test_kda_prefill_checkpoint_binding.py -q
.venv/bin/python -m pytest tests/kernels/mamba/test_causal_conv1d.py \
  -k test_kda_checkpoint_history_excludes_speculative_cells -q

Test Result

66 tests passed on the isolated CP branch. The combined CPU suite passed
115 tests. Six selected convolution-history GPU tests passed, together with
12 B12X four-checkpoint GPU tests. The model-derived CPU layout check reproduces
the generic 2,560-token block expansion and the native 512-token split layout;
the latter produces one 8K scheduler span with four retained checkpoint targets.

The serving comparison uses four 48-SM NVIDIA GB10 GPUs (compute capability
12.1), GLM-5.3-Flash-NVFP4-Spark weights, BF16 activations, FP8 KV cache,
TP4/DCP4/PP1, MTP3, and an 8,192-token batch ceiling. Native prefix caching and
the fused SparkRing transport configuration are held constant across arms;
the mHC collectives use the existing TP PyNccl communicator. There is no
SparkCache KV connector in this comparison.

Feature-arm values for VLLM_B12X_KDA_PREFILL_COALESCING and
VLLM_GLM53_MHC_PREFILL_SHARD, respectively, are: neither 0/0, coalescing-only
1/0, mHC-only 0/1, and both 1/1.

All arms use these native layout settings:

export VLLM_GLM53_SPLIT_TARGET_BLOCK_SIZE=512
export VLLM_GLM53_SPLIT_MAMBA_BLOCK_SIZE=512

Together with aligned Mamba caching and retention interval zero, they establish
the tested physical/lookup/scheduler grid (512, 512, 2048). CLI block sizes
alone do not preserve that grid: generic hybrid page alignment can raise both
physical block sizes to 2,560, preventing the intended 8K execution path.

The measured image is
sha256:52b207e716a285c16e5e1b14ec2a41f6208b9450c617e7d1cde5a507ea879d7f,
containing vLLM abb715f132bdccb592a34b2596a3d3a8d757ffbc and B12X
70fe41974ef4b18f61caaa2579c81cdc05d1265f. The isolated vLLM PRs compose to this
runtime source; their documentation/evidence commits are not the image revision.
The toolchain includes Python 3.12.3, PyTorch 2.13.0+cu130, Triton 3.7.1,
CUTLASS DSL 4.6.2, and FlashInfer 0.6.17.

Three shape warmups and five exact-answer/cache checks precede the measured
requests. Each prompt size has three unique cold samples with explicit zero
cached tokens. Rates below are prompt tokens divided by median API TTFT, using
the client's QueryPerformanceCounter clock; they include API/network overhead.
The five correctness probes cover cold 8K/16K/32K prompts and repeated/extended
8K prompts with positive cache reuse. All completed arms passed those probes.

VLLM_GLM53_MHC_PREFILL_DIAGNOSTICS=1 is common to all arms. Activation is checked
before timing and again after completion: checkpoint-enabled arms show capacity
four, the required grid, and an 8,192-token dispatch with four checkpoint targets.
The combined and mHC-only arms have all-rank request-time mHC enqueue records
with actual 2,048-row repeated mHC outputs and 90 reduce-scatters/90 gathers per
eligible base forward.
Completed requests corroborate asynchronous completion; logs alone do not prove
GPU state equivalence.

Observed prefill tokens/s:

Prompt tokens Neither Coalescing only mHC only Both
8,192 1,949.6 2,947.3 1,958.5 3,063.5
16,384 2,358.9 2,928.3 2,390.8 3,060.8
32,768 2,614.5 2,923.5 2,681.8 3,049.6

Coalescing-only rates are 51.18%, 24.14%, and 11.82% higher than neither at
8K, 16K, and 32K, respectively (100 * (coalescing_only / neither - 1)). The combined
row includes the separate mHC transformation and must not be attributed solely
to coalescing.

Observed aggregate decode tokens/s:

Decode cell Neither Coalescing only mHC only Both
C1 / 8K 49.17 47.37 48.46 46.29
C1 / 32K 46.18 45.92 47.31 47.11
C4 / 8K 122.19 120.18 121.17 119.37
C4 / 32K 123.44 125.20 123.90 124.25

Observed MTP-normalized decode steps/s (mean acceptance length in parentheses):

Decode cell Neither Coalescing only mHC only Both
C1 / 8K 17.86 (2.75) 17.91 (2.65) 17.86 (2.71) 17.89 (2.59)
C1 / 32K 17.82 (2.59) 17.73 (2.59) 17.62 (2.68) 17.57 (2.68)
C4 / 8K 43.70 (2.80) 44.54 (2.70) 44.99 (2.69) 42.99 (2.78)
C4 / 32K 44.34 (2.78) 45.64 (2.74) 45.84 (2.70) 45.00 (2.76)

These prefill features do not select their optimized paths during captured decode. Normalized measurements show no consistent decode speedup across cells; the short sequential runs do not establish performance equivalence.

These are sequential arm runs, not interleaved A/B trials. Separate JIT
namespaces and memory-recovery interventions between runs remain recorded
conditions. Three TTFT samples do not establish a confidence interval. Decode
uses one 20-second window per C1/C4 by 8K/32K cell, a five-second warmup, and at
most 1,024 output tokens; acceptance length varies, so the raw bundle also
retains MTP-normalized steps/s. Those short windows do not establish a decode
speedup or absence of a regression.

Status: implemented; research-only serving qualification. All four prefill
arms passed activation and exact-answer/cache checks. All four decode arms
completed their four cells without reported request errors.
The completed 8K-32K smoke coverage does not establish full numerical/model-quality
equivalence, long-duration reliability, or 64K/128K behavior for this source
composition. GSM8K/MRCR evaluation remains unrun.

Evidence: method and conditions,
results report,
and raw samples and activation evidence.
AI assistance was used for implementation, review, and test preparation. Human
line-by-line review remains pending. This is a user-owned fork draft, with no
upstream submission or acceptance claim.

Reproduction

Model/tokenizer: local-inference-lab/GLM-5.3-Flash-NVFP4-Spark at df116c4fb16b1d37ae43d2cfd624de26ffbc832e. Reproduction instructions include the public source composition, exact decode-client reconstruction, serving settings and standalone prefill client. The prefill client preserves the measured prompt/timing/cache-check algorithm; runtime feature activation still requires separate request-associated worker logs. The original performance measurements are unchanged.

FujitsuPolycom and others added 8 commits September 7, 2026 00:43
Export required recurrent states inside aligned prefill chunks up to 8192
tokens. Preserve retained state and append-only worker block tables across
cold chunk continuations, including full-prompt admission accounting.

Carry scheduler checkpoint plans through model runner V2 and the GLM
metadata adapter. Bind B12X two-checkpoint metadata only for the opt-in,
and store causal convolution history independently of speculative capacity.

The feature defaults off, targets GB10 GLM TP4/DCP4, and retains ordinary
cache-hit, mixed-service, preemption and one-checkpoint B12X behavior.
Status: research-only; GPU and full-model evaluation are not executed.

Validation: 107 CPU tests pass; four GPU checkpoint-store tests collect.
Repository checks pass except a mypy error reproduced on the source base;
the Docker graph hook passes through Git Bash on Windows.

Co-authored-by: OpenAI Codex

Signed-off-by: FujitsuPolycom <87842395+FujitsuPolycom@users.noreply.github.com>
Reserve four checkpoint slots so 512-token prefix hits and 2048-token scheduler fallback states fit in one 8192-token forward. Preserve all retention destinations, default-off one-checkpoint bindings, and speculative slot ownership. Log configured grids and scheduled coalescing separately.

DCP4 scheduler, allocator, GDN metadata and warmup CPU contracts pass. Four-slot GPU and model qualification remain pending.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: FujitsuPolycom <87842395+FujitsuPolycom@users.noreply.github.com>
Document the maintained GLM split-page settings needed to preserve physical 512-token blocks, 512-token lookup alignment and 2048-token scheduler alignment. Hold this cache layout constant across benchmark arms and require scheduled-path evidence.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: FujitsuPolycom <87842395+FujitsuPolycom@users.noreply.github.com>
Signed-off-by: FujitsuPolycom <87842395+FujitsuPolycom@users.noreply.github.com>
Signed-off-by: FujitsuPolycom <87842395+FujitsuPolycom@users.noreply.github.com>
Signed-off-by: FujitsuPolycom <87842395+FujitsuPolycom@users.noreply.github.com>
Retain the default-off checkpoint path and its four-slot B12X dependency while accepting DCP1, DCP2 and DCP4. Derive scheduler grids from physical cache geometry and cover checkpoint ownership, failed admission, cache hits and preemption at each supported DCP size.

Validation: 62 CPU checkpoint and binding tests passed on this standalone branch. GPU measurements exist for combined source 8f8ea47; this ported head has not executed GPU or full-model validation.

Co-authored-by: Codex <noreply@openai.com>

Signed-off-by: FujitsuPolycom <87842395+FujitsuPolycom@users.noreply.github.com>
Record source-bound prefill and normalized decode observations, checkpoint and collective invariants, and standalone CPU test commands. Distinguish combined-runtime qualification from standalone GPU validation and retain the unresolved DCP2 cached-versus-cold numerical bound failure.

Validation: 62 checkpoint and binding CPU tests passed; documentation checks passed. Dockerfile graph check passed through Git Bash on Windows.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: FujitsuPolycom <87842395+FujitsuPolycom@users.noreply.github.com>
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.

1 participant