Skip to content

hrx: kquant matchers skip q8-only inputs; softplus kernel - #48

Merged
bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
1bit/hrx-kquant-ready
Sep 30, 2026
Merged

bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
1bit/hrx-kquant-ready

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

Two fixes found while making llama-server --parallel run on HRX.

1. Crash on Qwen3-Coder-30B-A3B's first request (dispatch-kquant-decode.cpp)

The K-quant projection kernels read F32 inputs. But qwen3_moe's fused "routed down + next-layer norm" kernel publishes the next layer's input only as a Q8_1 alternate. It never writes the F32 value when its consumers read the alternate.

With qwen.attention disabled, Coder-30B failed its first request with reads transient value 86 before write: command 14, the kquant projection, read a value nothing wrote.

The matchers now decline an input when:

  • it has a Q8_1 alternate, or
  • its producer isn't claimed yet (a later-rooted fusion will produce it).

Single-stream decode is unchanged: Coder-30B 90.4, Qwen3.8-27B 12.17 tok/s.

2. Softplus (ops/softplus_f32.loom + dispatch-softplus.cpp, extra.softplus_f32, UNARY priority 1)

  • Contiguous F32 softplus, as ggml's CPU backend defines it: x > 20 ? x : log(1 + exp(x)).
  • common.unary_f32 leaves SoftPlus out. So a standalone softplus (the Qwen3.5/3.8 delta-net gate in multi-sequence batches) was claimed by HRX and then failed as an unsupported node.
  • A check.case against an overflow-safe reference passes under the access sanitizer.
  • test-backend-ops -o SOFTPLUS -b HRX0: the F32 contiguous cases pass; the rest are still declined, as before.

Still missing

Multi-sequence batches of the delta-net models (qwen35, qwen35moe, qwen3next) still stop at GATED_DELTA_NET, which has no multi-sequence kernel on HRX yet.

🤖 Generated with Claude Code

Found while making llama-server --parallel run on HRX.

- dispatch-kquant-decode.cpp: the K-quant projection kernels read F32
  inputs, but qwen3_moe's fused routed-down + next-layer norm publishes the
  next input only as a Q8_1 alternate and never writes the F32 value when its
  consumers read the alternate. With qwen.attention off, Qwen3-Coder-30B-A3B
  failed its first request ("reads transient value 86 before write", command
  14 = kquant GEMV). The matchers now decline inputs that have a Q8_1
  alternate, and inputs whose producer is not yet claimed (a later-rooted
  fusion). Single-stream decode unchanged: Coder-30B 90.4, Qwen3.8-27B 12.17
  tok/s.
- ops/softplus_f32.loom + dispatch-softplus.cpp (extra.softplus_f32, UNARY
  prio 1): contiguous F32 softplus as ggml defines it (x > 20 ? x :
  log(1 + exp(x))); common.unary_f32 leaves SoftPlus out, so a standalone
  softplus (Qwen3.5/3.8 delta-net gate in multi-sequence batches) was
  claimed by HRX and then failed as an unsupported node. check.case against
  an overflow-safe reference passes (access sanitizer); test-backend-ops -o
  SOFTPLUS -b HRX0: F32 contiguous cases OK, others still declined.

Multi-sequence batches of those hybrid models still stop at GATED_DELTA_NET
(no multi-sequence kernel on HRX).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the ggml label Sep 30, 2026
@bong-water-water-bong
bong-water-water-bong merged commit acf9c74 into 1bit/hrx-vulkan-patched Sep 30, 2026
10 of 24 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/hrx-kquant-ready branch November 12, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant