Repository navigation
Conversation
ea0076a to
bec5480
Compare
Enable idle reply passes only with a prompt cache, retaining the MTP one-token lookahead and the next request's existing chunk cuts. Give an immediate request a quiet interval, then yield between prompt chunks without releasing an in-flight command buffer early. Trace warm pass boundaries under TF_LANE_TRACE so arrivals during a pass can be distinguished from arrivals before it. Test cache-off policy, planned marks, yield/cancel precedence and owned flight completion. Fixes #3108
bec5480 to
8329aea
Compare
|
I can add an M5 Max leg next to your M5 Ultra rows: Apple M5 Max (40-core GPU), 128 GB, macOS build 26B131, Zig 0.17.0. Plan, against the "done when" list in #3108, base
Same model as your rows (Nemotron 3.5 Lightning MLX 4-bit with its MTP head) unless you'd prefer another. It would run in the next few days; tell me if the head is about to move or if there's a narrower cell you'd rather have. |
|
M5 Max leg, against the "done when" list in #3108.
On this host the startup line is Five-turn chat, each reply sent back:
With the recipe's shape (a 9.1K-token system prompt and 96-token replies), turns 2-5 have the same cached counts and TTFT as main, 0.092-0.123 s on both. A follow-up after an 8.2K-token reply:
After a 16.4K-token reply, with the reply ending 64 past 16,384:
In that case the warm pass's only mark is 16,384, past its first 8,192-row chunk. A follow-up that arrives during the first chunk waits about 1.45 s for it to land and then finds no kept state, so it is 1.44 s slower than main (4 of 4 samples). A 17,237-token turn in the 0.2 s cell above did the same (4.78 against 3.32 s). Token equality: each conversation is two turns: a reply ending past 8,192, then a 256-token follow-up. There are 4 conversations per mode and stream count, in greedy MTP, greedy serial, seeded MTP and seeded serial, solo and four at once.
Cold and decode: cold prompts at 2K, 8K, 16K and 32K come in at 0.427 / 1.550 / 3.149 / 6.736 s on main against 0.426 / 1.551 / 3.148 / 6.740 s here, about 4,840-5,300 tok/s on both. Decode at 512 tokens: prose 290.9 against 287.9 tok/s with MTP and 188.4 against 188.6 serial; code 307.5 against 307.7 and 188.3 against 188.5. Every cell is inside main's range. Against "done when" on the M5:
Receipts (commands, prompts, raw per-request data with token ids and hashes, server logs, lane traces) available on request. |
Fixes #3108.
Nemotron on Metal turns on warm turns. When a reply ends, the lane host waits 150 ms of quiet, then prefills the reply as the next turn will render it, so a follow-up resumes from the kept state instead of prefilling again. It saves the Mamba state and the MTP head exactly as a fresh prefill leaves them, and only at the existing planned cuts, so no new cut points or arithmetic. Two commits:
native/planned_warm.zig,native/metal.zig, the Nemotron prompt loop);cache 0still turns it off.Measured on an M5 Ultra (Nemotron 3.5 Lightning MLX 4-bit with its MTP head; A B B A, warm-ups dropped; 960 replies, 1,068,032 tokens):
Host tests: the warm lane host and prompt-flight tests (7 changed-flight tests); two planted controls fail and pass when restored. Not checked: M1-M4, CUDA, an unrelated prompt arriving during a warm chunk.