Repository navigation
perf(nemotron cuda): prompt_logprobs reads 256 rows a head pass - #776
Merged
ashhart merged 1 commit intoOct 13, 2026
Merged
Conversation
…256 rows a pass A logits buffer of its own (made at the first prompt_logprobs request) lets each head pass take 256 prompt rows, so the head's weights are read once for all of them; without the memory the pass keeps state.max_rows.
7 of 8 tasks
jschmied
pushed a commit
to jschmied/TensorFold
that referenced
this pull request
Oct 13, 2026
Owner
|
Thank you, @plotarmordev. Reading the prompt rows through the head 256 at a time is a small change that does a lot for long prompts with What we measured on a GB10 (sm_121), against the build without it:
The 64 MiB logits buffer stays for the server's life once the first such request makes it; the CHANGELOG line says so. |
Closed
BlivionIaG
pushed a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 20, 2026
BlivionIaG
pushed a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 20, 2026
The contributor's commit landed above with the same code; this keeps the PR's head in the history with no change to the tree.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
prompt_logprobson Nemotron CUDA reads its prompt rows through the head 256 rows a pass instead of 16, so the head's weights are read once for every 256 rows. The pass writes into a logits buffer of its own (64 MiB, made at the first such request). Without the memory it keeps 16-row passes. The rows are unchanged to the bit.cuda_prompt_rows.zig:batch_rows = 256;PromptRowscarries its row count and logits buffer.cuda_lanes.zig: theprompt_logitsbuffer, andprompt_outsized for 256 rows.Receipt
Environment: DGX Spark (GB10), Nemotron 3.5 Lightning MLX-4bit @
d9d758fb, on 1.0.8 (0efbd447),--context 16384 --parallel 4. Every server start measured its own window-cost table (a fresh cache), arms alternated.Exactness: the
prompt_logprobsarray is byte-identical to 1.0.8 at 0, 5 and 20 alternatives on 563-, 3,377- and 8,741-token prompts, every run. Requests withoutprompt_logprobsare unchanged in time (0.556 s against 0.555 s at 3.4k tokens).Speed, a 1-token reply with
prompt_logprobs(2 starts an arm, 3 calls each):The extra cost of
prompt_logprobson the 8,741-token prompt fell from 0.70 s to 0.13 s.Tests run:
zig build test616/621 (5 skipped);test-cuda-host25/25 steps; server tests 155/155 and 96/96; goldens 309/319 with 0 unexpected differences;zig fmt;lean_checkas on 1.0.8.Not run, and why: Metal (unchanged). The NVFP4 checkpoint and RTX cards (no hardware here). Note: this and perf(nemotron cuda): the lone driver takes requests with logprobs #777 each open a
## Unreleasedsection in CHANGELOG.md, so whichever lands second takes a trivial merge.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.