Skip to content

[Model] Add Inkling 2 Mini Fixed and VarLoop with adaptive WCPB - #212

Closed
bjf-frz wants to merge 2 commits into
InferMatrixLab:mainfrom
bjf-frz:feature/inkling2-mini-reviewed-20261124
Closed

bjf-frz wants to merge 2 commits into
InferMatrixLab:mainfrom
bjf-frz:feature/inkling2-mini-reviewed-20261124

Conversation

@bjf-frz

@bjf-frz bjf-frz commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Replace the merge of #210 with the final reviewed Inkling 2 Mini Fixed and VarLoop implementation. This branch explicitly reverts merge commit 9aba6be and reapplies the reviewed implementation in a second commit. Merging both commits together preserves continuous Inkling support on main.

The net changes relative to #210 add opt-in adaptive WCPB, including per-request chunk sizing and same-depth backfilling, and repair automatic KV memory planning for packed Inkling execution. The scheduler uses the active KV pool's page geometry and capacity. The startup probe reuses the attention backend configured for serving.

Required human contributor answers

The contributor's reviewed outcome, highest-leverage variable, expected impact, user needs, and decision to submit are recorded in #210's contributor answers. The maintainer approved the final workspace implementation and requested that it replace the earlier merge. A replacement PR is needed to publish the reviewed runtime code and its regression coverage.

Automatic KV reproducer

Locally reproduced on B300 with Inkling VarLoop, Triton attention and Packed Prefill enabled. Starting the #210 snapshot without an explicit KV pool size fails during the model-forward memory probe with ValueError: packed queries require a compatible attention backend and KV layout. The probe recreated the backend from its name and lost the packed capability. The server should finish probing, size its KV pool, and accept requests.

A minimal server invocation with the supported vLLM Inkling operators installed is:

python -m vllm_rlt.entrypoints.serve \
  --model thinkingmachines/TML-d24-varloop-research --max-loops 3 \
  --device cuda --dtype bfloat16 --attention-backend triton \
  --mode mixed --packed-prefill --max-num-seqs 4 \
  --prefill-chunk-size 1024 --max-num-batched-tokens 3072

Test plan

  • Run the repository's Ruff lint, formatting, and CPU regression checks on the replacement commit.
  • Start a B300 VarLoop worker with automatic KV planning, Packed Prefill, Mixed, async scheduling, startup Graph warmup, and adaptive WCPB.
  • Keep the grouped WCPB measurements from the reviewed workspace and the prior integration evidence from [Model] Add Inkling 2 Mini Fixed and VarLoop support #210.

Test results

The replacement head add9dd7 passed the repository's all-files pre-commit run and the CI-pinned Ruff 0.13.2 lint and format checks. Four files were formatted in the publishing checkout with unchanged Python syntax trees.

The B300 serving smoke at this head used VarLoop with 3 Core passes, BF16, Mixed, Packed Prefill, async scheduling, Graph warmup, and adaptive WCPB. The automatic memory probe allocated 26,024 physical KV blocks of size 16. The service completed all four W3 requests with 4,096 prompt tokens and 128 generated tokens each, after a separate four-request warmup.

The following same-card comparisons use the reviewed workspace snapshot with a 1,024-token chunk ceiling and 3,072-row budget. Each cell is the median of three unprofiled B300 VarLoop T3 runs.

W3 workload Static WCPB (tok/s) Adaptive WCPB with same-depth fill (tok/s) Change TTFT P50, static / adaptive (ms)
C1 227.00 231.29 +1.9% 80.46 / 69.75
C4 541.60 545.23 +0.7% 259.88 / 251.08
C16, static measured first 992.00 1,055.56 +6.4% 960.14 / 912.21
C16, adaptive measured first 1,037.48 1,065.10 +2.7% 944.31 / 905.19

The two C16 throughput ranges overlap. The C1 ops-only capture showed 85.14 to 73.49 ms of GPU activity across a 24-step window. An earlier adaptive sizing run before same-depth fill, under a 45% device-memory limit, used a 9,492-block KV pool and completed all W3 requests, with throughput falling from 830.12 to 823.56 tok/s relative to static WCPB. Testing on physical accelerators covered B300. Earlier Fixed and VarLoop serving and speculation evidence is in #210's test results.

@bjf-frz bjf-frz closed this 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