Repository navigation
Conversation
1 task done
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.
Required human contributor answers
1. What outcome are you trying to achieve?
Qualify
CacheConfig(incremental_allocation=True)forNanbeige4.2(NanbeigeForCausalLM) as a regression-tested capability—closing the unclaimedIncremental allocationcell in RFC #69—and fix any Nanbeige-specific KV allocation, scheduling, or parity defects uncovered during verification.2. What is the highest-leverage variable for that outcome?
End-to-end contract verification of Nanbeige's fixed 2-loop (
LAST_EXITED,storage_depths=2) KV lifecycle through the realStageEngine/Scheduler/KVCacheManagerpath—proving that physical pages are actually allocated at the prompt frontier and grown across block boundaries without numerical drift, admission deadlocks, or block leaks, rather than assuming Ouro coverage transfers automatically.3. How will this work move that variable rather than create busywork?
Instead of a shallow smoke test that merely toggles
incremental_allocation=True, this PR adds contract-enforcing tests intests/test_nanbeige.py(CPU, synthetic CUDA/Triton, and realNanbeige/Nanbeige4.2-3BBF16 checkpoint on RTX PRO 6000) that explicitly assert: (1) initialallocated_blocksafter admission is strictly smaller than full-capacity reservation, (2) decoding acrossblock_sizeboundaries triggersensure_capacitygrowth across intermediate pages, (3) tight-pool admission budgeting (without preemption), watermark headroom, mid-decode abort and request-ID reuse, capacity-pressure preemption/restore with seeded sampling, prefix reuse + WCPB, P->DStageEnginehandoff + decode-stage preemption, self-speculative decoding (blockandpipeline, sync/async, eager/CUDA Graphs, rollback & mid-speculation abort/reuse), and zero block leaks all hold, and (4) outputs match both non-incremental execution anddense_nanbeige_referencetoken-for-token.4. Who is the customer or user, and what do they actually need?
Users serving or evaluating
Nanbeige4.2-3Bonvllm-rltunder largemax_tokensbudgets or mixed-length workloads (and maintainers tracking model coverage in RFC #69). They needincremental_allocation=Trueto avoid upfront over-allocation of physical KV blocks for unused decode capacity, with verified guarantees against deadlocks, KV leaks, and output divergence across ordinary, PD, and speculative paths.PR necessity and bugfix evidence
Yes, a PR is needed. RFC #69 explicitly requires model-specific validation rather than inheriting Ouro's status, and neither
tests/test_nanbeige.pynor open PRs (#138, #139) coverincremental_allocationfor Nanbeige. A config tweak or doc note alone cannot provide CI regression protection. This is a qualification/test PR rather than a bugfix; no runtime defects were observed in the tested incremental-allocation paths (including PD handoff and self-speculation on both synthetic models and the realNanbeige/Nanbeige4.2-3BBF16 checkpoint).Purpose
Add CPU, synthetic CUDA, and real-checkpoint CUDA qualification tests in
tests/test_nanbeige.pycoveringCacheConfig(incremental_allocation=True)forNanbeigeForCausalLM(part of #69):ensure_capacitygrowth, fixed 2-loop exit depths, and parity against both non-incremental execution anddense_nanbeige_reference.abort_request+ request-ID reuse with a distinct prompt, andwatermark_ratioadmission headroom.temperature=0.7, seed=17).prefix_hits) and dense oracle parity.StageEnginePD transfer (role="prefill"->role="decode") under incremental allocation: decode-side growth budgeting, dynamic cross-page expansion, decode-stage tight-pool preemption with seeded sampling (temperature=0.7, seed=31), zero block leaks on both stages, and oracle parity.draft_loops=1, target_loops=2,K=3,blockandpipelinemodes) under incremental allocation: initial chunk-only allocation, real draft rejection/rollback (truncate_suffix), mid-speculation abort + request-ID reuse, sync/async and eager/CUDA Graph Triton parity.Nanbeige/Nanbeige4.2-3BBF16 GPU qualification (test_nanbeige_gpu_real_checkpoint_incremental_allocation, gated onNANBEIGE_CHECKPOINTorartifacts/models/Nanbeige4.2-3B) covering eager + CUDA Graphs parity, tight-pool preemption/restore, prefix caching, PD handoff, andblock/pipelinesync/async/graph self-speculation.Performance & Refactoring Review (
docs/developer-guide.md):rlt-perf-opt: Test-only change; no runtime or kernel execution path was modified, so runtime GPU benchmarking is not applicable and no speedup is claimed.rlt-refactor: Extracted_tiny_gpu_nanbeige()and_copy_prompt_kv()to avoid duplicated test setup across CPU/GPU/PD tests, exercised publicengine.step()rather than privatescheduler._admit()for watermark verification, and closed all engines intry/finally.Scope & Disclosed Limitations:
StageEnginetransfer contract (reserve_transfer, KV copy,accept_import,release_transfer, matchingtests/test_stage_engine.py); cross-process multi-GPU NIXL transport was not run becausenixlis not installed in the test environment.Nanbeige/Nanbeige4.2-3BBF16 (b82e54bd609793562a75cbf9337970a93369eab5) on RTX PRO 6000 with Triton (block_size=16); full GSM8K accuracy sweeps and throughput benchmarks were not run because no runtime code changed.Test Plan
vllm-rlt Version / Commit: base
main@ce200f0d2085fb041c66691245e29aef2a9ed714, head778f40d9283954757e648e41b24adc92ef165ebeReal Checkpoint:
Nanbeige/Nanbeige4.2-3B@b82e54bd609793562a75cbf9337970a93369eab5(SHA256 verified)Test Result
Environment: Ubuntu Linux, Python 3.10.12, PyTorch 2.7.1+cu128, Triton 3.3.1, ruff 0.13.2, pytest 9.2.0, NVIDIA RTX PRO 6000 Blackwell Server Edition.
python -m ruff check .:All checks passed!python -m ruff format --check .:154 files already formattedOMP_NUM_THREADS=1 python -m pytest -q tests/test_nanbeige.py -k "not real_checkpoint":19 passed, 10 skipped, 2 deselected in 2.82sOMP_NUM_THREADS=1 CUDA_VISIBLE_DEVICES=0 python -m pytest -v --run-gpu tests/test_nanbeige.py:30 passed, 1 skipped in 62.40sNanbeige4.2-3BBF16 GPU checks passed with exact token parity andnum_used_blocks == 0at completion (eager & CUDA Graphsused_after_step1=4vs14full,captures=2, replays=63; tight-pool preemptionpreemptions=1, resumptions=1; prefix cachinghit_tokens=16; PD handoffD_init=2 -> D_peak=4, 24/24 exact match;block&pipelinesync/async/graph speculationu1=2 -> peak=4, 24/24 exact match).test_official_nanbeige_tokenizer_contractskipped (checks default HF cache rather thanartifacts/models/Nanbeige4.2-3B).OMP_NUM_THREADS=1 python -m pytest -q(full repo CPU suite):1289 passed, 916 skipped, 12 failed— all 12 failures are unrelated FP8 CPU tests (tests/test_fa4_fp8.pyandtests/test_fp8_kv_cache.py) failing withRuntimeError: "index_cpu" not implemented for 'Float8_e4m3fn'on PyTorch 2.7.1.