Skip to content

refactor(gemma4): the serving contracts speak from one place - #1018

Merged
FeathBow merged 2 commits into
pegainfer-project:mainfrom
FeathBow:refactor/gemma4-serving-contracts
Aug 31, 2026
Merged

refactor(gemma4): the serving contracts speak from one place#1018
FeathBow merged 2 commits into
pegainfer-project:mainfrom
FeathBow:refactor/gemma4-serving-contracts

Conversation

@FeathBow

Copy link
Copy Markdown
Collaborator

Description

Closes #1017

The newcomer admission existed in three copies (the plain path, the lane path and the mixed gather) and the decode emit contract in two (the staged deliver and the sampled rows). prepare_newcomer now owns validation, prefix-cache resolution, reservation and the Scheduled handshake behind a NewcomerOptions row per caller; deliver_decode_row owns the stop/token/length emit ladder; and the split-KV state builds, uploads and lends its launch views from its own impl. One deliberate alignment: the gather path's whole-account door moves from a hand-written availability check onto the same eviction-aware reservation the plain path uses (with eviction off, as the gather always behaved), so the door answers identically everywhere. Behavior is preserved — every option row reproduces its caller's path.

Test Env

Single GPU (sm_89, 48 GiB, x86_64)

Verification

  • cargo fmt --all -- --check and git diff --check pass; the Gemma 4 release server builds; all-target Gemma Clippy passes with -D warnings; release lib tests pass (52).
  • The admission-family gates pass through the maintainer runner at the exact head: mixed-step-against-serial, the gathered walk against the serial path, the gathered lifecycle, the coalesce-door burst gate, the full-roster pipeline-under-queue gate, the idle-refill fingerprint gate, and the fp8 mixed structural walk — the last driving the refactored gather through mixed_prefill_decode_step on the e4m3 pool, so the reservation alignment is exercised on both storage families.
  • The 26B checkpoint answers four greedy public /v1/completions requests (31-, 35-, 33- and 1421-token prompts, 64 forced tokens) with bytes identical to main's binary, md5 219de1e3c09c.

Signed-off-by: Feathbow <feathbow@gmail.com>
…note moves home

Signed-off-by: Feathbow <feathbow@gmail.com>
@FeathBow
FeathBow merged commit d1c0f77 into pegainfer-project:main Aug 31, 2026
17 checks passed
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.

gemma4: the first token contract and the admission path exist in three copies

1 participant