Skip to content

nemotron: a job's first message carries one row, so a decode step sends one message, not 16 rows of padding - #1000

Closed
easthambuilds wants to merge 1 commit into
ashhart:mainfrom
easthambuilds:nemotron-small-rows-1
Closed

easthambuilds wants to merge 1 commit into
ashhart:mainfrom
easthambuilds:nemotron-small-rows-1

Conversation

@easthambuilds

Copy link
Copy Markdown
Contributor

What

cuda_worker.zig small_rows goes from 16 to 1. A Super TP=2 decode step sends each of its 40 MoE layers a job of one
row, but the first message was sized for 16: 165,440 bytes, of which a one-row job uses 10,560. Now the first message is
those 10,560 bytes, and longer jobs (drafted verification, prefill) still send their rest in a second message as before.
No arithmetic changes; the unit test's expected firstBytes is updated.

Measurements

Two GB10s (DGX Spark), direct RoCE cable, both port halves in NCCL_IB_HCA, Super VL NVFP4 at
82d93699acd3be9e4617c53360fe5b3f5dbeb1b3, 256 tokens, greedy, ignore_eos, thinking off. Speeds are from v1.0.12 builds that differ only in small_rows; the checks below ran on this branch.

tok/s small_rows 16 (as shipped) small_rows 1 TP=1
story, drafted 35.3 35.8 31.9
code, drafted 55.9 55.9 48.5
facts, drafted 45.8 46.5 41.6
"draft": false 18.9 20.1 18.8
  • Undrafted decode goes from TP=1 speed to 6% faster. Drafted moves within run-to-run noise (about ±0.5 tok/s).
  • A message round trip for a one-row job, measured alone: 150 µs (one port half) and 101 µs (two) as sent today,
    against 52 µs for the data-only message.
  • small_rows = 4 drafts a little faster (36.4 / 56.7 / 47.2) but runs undrafted at 19.7. I chose 1 because it is the
    exact decode case. Glad to switch if you prefer to favour drafting.
  • Token hashes: story 5f2e0da2c8f5, code 72e8663b2089, facts a351deaea63f, the same at TP=1, at TP=2 as shipped, and with this
    branch, drafted and serial.
  • Concurrency at TP=2: 2 and 4 concurrent greedy streams (story, code, facts, math) give their solo token hashes.

Checks

  • zig build test test-golden: pass (golden 309/319 equal, 0 unexpected differences).
  • tools/zig/lean_check.py: 517, the same as main.
  • No GPU kernel changes, so the kernel contract does not apply.

Measured as part of #981 (its TP=2 comment has the ping-pong details).

🤖 Generated with Claude Code

…ds one message, not 16 rows of padding

At TP=2 a Super decode step sends each MoE layer a job of one row, but the
first message was sized for 16 rows: 165,440 bytes, of which a one-row job
uses 10,560. With small_rows = 1 the first message is those 10,560 bytes,
and longer jobs still send their rest in a second message. Arithmetic is
unchanged: drafted, serial and concurrent replies keep their token hashes.

@cwschroeder cwschroeder left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source review at 76a0d8b0, with Astra checking the sender, follower and startup paths: no material finding in this one-file change.

Both sides use the same first/long-message sizing helpers. The tested 22/1024/4096 shape reduces the one-row first message from 165,440 to 10,560 bytes. Rows 2 through 16 now use the existing second-message path, as larger verification and prompt jobs already do. Allocations and section alignment remain sufficient, the end command uses the same shortened first message, and executable fingerprints reject mixed builds before jobs start.

Locally, Zig 0.17.0 passes zig build test-cuda-host -j2 --summary all: 39/39 steps, 850 tests passed and two skipped, including the updated sizing test. Whole-tree zig fmt --check build.zig zig and whitespace checks pass. No GPU or transport session was opened. There are no published current-head CI checks yet, so this is a source/host review rather than a complete preflight.

For the performance receipt, could you add the exact source revisions and native binary SHA256s for the two measured v1.0.12 variants, with the per-run rows behind the table in #981? The PR already separates those release measurements from branch validation; those pins would make that link reproducible. I have not independently reproduced the reported throughput gain.

ashhart pushed a commit that referenced this pull request Oct 18, 2026
…ds one message, not 16 rows of padding (#1000)

At TP=2 a Super decode step sends each MoE layer a job of one row, but the
first message was sized for 16 rows: 165,440 bytes, of which a one-row job
uses 10,560. With small_rows = 1 the first message is those 10,560 bytes,
and longer jobs still send their rest in a second message. Arithmetic is
unchanged: drafted, serial and concurrent replies keep their token hashes.
ashhart added a commit that referenced this pull request Oct 18, 2026
@ashhart

ashhart commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Thank you, @tovereast, for the one-row packet change and its before/after transport measurements.

We merged the increment for 1.1.0 in 10ff877. The tested first message shrinks from 165,440 to 10,560 bytes; longer verification and prompt jobs retain the second-message protocol. Arithmetic is unchanged.

This addresses one packet cost from #981; TP=3/4 remains separate work.

Two NVIDIA GB10s: Super VL TP=2 passed 17/17 and cache-off chat 12/12, matching previous-build tokens.

Posted by Ash's AI Assistant Synthena

@easthambuilds

Copy link
Copy Markdown
Contributor Author

Thanks @ashhart. Confirmed: 10ff8779 on main carries this change, and it shipped in v1.1.0. Closing, since it was merged that way.

@easthambuilds
easthambuilds deleted the nemotron-small-rows-1 branch October 18, 2026 17:35
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
…ds one message, not 16 rows of padding (ashhart#1000)

At TP=2 a Super decode step sends each MoE layer a job of one row, but the
first message was sized for 16 rows: 165,440 bytes, of which a one-row job
uses 10,560. With small_rows = 1 the first message is those 10,560 bytes,
and longer jobs still send their rest in a second message. Arithmetic is
unchanged: drafted, serial and concurrent replies keep their token hashes.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
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.

3 participants