Architecture: shared self-MTP draft context ownership for parallel slots #1905
Replies: 2 comments 1 reply
-
|
I'm not Ik, but I can contribute a little to the discussion.
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks Sam, this is really helpful. I’ll reshape around shared context as the first review surface with concrete MTP value, rather than treating it as only an env-gated experiment. To make sure I’m interpreting the sequence-route requirement correctly: would you consider it satisfied if the shared companion path uses For immediate value, would you prefer the first PR target one narrow MTP path, such as GLM/Gemma 4, with batched companion draft and range-checkpoint performance work left as follow-ups? Also, if there’s a specific mainline path you had in mind as the reference, a pointer would be much appreciated. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @ikawrakow, I've been investigating the
TAG_SERVER_SPEC_REWORKTODO inexamples/server/server-context.cpp:3549on currentorigin/main:#1119 introduced the server TODO. I saw the current -np guardrail in examples/server/server-context.cpp and the related #1804/#1901 history; this is an architecture question about whether the right next step is to replace that guardrail with server-owned shared self-MTP context plus per-slot speculative state, not a request to bypass the guardrail as-is.
I have this in a public experimental branch, but I'm intentionally not treating that branch as a PR:
https://github.com/joelfarthing/ik_llama.cpp/tree/filament/mtp-shared-context-experiment-20260530
I also split out a smaller local lifecycle branch that I can push if this is the right direction:
https://github.com/joelfarthing/ik_llama.cpp/tree/filament/mtp-shared-context-lifecycle
The lifecycle split is meant to be the architectural core only:
server_contextowns the shared self-MTP companion context.-np > 1MTP guardrail is preserved for the general case; the shared self-MTP path is an explicit env-gated exception rather than a broad speculative-decoding rewrite.The range-checkpoint result is why I think this is worth discussing. In the shared parallel self-MTP shape, the old fallback path made recurrent checkpoint saves expensive. Deferring checkpoint saves to isolated validation ranges and
using
gpu-fallbackinstead of CPU gave the cleanest signal on MoE Qwen3.6:2.20sto1.65s.630.872msto28.425ms.per-stepand should stay on that path.I'm intentionally holding back the batched companion-draft prototype for now. It does build locally as a separate branch, but I don't think it should be the first review surface. It touches batching, sequence ids, hidden-state row shape, and shared companion state all at once. I'd rather figure out the ownership and lifecycle shape first.
The three questions I would most like your feedback on:
Is "server owns the shared self-MTP context, slots own only per-slot speculative state" the right ownership model for ik_llama?
For recurrent shared parallel MTP, is it reasonable to force
gpu-fallbackuntil per-step checkpoint buffers are truly per-slot, and should the range-checkpoint change be a stacked follow-up or part of the first shared context PR?Would you prefer the first reviewable PR to be only the env-gated lifecyce branch, with batched companion draft kept out, or would you split this differently?
I can reshape the branch around whatever direction and review path would be easiest. My initial goal here is to avoid dumping a broad experimental branch into review before the ownership model is settled.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions