Skip to content

[Model] Add Inkling 2 Mini Fixed and VarLoop support - #210

Merged
bjf-frz merged 11 commits into
InferMatrixLab:mainfrom
bjf-frz:feature/inkling2-mini
Nov 24, 2026
Merged

bjf-frz merged 11 commits into
InferMatrixLab:mainfrom
bjf-frz:feature/inkling2-mini

Conversation

@bjf-frz

@bjf-frz bjf-frz commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Purpose

Add single-GPU CUDA text generation for Inkling 2 Mini Fixed and TML-d24-varloop-research using vLLM Inkling 2 operators on SM10x. The integration covers checkpoint loading, per-pass KV and short-convolution state, packed prefill, WCPB, Mixed scheduling, and startup CUDA Graph warmup. The runtime also supports a greedy asynchronous token pipeline in which prompt and speculative rows can share a Core forward. The asynchronous pipeline batches target and draft Coda computations within each layer.

Required human contributor answers

  1. Outcome. Serve both Inkling checkpoints in RLT and establish a reproducible VarLoop performance baseline.
  2. Highest-leverage variable. End-to-end output throughput and request latency at the same target depth and workload.
  3. Expected impact. Reuse one model implementation, batch compatible prompt and decode work, and prepare the graph entries before the worker accepts traffic.
  4. Users. RLT users serving Inkling need configurable VarLoop depth, causal per-pass state, and reproducible launch settings.

PR necessity. The model integration adds checkpoint loading and runtime support that require upstream review. A B300 reproducer also verified the packed Graph key fix. The same long prompt ran 11 Prefill Core calls eagerly before the fix and replayed all 11 after it.

Test Plan

  • Run the CPU suite and targeted CUDA tests for speculation, split prefill, prepared KV, attention, CUDA Graphs, and asynchronous execution.
  • Exercise both checkpoints on B300. Check eager and Graph execution, mixed Core replay, EOS, cancellation, and request ID reuse.
  • Measure W7 with 256 text requests at C32, a 512-token limit, and natural EOS. Use one B300, BF16, target depth 3, per-pass KV, a 1,024-token chunk and query budget, packed prefill, WCPB, Mixed scheduling, and 96 Graph rows and entries. Warm up with 32 requests and run two unprofiled repetitions per mode.

Test Results

Adaptation revision 7cc31af, based on ce200f0.

Check Result
CPU regression suite 1,303 passed, 918 skipped
Targeted CUDA regression suite 374 passed, 1 skipped
VarLoop three-pass eager smoke test Matched the target-only token IDs in the smoke sample and passed EOS, cancellation, and ID reuse checks
VarLoop two-pass Graph smoke test Completed real mixed Core replays and passed lifecycle checks. The short sample showed some greedy token differences

Paired W7 VarLoop comparison at three target passes. Each measured run completed all 256 requests. Latency figures are medians of the two per-run percentiles.

RLT mode Output throughput by run (tok/s) Median throughput (tok/s) TTFT P50 (ms) TPOT P50 (ms) ITL P99 (ms)
Target-only Mixed 3,183 / 3,094 3,139 131.7 9.62 32.58
Mixed + async 1-to-3 pipeline, K=2 3,675 / 3,650 3,663 70.5 8.20 28.74

The paired result is a 16.7% output-throughput gain. A separate target-only rerun after the packed Graph key fix measured 3,165 and 3,171 tok/s. The two-pass token differences remain under investigation.

WCPB characterization

Each row changes only WCPB within its recorded pair. These VarLoop runs used three Core passes, chunk size 256, query budget 1,024, two traffic warmup waves, and three measured waves. Each pair ran on a single B300.

Workload WCPB off (tok/s) WCPB on (tok/s) Throughput change
W3 C4, after the packed Graph key fix 457.56 462.55 +1.1%
W3 C16, after the packed Graph key fix 619.52 762.41 +23.1%
W7 C32, 48 requests, before the key fix 2,754.67 2,782.40 +1.0%

The three post-fix W3 C4 runs overlap in throughput. In the W7 pair, ITL P99 fell from 27.29 to 12.03 ms while TTFT P50 rose from 181.39 to 227.74 ms. In the post-fix W3 C16 pair, TPOT P50 fell from 17.10 to 10.78 ms and TTFT P50 rose from 1,274 to 1,356 ms. The W7 row records the earlier pre-fix scheduler.

Coda batching in the asynchronous pipeline

The target and draft share linear projections and MoE batches within each Coda layer. Attention and short convolution still execute in target-to-draft order so the draft reads the verified history. The batched Coda replays through one CUDA Graph.

All numbers are medians of three unprofiled repetitions on B300 using the VarLoop checkpoint with three target passes. W7 RLT uses Mixed, WCPB and the asynchronous K=2 pipeline. W1 uses the asynchronous K=2 pipeline with WCPB disabled. Each row compares optimized RLT with vLLM on the same GPU. The earlier RLT W7 C4 measurement used a different B300 on the same host. The vLLM reference uses its faster measured target-only configuration.

Workload RLT before Coda batching (tok/s) RLT with Coda batching (tok/s) vLLM (tok/s) Throughput vs. vLLM RLT / vLLM TTFT P50 (ms) RLT / vLLM TPOT P50 (ms) RLT / vLLM ITL P99 (ms)
W1 C1 294.25 309.95 261.37 +18.6% 11.47 / 16.24 3.16 / 3.73 8.74 / 4.96
W7 C4 896.22 960.82 835.49 +15.0% 50.00 / 36.69 4.02 / 4.72 11.38 / 5.73
W7 C16 2,331.30 2,530.90 2,275.75 +11.2% 64.37 / 38.74 5.96 / 6.83 25.55 / 11.87
W7 C32 3,730.59 4,113.31 3,694.03 +11.4% 66.77 / 66.32 7.31 / 8.39 27.62 / 17.04

At W7 C32, the optimization adds 10.3% throughput over the previous RLT pipeline. In the three-pass native Graph smoke test, all 72 sampled tokens matched the previous pipeline, and EOS, cancellation, request ID reuse, and Mixed Graph replay passed. The workspace regression run covering the Coda change passed 179 CUDA and scheduler tests. A focused run in the PR checkout passed 98 tests, with 81 GPU-marked tests skipped. W7 token tail latency and W3/W4 long-prompt throughput remain open performance gaps.

Follow-up framework optimizations

Review the changes in execution order.

  1. Mixed prefill continuations gives already-started prompts queue priority on the native non-WCPB path while preserving order within each group.
  2. Asynchronous input preparation reuses two leased input banks and stages changed page tables and routing data through UVA or DMA. A separate input stream overlaps transfers with compute and readback when multi-stream execution is enabled.
  3. Coda Graph input and output reuse shares a page table between target and draft and consumes borrowed replay outputs on the same compute stream.
  4. Speculative pipeline Graphs adds the opt-in --speculative-pipeline-graph transition and full modes. The latter captures dense pure-decode rounds from Prelude through the state calculation. It falls back to the staged path for Mixed rounds and shapes outside the dense bucket.

Follow-up validation

Each performance row compares the previous RLT implementation with all follow-up changes on the same B300. These are medians of three unprofiled VarLoop T3, K=2 repetitions with 96 graph rows and entries, Mixed, packed prefill, and startup graph warmup. W4 and W7 use WCPB. W1 and W4 process 32 fixed-length requests per repetition, and W7 processes 96 text requests with natural EOS.

Workload Previous RLT (tok/s) Updated RLT (tok/s) Throughput change ITL P99 (ms)
W1 C1 307.52 324.90 +5.65% 8.75 → 8.27
W4 C32 1,133.88 1,140.68 +0.60% 19.26 → 19.14
W7 C32 4,010.37 4,132.37 +3.04% 29.98 → 28.69
  • In a separate matched W3 C16 scheduler test with a 2,048-token chunk and budget, prefill continuation priority raised throughput from 837.0 to 907.1 tok/s and reduced TTFT P50 from 186.0 to 143.2 ms.
  • In matched W7 C32 ablations, UVA and DMA throughput overlapped across repetitions. With the same 128-event output queue on both sides, the transition graph and full graph changed throughput by +1.04% and +2.37% over the updated staged path. Full graph ITL P99 in that pair increased from 27.88 to 29.06 ms. Two default-queue transition-only trials hit the serving output queue limit.
  • Across 24 profiled W7 decode steps, full graph replay reduced graph launches from 72 to 24 and CUDA memcpy calls from 744 to 48. Aggregate GPU kernel time moved from 164.8 to 162.6 ms.
  • The submission snapshot passed the all-files pre-commit checks for Ruff lint, Ruff format, and the CPU regression suite.
  • The targeted speculative regression run passed 255 tests with 2 skipped. The native padded-graph smoke matched all 96 sampled token IDs across the execution modes. A separate Mixed test matched all 96 sampled token IDs against the previous source snapshot and exercised 23 full-graph replays. The scheduler GPU regression passed 93 tests.

Inkling loop-depth flag

The CLI and server use --max-loops to select the VarLoop instance depth. In the offline CLI, existing model families still use the flag as a request limit. An explicit value for a Fixed Inkling checkpoint must match the checkpoint depth. The VarLoop CUDA CLI smoke with --max-loops 1 returned two tokens at depth 1. The server started with --max-loops 2 and returned a successful completion. The all-files pre-commit checks passed.

Inkling operator path

Both checkpoints now use the vLLM Inkling 2 operators on SM10x. RLT owns the model wrapper, scheduler, and KV metadata. The CLI and server no longer expose a kernel selector. The standalone fallback attention and BF16 expert path were removed, and the operator adapter is vllm_rlt/kernels/inkling2mini.py.

The Fixed CUDA smoke returned two tokens at depth 3. The VarLoop Mixed comparison used the previous vLLM path as its reference. All 96 output token IDs matched, with 19 packed graph replays and 23 full-round replays. The updated snapshot passed the all-files pre-commit checks.

Launch and configuration details are in the Inkling 2 Mini guide.

@bjf-frz bjf-frz changed the title 全面适配 Inkling 模型 Add comprehensive Inkling model support Nov 23, 2026
@bjf-frz bjf-frz changed the title Add comprehensive Inkling model support [Model] Add comprehensive Inkling model support Nov 23, 2026
@bjf-frz bjf-frz changed the title [Model] Add comprehensive Inkling model support [Model] Add Inkling 2 Mini Fixed and VarLoop support Nov 23, 2026
@bjf-frz
bjf-frz marked this pull request as ready for review November 24, 2026 07:35
@bjf-frz
bjf-frz merged commit 9aba6be into InferMatrixLab:main Nov 24, 2026
1 check passed
bjf-frz added a commit that referenced this pull request Nov 24, 2026
This reverts commit 9aba6be, reversing
changes made to ce200f0.
bjf-frz added a commit that referenced this pull request Nov 24, 2026
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