Repository navigation
[Model] Add Inkling 2 Mini Fixed and VarLoop support - #214
Merged
bjf-frz merged 1 commit intoNov 24, 2026
Merged
Conversation
HowardYangAI
added a commit
to HowardYangAI/vllm-rlt
that referenced
this pull request
Nov 24, 2026
Resolve conflicts with the Inkling 2 Mini adaptation (InferMatrixLab#214): - kv_cache_manager, stage_engine, memory, buffers: keep both sets of new keyword arguments and imports; grouped writes go through the retained _mark_prepared_write / packed_ranges path. - scheduler: SWA submission-bounded chunking first, then the adaptive wavefront chunk, then the fixed prefill chunk size. - model_runner: keep the packed/coda prefill structure, gated by _packs_prefill() since grouped storage cannot pack.
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.
Purpose
Add single-GPU CUDA text generation for Inkling 2 Mini Fixed and TML-d24-varloop-research. This is the full reviewed integration on top of the standalone revert in #213. The original integration and its review history are in #210.
Both checkpoints share an RLT model wrapper and the vLLM Inkling operators on SM10x. RLT manages per-pass KV and short-convolution state, packed prefill, Mixed scheduling, and startup graph warmup. VarLoop uses the startup
--max-loopssetting. The integrated loop optimizations include WCPB and optional adaptive sizing, asynchronous self-speculative decode, batched draft/target vocabulary projection and Coda layers, and optional speculative pipeline graphs.Automatic KV planning reuses the serving attention implementation when profiling the model. The adaptive scheduler reads the actual KV pool's page counts and geometry. It can choose a chunk at admission, reserve pages for queued decode growth, and fill spare batch rows with already-staged, consecutive chunks at the same Core depth.
Required human contributor answers
The contributor's reviewed outcome, highest-leverage variable, intended impact, users, and decision to submit are recorded in #210's contributor answers. The maintainer approved the final workspace implementation and requested a new full PR after a standalone revert. This PR is needed to publish the reviewed runtime changes, regression coverage, and performance comparison together.
Baseline performance against vLLM
Baseline RLT uses Mixed scheduling, packed prefill, asynchronous scheduling, and startup CUDA Graph warmup. WCPB and self-speculation are disabled. The vLLM reference is target-only at revision
3146a9df4140. The comparison uses TML-d24-varloop-research at revision657b53ba5da7baefe9ff15dca5cd25f5bd3dbaa2and three target Core passes, BF16, per-pass KV, and a 1,024-row query budget. RLT uses the 256-token chunk for W3 and 1,024 for W1 and W7, with 96 graph rows and entries. Each reported point is the median of three unprofiled waves on B300. The W7 C4 software pair used separate B300s on the same host. The other workload rows are same-card pairs.W7 uses natural EOS and a 512-token output limit. These baseline results show the initial gap on long prompts and the three W7 concurrency levels.
W7 C32 reproduction
Run on one B300 with BF16 weights and KV, T3 per-pass KV, and 32 concurrent streaming requests. The checkpoint is VarLoop at
657b53b. RLT reserves 25,344 physical pages across three passes. vLLM reserves 8,449 logical pages including its empty page. With 16 tokens per page, both runs have 8,448 usable logical pages, or 135,168 token positions.The W7 corpus contains 256 ordered first-turn ShareGPT prompts. From
ShareGPT_V3_unfiltered_cleaned_split.json, shuffle record indices with Python'srandom.Random(20261021).shuffle, keep records whose first turn is fromhumanoruserand spans 16–4,096 tokens with the Ouro-1.4B tokenizer, and take the first 256. With the Inkling tokenizer the corpus is 76,810 input tokens, with lengths of 13–3,149 tokens. The dataset file SHA-256 is35f0e213ce091ed9b9af2a1f0755e9d39f9ccec34ab281cd4ca60d70f6479ba4. The ordered text array SHA-256 is0aa122fd181fffc1b72731d0fcba133a1f7a2348f12ea3b34e5290feff708487when serialized as compact UTF-8 JSON withensure_ascii=False.For each benchmark, send 32 unmeasured warmup prompts at zero-based indices 4, 12, …, 252. Run three unprofiled 256-request waves against
/v1/completionswithmodel=inkling,temperature=0,max_tokens=512,ignore_eos=false,stream=true, andstream_options={"include_usage":true}. Submit prompts in corpus order, with 32 client lanes that refill as requests complete. Divide successful output tokens by elapsed time from launching the wave to the final completion, including the drain. The tables use median throughput.The RLT commands below use the current CLI names. Launch with an empty
extraarray for the baseline and the shown flags for the batched-Coda run. PointVARLOOP_MODELat the pinned local snapshot.Launch target-only vLLM at
3146a9df4140with the same checkpoint and client settings.Runtime feature switches
--mode mixed --async-scheduling.--packed-prefill --cuda-graphs --packed-graph-buckets --cuda-graph-warmupto reproduce the benchmark settings. CUDA Graph capture and startup warmup are explicit options.--wavefront-chunked-prefill. Add--adaptive-wavefront-prefillto opt into adaptive sizing within the configured chunk and token budget. The batched-Coda benchmark uses static WCPB.--speculative-mode pipeline --speculative-tokens 2 --draft-loops 1 --target-loops 3with async scheduling. Eligible pipeline paths use shared Coda computation and vocabulary projection automatically.--speculative-pipeline-graph offuses staged execution with per-stage Graphs where eligible. Opt intotransitionfor pipeline acceptance and updates, orfullfor eligible dense decode rounds. The batched-Coda benchmark uses the default.--no-uvato use DMA staging.Incremental loop optimizations
Each row uses its own A/B pair. The percentages describe that pair's throughput change. Queue settings, sample sizes, and source revisions vary across the individual experiments.
Optimized RLT against vLLM
These are the same-card VarLoop T3 comparisons at the batched-Coda stage. RLT uses the asynchronous K=2 pipeline, with WCPB enabled for W7. vLLM is target-only. Each point is a median of three unprofiled waves.
Long-prompt throughput and token tail latency remain areas for improvement. In the separate W4 C32 comparison at a 2,048-row budget, RLT WCPB reached 1,089.46 tok/s versus 1,371.91 for vLLM. Adding the K=2 pipeline to that RLT configuration reduced throughput to 1,027.49 tok/s while reducing TPOT P50 from 10.83 to 9.81 ms. In W3 C16 at the baseline table's smaller budget, WCPB alone reached 781.6 versus 1,055.3 tok/s for vLLM.
vLLM DSpark results by checkpoint
These W7 C32 runs use vLLM
3146a9df4140, the same 256-prompt workload, BF16 per-pass KV, and 16-token KV pages. Each checkpoint uses three Core passes. The DSpark arm adds--speculative-config '{"method":"dspark","num_speculative_tokens":7}'and loads that checkpoint'smtp.safetensors. Each pair uses the same GPU for its control and DSpark runs. The VarLoop vLLM reference in the main tables remains target-only.Inkling-2-MiniTML-d24-varloop-research, T3Fixed + DSpark needs separate follow-up. The two Fixed DSpark waves reached 6,714.23 and 6,661.98 tok/s. Fixed median request TPOT fell from 8.30 to 3.92 ms. The near-1.8× throughput increase makes Fixed with its dedicated drafter an important reference when evaluating Fixed-loop performance. Fixed target-only was measured in one wave. VarLoop produced a throughput regression with DSpark in its paired runs. The Fixed checkpoint was pinned to
b85c3cf.Automatic KV startup reproducer
The #210 snapshot failed locally on B300 during the automatic KV memory probe with
ValueError: packed queries require a compatible attention backend and KV layout. The trigger was VarLoop with Triton and Packed Prefill and no explicit KV pool size. The probe recreated the backend from its name and lost the packed capability. The expected behavior is to use the selected serving backend, finish planning the KV pool, and accept requests.Test plan and results
add9dd7passed repository-wide pre-commit checks, covering Ruff lint, formatting, and the CPU suite. CI-pinned Ruff 0.13.2 lint and formatting also passed locally. Formatting in the publishing checkout preserved the reviewed Python syntax trees.Launch flags and model requirements are covered in the Inkling section of the launch guide.