feat(yoco): YOCO × frozen-KV MTP interaction bench on E4B-it (PR-D) - #15
Draft
pyc96 wants to merge 1 commit into
Draft
feat(yoco): YOCO × frozen-KV MTP interaction bench on E4B-it (PR-D)#15pyc96 wants to merge 1 commit into
pyc96 wants to merge 1 commit into
Conversation
…PR-C)
Reviewer question: 'will YOCO be exportable to Gemma-4 MTP?'
Answer: yes for the target prefill (the same EXTEND path PR-C measured);
no-op for assistant seed / draft loop / target verify (those are decode-
shaped and the predicate already skips them). Live measurement on
google/gemma-4-E4B-it + google/gemma-4-E4B-it-assistant + NEXTN spec
3/4/1 on H100 TP=2 confirms:
Correctness:
- per-prompt parity (20 prompts, greedy, MTP enabled both sides):
20 / 20 byte-identical
- MMLU N=500 seed 0 temp 0:
MTP YOCO off: 0.588 (294/500)
MTP YOCO on : 0.590 (295/500) delta = +0.2 pp (within +/-1 pp)
- accept_length identical (2.10 summ, 2.20 chat) -- YOCO does not
change which tokens the verify loop accepts
Performance:
summ 8000/1000 n=80:
MTP off, YOCO off: 3469.6 tok/s
MTP off, YOCO on : 4078.5 tok/s (+17.6%, from PR-C)
MTP on , YOCO off: 1469.5 tok/s (MTP is a 2.4x loss on E4B)
MTP on , YOCO on : 1559.0 tok/s (+6.1%, with median TTFT -29.0%)
chat 1000/1000 n=80:
MTP on , YOCO off: 2932.1 tok/s
MTP on , YOCO on : 2887.9 tok/s (-1.5%, within noise; break-even
point where YOCO bookkeeping
~= saved compute on short
prefill)
Key observations:
1. YOCO median TTFT improvement is constant whether MTP is on or
off (~-28% on summ), because TTFT is purely target prefill.
2. Throughput delta shrinks under MTP because steady-state decode
becomes MTP-dominated, not prefill-dominated.
3. MTP itself is a large net loss on E4B at this concurrency due
to the pre-existing max_running_requests=48 auto-cap in
_handle_frozen_kv_mtp + disable_overlap_schedule penalty. That's
orthogonal to YOCO; it bit the 31B-it campaign too.
4. No worker-side or assistant-side code changes are needed for
YOCO to coexist with MTP -- the predicate routes correctly.
Adds one doc:
.humanize/yoco-gemma4/bench-results-e4b-mtp-h100.md (~170 lines)
with the full interaction matrix, per-phase YOCO-applicability table,
rollout recommendation, and reproducer commands. Raw bench JSONLs and
MMLU rows already saved at:
runs/20260524_gemma4_e4b_yoco_h100/benchmark/
runs/20260524_gemma4_e4b_yoco_h100/quality/results.jsonl
Stack base: pyc/yoco-fast-prefill-bench @ 5cb6309
Plan: .humanize/yoco-gemma4/refined-plan.md
Co-authored-by: Claude
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
Follow-up to PR-C #13. Answers the reviewer question "will YOCO be exportable to Gemma-4 MTP?" with a live measurement on
gemma-4-E4B-it + gemma-4-E4B-it-assistant + NEXTN(3/4/1)on H100 TP=2.TL;DR: yes for the target prefill; the assistant seed / draft loop / target verify are correctly skipped by the existing predicate; no worker-side changes needed.
Per-phase YOCO applicability
Correctness under MTP
Performance under MTP — summ 8000/1000 n=80
Performance under MTP — chat 1000/1000 n=80
When prefill is short (1 k tokens), the YOCO gather/scatter+metadata-rebuild overhead roughly matches the saved back-half compute. The summ scenario is unambiguous; chat is noise-floor neutral.
Comparison to PR-C (no-MTP) numbers
Two independent effects:
Rollout recommendation
What's in PR-D
One doc:
Raw bench JSONLs (4 files) and MMLU rows (4 rows) are saved at the artifact root `runs/20260524_gemma4_e4b_yoco_h100/` and cited in the doc.
Reproducer
```bash
YOCO-off + MTP (GPUs 0,1)
bash runs/20260524_gemma4_e4b_yoco_h100/benchmark/launch_sglang_e4b_mtp.sh \
sglang_e4b_mtp_yoco_off 0,1 30100 yoco_off
YOCO-on + MTP (GPUs 2,3)
bash runs/20260524_gemma4_e4b_yoco_h100/benchmark/launch_sglang_e4b_mtp.sh \
sglang_e4b_mtp_yoco_on 2,3 30101 yoco_on
Parity
python runs/20260524_gemma4_e4b_yoco_h100/quality/parity_check.py \
--url-off http://127.0.0.1:30100 --url-on http://127.0.0.1:30101 --num-prompts 20
Bench
bash runs/20260524_gemma4_e4b_yoco_h100/benchmark/run_benchmark.sh \
e4b_mtp_yoco_on sglang-oai-chat http://127.0.0.1:30101 summ 8000 1000 80
MMLU
python runs/20260524_gemma4_e4b_yoco_h100/quality/run_mmlu.py \
--url http://127.0.0.1:30101 --label e4b_mtp_yoco_on --num-questions 500 --seed 0
```
Stack
Stack base: `pyc/yoco-fast-prefill-bench` @ `5cb630913`
Plan: `.humanize/yoco-gemma4/refined-plan.md`
CI States
Latest PR Test (Base): ❌ Missing
run-cilabel -- add it to run CI tests.Latest PR Test (Extra): ❌ Blocked --
run-ciis required first.