Repository navigation
Inkling 2 Mini on Metal: with a drafter, the window fit prices a token at a token's bytes (a 64 GB limit holds the whole window for eight streams) - #4622
Conversation
aefb063 to
c41911e
Compare
|
Sorry for the noise: this was closed automatically when #4387 landed on main and its base branch was removed. It is reopened and now targets
|
…t a ring step of them
ea92d3b to
f714bb3
Compare
|
Thank you @sethforprivacy. The token price is now 4,096 bytes, and the ring-rounding allowance stays conservative. The actual reservation and per-request target-state checks remain in place. I favor this focused fix over changing the startup count and pressure policy. The remaining qualification is the larger admitted windows on current main; opening with eight streams does not reserve eight maximum-size target caches.
|
|
Thank you, @sethforprivacy. The current fix prices a DSpark token at 4,096 bytes and keeps a conservative allowance for ring alignment. It merges cleanly with main and preserves the landed demand breakdown, pressure policy and per-request state checks. This is ready for controlled comparisons of the larger admitted windows on the final tree. Eight drafted streams at startup still rely on the existing request-size budget checks for their target caches. The earlier qualification results are useful, and the remaining checks belong to final integration.
|
What this changes
Before: with
--drafter, the Metal opener allows a context window about a hundred times shorter than the memory holds. With a 64 GB load limit it offers 18,878 tokens to four streams and 9,442 to eight, and refuses--context 262144. After: the same limit holds the model's whole window for eight drafted streams.This is a proposal on top of #4387, opened as a draft.
3e0e9bcb83, then Inkling 2 Mini on Metal: #4387's native build compiles, its norms write their output, and concurrent streams equal solo #4446 (97c91058f). This pull request's own commit isea92d3b40. It touches the opener's arithmetic only and does not depend on the other drafts.atc overlap --json: not run; ATC is not installed on the machine that pushes.The cause.
openprices a drafted stream's token asDrafter.streamBytes(1) - Drafter.streamBytes(0). A stream's global rings come 128 rows at a time (globalRingrounds the window up to 128), so that difference is 128 tokens' bytes, 524,288, where a token costs 4,096. The fixed part then adds 127 of those for the rounding, and the test beside it checks the bound from the same difference, so it holds.The fix.
Drafter.tokenBytes()is the lane's bytes a token andDrafter.ring_slackthe 127 rows the rounding can add; the opener's fixed part isstreamBytes(0)plus the slack's bytes. The reservation itself (streams * streamBytes(window)) was already exact and is unchanged.Measured on this stack,
INKLING2_LOAD_LIMIT_GB=64,--drafter, no--context(the opener then reports the longest window it allows, which is over the 262,144 the model takes):--parallel 2--parallel 4--parallel 8With
--context 262144 --parallel 8under that limit the server starts, answers eight requests at once and takes a 72,826-token prompt; its footprint peaks at 31 GB.Checks on this head
ea92d3b40.streamBytesat six windows from 1 to 262,144, that it is never more than the slack above it, and that 36 GiB of state hold 262,144 tokens for eight drafted streams. With that last expectation changed by one the Inkling host steps fail, so the test runs there; as written they pass.zig build native -Dcpu=apple_m1: compiles.test-inkling2-metal-host,test-inkling2-host,test-inkling2-controls-host,test-inkling2-launch-map-host,test-inkling2-metal-capabilities,compile-inkling2-native-host): exit 0.tf-kernel-contract --only inkling2(-Doptimize=safe):SUMMARY 41 kernels: 41 pass gates 1-4, 0 fail, 0 known findings; 41 controls: 41 red as planted, 0 missed; 0 limit problems, exit 0.zig fmt --check build.zig zigandgit diff --check: clean.zig build test test-goldenon this head (the stack's inherited failures are listed in Inkling 2 Mini on Metal: #4387's native build compiles, its norms write their output, and concurrent streams equal solo #4446). CUDA and HIP are not touched.Receipt
inkling2_loopMetal path with--drafter.thinkingmachines/Inkling-2-Mini@ed40e7da625f594fc9c4990f5f66be24873c22d7. The served rows are from the whole stack with this commit applied and Metal loader: a checkpoint span of 16 GiB or more loads (each pread capped at 1 GiB) #4435's read cap.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Not touched.)--drafter, no slower than without it. (Not touched.)