Skip to content

perf(nemotron cuda): the lone driver takes requests with logprobs - #777

Merged
ashhart merged 2 commits into
ashhart:mainfrom
plotarmordev:perf/nemotron-lone-logprobs
Oct 13, 2026
Merged

ashhart merged 2 commits into
ashhart:mainfrom
plotarmordev:perf/nemotron-lone-logprobs

Conversation

@plotarmordev

@plotarmordev plotarmordev commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Nemotron CUDA's lone driver takes a lone request that asks for logprobs. Before, such a request decoded in the lane rounds even when nothing else ran. The driver opens the stream with the prompt's last row, as the lane rounds do. Each round it reads the kept rows from the window's logits with the same logprobRows kernel the lane rounds' windows use, so rows and tokens are unchanged.

  • cuda_lone.zig: the first row, and each round's rows committed with its tokens.
  • engine_api.zig Lone.logprobs, lane_host_lone.zig fits, native/cuda.zig: the driver says it gives rows, and the host lets such requests through.

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: a 400-token greedy reply has the same token_sha and the same logprobs array as 1.0.8 at 0, 5 and 20 alternatives (3 starts, 4 calls each). Pairs where a second request arrives 0, 0.3 or 1.0 s later, so the driver hands the first to the lane rounds mid-reply, greedy and seeded temperature: 0.8, at 0 and 20 alternatives: all 24 replies' tokens and rows equal 1.0.8's. Drafted output equals "draft": false for each kind, rows included.

  • Speed, the same reply, 3 starts an arm:

    alternatives 1.0.8 this change
    no logprobs 2.28 s 2.28 s
    0 2.32-2.45 s (+4.6%) 2.29-2.33 s (+0.3%)
    5 2.35-2.47 s (+5.6%) 2.30-2.35 s (+0.9%)
    20 2.45-2.56 s (+8.4%) 2.35-2.39 s (+3.1%)

    Percentages are the cost over the same start's reply without logprobs. The reply took 116 rounds on 1.0.8 against 104 now, as many as without logprobs.

  • Tests run: zig build test 616/621 (5 skipped); test-cuda-host 25/25 steps; server tests 155/155 and 96/96; goldens 309/319 with 0 unexpected differences; zig fmt; lean_check as on 1.0.8.

  • Not run, and why: Metal (unchanged). The NVFP4 checkpoint and RTX cards (no hardware here). The Grill has no logprobs workload. Note: this and perf(nemotron cuda): prompt_logprobs reads 256 rows a head pass #776 each open a ## Unreleased section in CHANGELOG.md.

Checklist

  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off. (The lone driver is main's existing path for a lone drafted stream; this widens which requests take it. Arrivals still hand the stream to the lane rounds as before.)
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.
  • No precision traded for speed. (Same kernels and draws; only which loop drives the stream changes.)
  • Prompt processing is no slower than the last release. (The prompt pass is unchanged.)
  • The description says which platforms I ran: CUDA GB10 only.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths. No AI attribution lines.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency. (No new test: the host tests cover the hand-over, and the rows path needs a GPU.)

It commits each round's kept rows as the lane core's windows read them (logprobRows on the window's logits)
and opens the stream with the prompt's last row, so a lone logprobs request decodes on the lone driver's
graphs and confidence depth rule.
@ashhart
ashhart merged commit 6f4af35 into ashhart:main Oct 13, 2026
2 checks passed
jschmied pushed a commit to jschmied/TensorFold that referenced this pull request Oct 13, 2026
jschmied pushed a commit to jschmied/TensorFold that referenced this pull request Oct 13, 2026
The contributor's commits landed above with the same code, on top of ashhart#777's; this keeps the PR's head, which also holds ashhart#777's and the contributor's merge of the two CHANGELOG lines, in the history with no change to the tree.
@ashhart

ashhart commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Thank you, @plotarmordev. Reading the kept rows off the window the lone driver just verified is the right way to bring logprobs onto it: the same kernel reads the same logits the lane core would. It landed in 1.0.9 under your name (50759e4ee, and the CHANGELOG line ebc6605a2) with the same code. Your head is merged after it with no change to the tree (6f4af3564), so GitHub shows this PR as merged.

What we measured on a GB10 (sm_121), against the build without it:

  • Exact. On MLX 4-bit (our kernels and the captured set) and NVFP4, every lone logprobs reply equalled the lane core's, rows and tokens byte for byte: three prompts (one with thinking, whose rows cover only the answer), greedy and seeded sampled, at 0, 5 and 20 alternatives, plus the legacy /v1/completions form. Each also equalled "draft": false, and a streamed reply's rows, joined over its chunks, equalled the whole reply's. The replies' min_rows show the lone driver served every one, where the build without it used the lane core.
  • Speed. Four servers a build in a mirrored order, MLX 4-bit: a 400-token greedy reply with logprobs cost 0.4%, 1.4% and 4.1% more than one without at 0, 5 and 20 alternatives, against 4.6%, 5.6% and 8.9% on the lane core. Your 0.3% / 0.9% / 3.1% hold up within about a point.

@ashhart ashhart mentioned this pull request Oct 14, 2026
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 two commits landed above with the same code; this keeps the PR's head in the history with no change to the tree.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
The contributor's commits landed above with the same code, on top of ashhart#777's; this keeps the PR's head, which also holds ashhart#777's and the contributor's merge of the two CHANGELOG lines, in the history with no change to the tree.
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.

2 participants