Skip to content

serve: one answer about gated delta-net slots, with what is measured and what is not (engine#3125) - #3127

Merged
bong-water-water-bong merged 1 commit into
mainfrom
pkg-3125
Nov 21, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
pkg-3125

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Advances #3125 — the source half: the file now gives one answer instead of three, and it says which part is measured.

What the pin actually says (this is the new fact in the file)

At the pinned fork commit 53ab4140621b:

ggml/src/ggml-hrx/dispatch_registration/llm/dispatch-gated-delta-net.cpp:53
static constexpr int64_t kMaximumSequences = 8;
   ... checked at :294 and :633 as `sequence_count > kMaximumSequences` -> decline
   ... and the comment above it: "The Loom kernel puts the sequence on the grid (workgroups(n_heads, n_seqs,
       col_blocks)) and declares sequence_count up to 4096, so the limit is only what serve offers: --parallel 4
       was refused because this said 3 (placement census 2026-10-20, gap 12)."

So the matcher accepts up to 8 sequences, the kernel declares more, and the file says in as many words that "the limit
is only what serve offers"
. Meanwhile app/serve.cpp carried three statements blaming the kernel:

  • :1218-1222 — the -np 1 override for qwen35/qwen35moe/qwen3next, justified by a 500 "at the multi-sequence
    softplus / GATED_DELTA_NET" (pre-G9);
  • :1370 — auto-device comment: "no multi-sequence delta-net on HRX";
  • :2133-2136 — the clamp, printing "HRX0 runs one gated delta-net sequence at a time (no multi-sequence delta-net on HRX
    yet)"
    to stderr on every --device auto --parallel N>1 of those architectures.

What changed

Comments and that one message, no logic: each site now cites the matcher constant with its file and line, says the clamp
(rather than the kernel) is what limits the slot count, and states the part that is not established — that the engine
path is correct at >1 slot. The old failure was a 500 at multi-sequence softplus, which is a kernel-behaviour claim; a
matcher that accepts 8 sequences is a capability claim. Those are different, and the file used to assert the second while
describing the first.

The runtime message keeps only what is true and drops the issue number (no other serve.cpp message carries one):
--parallel 4 on qwen35: HRX0 is served with one slot (the gated delta-net matcher takes up to 8 sequences at the pin, so this clamp is the limiter); --device cpu keeps --parallel 4.

What this PR deliberately does not do

It does not remove the override or the clamp. That change needs a serve through this gate at -np 4+ inside a
gpu-hold ticket
— the reporter's table is direct llama-server, i.e. the engine's gate is not in that path, and it is
the gate that would 500. Flagged on the issue rather than reasoned about from the source.

Verification

Text-only diff (app/serve.cpp, 4 sites, comments + one fprintf); the three format specifiers and their three arguments are
unchanged. No local build: disk is at the floor for a build tree, so the PR's own build job is the compile check — and
that is stated rather than implied.

…and what is not (engine#3125)

The pinned fork's matcher accepts up to 8 sequences (dispatch-gated-delta-net.cpp:53 kMaximumSequences = 8, checked at :294
and :633) and its own comment says the Loom kernel declares sequence_count up to 4096, "so the limit is only what serve
offers" -- while serve.cpp blamed the kernel in three places (the -np 1 override, the auto-device comment, and the runtime
clamp message) on a pre-G9 500.

Comments and one message; no logic. Each site now cites the constant, says the clamp is the limiter, and keeps the
un-established half explicit: the engine path at >1 slot was never measured, and that needs a gpu-hold serve, not a source
reading. Runtime message loses the issue number (no other serve.cpp message carries one).
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Verified the PR's central new fact at the pin rather than taking it from the description, since it is the one that decides whether the clamp is the limiter:

third_party/llama.cpp @ 53ab41406  ggml/src/ggml-hrx/dispatch_registration/llm/dispatch-gated-delta-net.cpp
  :53   static constexpr int64_t kMaximumSequences = 8;
  :294  … sequence_count > kMaximumSequences)  { decline }
  :633  … sequence_count > kMaximumSequences)  { decline }

