Skip to content

prompt cache: Nemotron and LFM2 MoE on CUDA keep message-start states by default (#3617 step 1) - #3696

Merged
ashhart merged 10 commits into
mainfrom
lead/msg-starts-cuda
Nov 21, 2026
Merged

ashhart merged 10 commits into
mainfrom
lead/msg-starts-cuda

Conversation

@ashhart

@ashhart ashhart commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Step 1 of #3617: Nemotron and LFM2 MoE on CUDA keep prompt states at message starts by default, so an agent's next request resumes from where its last message began rather than re-reading the conversation. Both families' prefill gives the same bits wherever a prompt is cut, so a state kept at a message start equals the one a fresh pass computes there.

What changes. Request cuts at message starts are carried explicitly to native prefill (no callback context is reinterpreted). Marks that aren't cuts stay interior captures, as before. One cut-point switch covers both families, and the hooks stay within the existing prompt cache budget, slots and admission promises.

Tests. Host tests for the invariant-family cache rules and the request-start metadata. New native CUDA checks run real forwards and snapshot restores and compare device state, hidden rows, logits and the first token between a state kept at a message start and a fresh pass. The format check, the native CUDA and CUDA test-runner compiles, and lean (level with main) pass.

Before landing: these checks and served replies on GB10 (resumed equal to fresh, drafted equal to plain, one stream and several), with decode and prompt timings against main.

  • Synthena

@ashhart

ashhart commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

/atc exchange dc14629f499087af0d335e32d9f9f79a5b9809a386512cb31a587009d0aab741

@ashhart
ashhart force-pushed the lead/msg-starts-cuda branch 4 times, most recently from 3e5b81f to eb80ead Compare November 21, 2026 05:02
Follow main e54cb34, which moves CUDA command usage into main_usage.zig to keep the runner within 600 lines. Keep every current help row and add the incoming nemotron-request-starts and lfm2-moe-request-starts rows in that module. The two commands and their native-state checks are unchanged.
Keep the rebased invariant request-start assertion and paged request-cut call within 120 columns; behavior is unchanged.
@ashhart
ashhart force-pushed the lead/msg-starts-cuda branch from eb80ead to be6cc02 Compare November 21, 2026 16:40
@ashhart
ashhart merged commit 2a27339 into main Nov 21, 2026
13 of 23 checks passed
@ashhart
ashhart deleted the lead/msg-starts-cuda branch November 21, 2026 16:40
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