Skip to content

hrx: say so when DISABLE_DISPATCH=fused means the category, not the substring (engine#2146) - #326

Merged
bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
pi-i679/dispatch-fused-warns
Nov 12, 2026
Merged

bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
pi-i679/dispatch-fused-warns

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

What

GGML_HRX_DISABLE_DISPATCH looks like a comma-separated substring filter, and for every value it is one -- except the bare word fused, which the registry special-cases:

if ((p == "fused" && registration.kind == DispatchMatchKind::Fused) || name.find(p) != std::string::npos)
    return true;

So GGML_HRX_DISABLE_DISPATCH=fused disables every registration whose kind is DispatchMatchKind::Fused -- 74 registrations at this pin, across dispatch-mul-mat (17), dispatch-routed-ffn (6), dispatch-rmsnorm (6), dispatch-gated-mul-mat (5), dispatch-gated-delta-net (4) and the qwen files -- not the handful of registration names that contain the word fused (there are two).

That difference is invisible from the command line, and its symptom is not a failure:

Measured (engine#2146), LFM2.5-1.2B, -c 512, greedy, one fresh server per launch, llama.cpp's own logprob/top_logprobs:

default DISABLE_DISPATCH=fused
completion at the Royal Court Theatre at secondary riv riv ch
first divergence — token 1, 1.81 in log probability (~6x)

No node failure, no error, just a different and incoherent answer -- so an A/B taken with the category form looks exactly like a kernel defect. It was read that way twice before the registry code was consulted, which is why this is worth one fprintf rather than a comment in the source nobody reads.

The change

One announcement, at parse time (the lambda runs once per process), naming the form that does A/B a single kernel:

hrx: GGML_HRX_DISABLE_DISPATCH=fused disables EVERY registration whose kind is
DispatchMatchKind::Fused, not the names containing "fused" (engine#2146). That is a
configuration no test covers and it can change the answer without failing a node; to A/B
one kernel, name that registration instead, as hip/README.md documents.

The comment above dispatch_disabled gets the same correction, since the previous one said "'fused' skips every fused registration", which is true and does not tell a reader that the meaning changes from substring to category.

Not changed: the behaviour. Disabling the category is a deliberate debug facility and someone may rely on it; the defect being fixed here is that it does not say what it is doing. If you would rather it refuse outright, the fprintf is the place to put the return out; that keeps the category and drops a warning-free path -- I picked warn because a refusal would break the existing usage silently in the other direction.

Verification: g++-16 -fsyntax-only -std=c++17 over the translation unit with the tree's own include paths, clean. No behaviour change to compile or run beyond the one line on stderr when the variable contains fused.

…ubstring (engine#2146)

GGML_HRX_DISABLE_DISPATCH looks like a substring filter and behaves like one for every value
except the bare word fused, which is special-cased to skip EVERY registration whose kind is
DispatchMatchKind::Fused -- 74 registrations at this pin, across mul_mat, routed ffn, rmsnorm,
gated mul_mat, gated delta net and the qwen files.

That is invisible from the command line: the switch reads exactly like the per-registration form
hip/README.md documents, and its effect is not a node failure but a different answer. Measured on
LFM2.5-1.2B at -c 512 with a fresh server per launch: '=fused' turned a coherent completion
(' at the Royal Court Theatre') into fragments (' at secondary riv riv ch') with no error, and the
first divergence was 1.81 in log probability -- which reads as a kernel defect. It was read that
way, twice, before the registry code was consulted.

Announce it once, at parse time, and name the form that does A/B one kernel.
@bong-water-water-bong

Copy link
Copy Markdown
Author

VERDICT: READY at 7b9d8e8 — the special case is real and large (74 registrations), and saying so is the minimum fix; the better one is a name that cannot be misread.

A filter whose semantics change for one value

GGML_HRX_DISABLE_DISPATCH looks like a substring filter and behaves like one for every value
except the bare word `fused`, which is special-cased to skip EVERY registration whose kind is
DispatchMatchKind::Fused -- 74 registrations at this pin, across mul_mat, routed ffn, rmsnorm,
gated mul_mat, gated delta net and the qwen files.

That is a 74× amplification hiding behind a word that reads like a kernel name. Someone debugging one fused kernel passes fused=bake (substring, correct) or fused (every fused kernel gone) and gets the same variable behaving with two different meanings — the exact shape of trap that costs an afternoon and produces a confident wrong conclusion in the meantime.

Two asks, in increasing order of what I would want

  1. the message is the minimum: emit one line when the special case engages — DISABLE_DISPATCH=fused: disabling all 74 Fused-kind registrations (not a substring match); use a substring to target one — because a reader of the log can then see what happened without reading the source;
  2. the better fix is a name that cannot be misread — GGML_HRX_DISABLE_DISPATCH_KIND=fused as a separate variable, leaving DISABLE_DISPATCH a pure substring filter. Then the two behaviours cannot be confused, the counting is explicit, and the existing value keeps working if you accept it as a deprecated alias. If that is a wider change than this PR should carry, the message plus a line in the docs is a reasonable stopping point — but the docs line matters as much as the message, because the person who types fused is reading docs, not logs, at the moment they decide.

Why this belongs with tonight's other instrumentation work

The same family as ggml-org#2230 (GGML_HRX_LOG_DISPATCH is not behaviour-neutral), ggml-org#2256 (--help answered with silence) and ggml-org#2232 (UNKNOWN as its own bucket): an instrument whose name promises one thing and delivers another. Each was fixed by making the real behaviour nameable, and each time the number attached to the surprise (2.3×, five tools, 74 registrations) is what made it worth fixing.

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