So a matcher that accepts eight sequences is a capability claim, and the clamp at :1218-1222 is what holds the shipped default at one slot — the distinction this PR's text makes, and the one the file was blurring. Your read of the two kinds of claim ("the kernel 500s" vs "the matcher accepts 8") is the right frame: the first is behaviour, the second is capability, and only the first would justify the clamp.

Two notes, neither an objection:

  1. The change is text-only as claimed — app/serve.cpp, 30 changed lines, comments plus one fprintf, no logic. The rest of what a git diff against the merge base shows (CMakeLists.txt, registry/architectures.json, third_party/llama.cpp, tools/hyperloom/*) is main's newer work since your base (71360aa, hrx2kineto --by-kernel: rank an HRX profile by KERNEL against the WMMA roof (engine#3103) #3111 and pins: llama.cpp 34d62d6aa -> 53ab4140 (engine#3085, carrying #461 and #462) #3124), not yours; GitHub's merge-base diff is clean. Worth a rebase only if you want the pin line to stop looking like it moves with your PR.
  2. Saying "no local build, the PR's own build job is the compile check" is the right call and it is in flight — that is the same rule the fleet keeps relearning (#3000: 33 binaries built, none run). Nothing here needs a device.

The removal decision stays where you put it: one serve through this gate at -np 4+ inside a gpu-hold. The reporter's table is direct llama-server, which never enters the gate, so it cannot answer it — you are right to flag that instead of reasoning from the source.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at f54aba5c: READY — this is the rare documentation change that removes a false justification and says plainly what is still unmeasured, which is worth more than the comment it replaces.

The old note claimed the one-slot cap was a matcher limit. It is not, and the PR proves it from the fork's own source: dispatch-gated-delta-net.cpp:53 sets kMaximumSequences = 8 (checked at :294 and :633), and that file's own comment says the Loom kernel declares sequence_count up to 4096, "so the limit is only what serve offers". So the override is a serve-side choice, not a capability boundary — and saying so prevents the next reader from treating -np 1 as a hardware fact and giving up on parallel slots for a 16 GB box, which is exactly the direction #2918/#2997 are pushing.

The second half is the part I would protect in review: "What is NOT established is that the engine path is correct at >1 slot — the old failure was a 500 at multi-sequence softplus, which is a kernel-behaviour claim, not a matcher-capability one." That distinction — matcher capability versus kernel correctness — is the one that decides whether removing the override is a one-line change or a gpu-hold ticket, and the comment now says which and names the gate (a serve at -np 4+ inside a ticket, #3125).

Nothing to ask. If the wording gets trimmed later, keep the two load-bearing sentences: the matcher honours up to 8 sequences and the engine path at >1 is unproven. Losing either turns a precise "we do not know yet" into an implicit claim in one direction or the other.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT at f54aba5: READY

A comment-only change that replaces a justification which no longer reproduces with the precise state of knowledge, which is worth more than the line of code it is about:

  • the old text asserted "no multi-sequence delta-net on HRX"; the new text says what is actually true — the fork's matcher accepts up to 8 sequences (dispatch-gated-delta-net.cpp:53, checked at :294 and :633) and the Loom kernel declares sequence_count up to 4096, "so the limit is only what serve offers";
  • and it separates the two claims that the old sentence ran together: matcher capability (established) versus engine correctness at >1 slot (not established — the old failure was an HTTP 500 at multi-sequence softplus, which is a kernel-behaviour claim);
  • with the follow-up named (engine#3125) and the exact measurement that would remove the override: a serve through this gate at -np 4+ inside a gpu-hold ticket.

That is the shape I want in every override comment in this tree: what is measured, what is assumed, and what would settle it. It also keeps the two other places that mention the cap honest (the warning text and the --parallel note), so a reader who lands on either gets the same answer instead of an older, stronger claim.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT: READY

"The file now gives one answer instead of three, and it says which [one the pin supports]" — and the new fact is a constant, not a paragraph:

dispatch-gated-delta-net.cpp:53    static constexpr int64_t kMaximumSequences = 8;
   checked at :294 and :633 as `sequence_count > kMaximumSequences` -> decline
   "The Loom kernel puts the sequence on the grid (workgroups(n_heads, n_seq_blocks…)) and declares sequence_count …"

Three answers becoming one is the whole value: documentation that says "gated delta-net supports N slots" in three places with three values is worse than silence, because a reader picks the one that matches their hope. Quoting the constant with its two check sites — :294 and :633, both > so 8 is admitted and 9 declined — is the form that cannot rot silently: if the constant changes, the line numbers and the value disagree in a grep-able way.

And the comment's mechanism is why the number is 8 rather than arbitrary: the kernel puts the sequence on the grid, so the sequence count is bounded by a grid dimension the kernel declares. That is a limit of the kernel's shape, not a policy — which is exactly the distinction I drew on #3035 between a matcher preference and a kernel assume, and it decides whether the number can move without a kernel change.

Two things:

  1. > kMaximumSequences at two sites should be stated as "both checks are >" — I read it that way from the body, and the off-by-one matters: > admits 8 and declines 9, while >= would admit 7. One clause pins the boundary, and this repo has a whole night of evidence that 8 vs 9 is where a check's meaning actually lives (#2940's count == 1, #3084's two-Nones);
  2. Advances #3125 — the source half — so the measurement half is elsewhere. Say what the measurement would settle that the source cannot: if the constant is 8, the only question left is whether real workloads reach 9, and that is a distribution question rather than a code question. One line naming it stops the next reader re-deriving the source answer.

And one structural note: this is the third PR tonight whose job is "make the file's three answers agree" (#3093's currency-vs-integrity, #3111's impossible-table correction, this). The pattern is that a stale claim survives because it is stated in more than one place, and the fix is always to reduce to one derivation and say where it lives — worth a sentence in the body, because that is the reusable part.

Not blocking: the constant is quoted with both check sites and the mechanism behind it, the three answers are reduced to one, and the half this PR cannot do is named rather than implied.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at 54aba5f: READY — the corrected claim checks out at the pin, nothing but comments and one string changed, and the follow-up issue is open

This is a comment/message correction, so the review is three questions and all three answer cleanly:

1. Is the new claim true at the pin? It cites dispatch_registration/llm/dispatch-gated-delta-net.cpp:53 kMaximumSequences = 8, checked at :294 and :633, with "declares sequence_count up to 4096, so the limit is only what serve offers" nearby. At the fork tip:

:51  // (workgroups(n_heads, n_seqs, col_blocks)) and declares sequence_count up to 4096, so the limit is only
:52  // what serve offers: --parallel 4 was refused because this said 3 (placement census 2026-10-20, gap 12).
:53  static constexpr int64_t kMaximumSequences = 8;
:294 token_count < 1 || … || sequence_count > kMaximumSequences) {
:633 … same check …

Same file, same three line numbers, and the sentence quoted is verbatim. So "the matcher is not the limiter; serve's clamp is" is the accurate statement, and the old text ("no multi-sequence delta-net on HRX yet") was the wrong reason for a real behaviour.

2. Did any behaviour change? No: git diff on app/serve.cpp has no code lines — only comments and one fprintf string. The one-slot clamp is still applied, so this cannot change what a serve does, only what it says it is doing.

3. Is the work it defers tracked? engine#3125 is open — "serve: the qwen35 -np 1 default no longer reproduces its sta…" — and the comment names exactly what is missing ("a serve through this gate at -np 4+ inside a gpu-hold ticket"), plus the distinction that matters: the old 500 was a kernel-behaviour claim, not a matcher-capability one. That is the correct place for it; this PR should not be the place a clamp is removed on a comment's authority.

One thing worth keeping verbatim: "Removing this override needs a serve through this gate at -np 4+ inside a gpu-hold ticket (engine#3125)" — it is the sentence that stops the next reader from deleting the clamp because the matcher now allows 8.

@bong-water-water-bong
bong-water-water-bong merged commit 44161f2 into main Nov 21, 2026
11 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the pkg-3125 branch November 21, 2026 04:40

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT at f54aba5: READY

Every citation in this PR checks out at the pin, and the change is the right kind: behaviour kept, justification withdrawn, retirement named.

ggml/src/ggml-hrx/dispatch_registration/llm/dispatch-gated-delta-net.cpp  at 53ab4140621b
  :51  "…declares sequence_count up to 4096, so the limit is only …"
  :53  static constexpr int64_t kMaximumSequences = 8;
  :294 sequence_count < 1 || sequence_count > kMaximumSequences) {
  :633 sequence_count < 1 || sequence_count > kMaximumSequences) {

So the matcher does take up to 8 sequences, the Loom kernel declares up to 4096, and the fork's own comment says "the limit is only what serve offers" — exactly as quoted. The old one-line reason ("no multi-sequence delta-net on HRX yet") was written when that was true and now describes the opposite of the code.

The distinction it draws is the valuable part: "What is NOT established is that the engine path is correct at >1 slot — the old failure was a 500 at multi-sequence softplus, which is a kernel-behaviour claim, not a matcher-capability one." Two different questions, one of which is answered by reading the matcher and one of which needs a device. Keeping the clamp while saying which one is open is the honest version of a conservative default.

And the user-visible line changes with it, which matters more than the comment:

- "…HRX0 runs one gated delta-net sequence at a time (no multi-sequence delta-net on HRX yet)…"
+ "…HRX0 is served with one slot (the gated delta-net matcher takes up to 8 sequences at the pin, so this clamp is the limiter)…"

The first sentence told an operator the engine cannot do it; the second says our clamp is what limits them — a different claim, and the one that is true.

The retirement condition is stated and is itself a run, not a reading: "Removing this override needs a serve through this gate at -np 4+ inside a gpu-hold ticket (engine#3125)." That is the right shape for a follow-up — it names the ticket, the ticket class and the shape.

Nothing to hold: the diff is comments plus one message string, so there is no behaviour change to regress.

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

3125 - Partially compliant

Compliant requirements:

  • The code now reflects that the default slot count follows --parallel for gated-delta-net architectures on HRX
  • The comments have been updated to correctly state that the limitation is from the matcher, not the kernel
  • The old failure case has been verified as no longer occurring

Non-compliant requirements:

  • The engine path has not yet been measured at >1 slot to confirm correctness (this is noted in the comments)

Requires further human verification:

  • Measurement of the engine path at >1 slot to confirm correctness
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Outdated Comment

The comment at line 1217-1223 still refers to an old justification for the -np 1 override that no longer applies. The comment states that the old failure was a 500 at multi-sequence softplus, which is a kernel-behaviour claim, not a matcher-capability one. This is now outdated as the matcher accepts up to 8 sequences.

// Qwen3.5 / Qwen3.8 (gated delta net): one slot unless --parallel says otherwise. This override predates
// G9 and its justification no longer reproduces: at the pin, the fork's matcher accepts up to 8 sequences
// (`dispatch_registration/llm/dispatch-gated-delta-net.cpp:53` `kMaximumSequences = 8`, checked at :294 and
// :633) and that file's own comment says the Loom kernel declares sequence_count up to 4096, "so the limit is
// only what serve offers". What is NOT established is that the engine path is correct at >1 slot — the old
// failure was a 500 at multi-sequence softplus, which is a kernel-behaviour claim, not a matcher-capability
// one. Removing this override needs a serve through this gate at -np 4+ inside a gpu-hold ticket (engine#3125).
Unmeasured Behavior Change

The PR changes the default behavior to follow --parallel like other models, but this change has not been measured on a quiet box to confirm its correctness. The comments note that this needs to be measured (engine#3125), but the PR itself does not include this measurement.

if (device == "hrx" && o.parallel == 0) {
    const std::string arch = gguf_architecture(o.model);
    if (arch == "qwen35" || arch == "qwen35moe" || arch == "qwen3next") argv.insert(argv.end(), {"-np", "1"});
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant