The dive · Kernels
The sm_89 hot paths
One card's kernels, taken one at a time, each checked bit for bit before it counts.
Halocline's decode runs on fused kernels written for one architecture. This page follows the kernels that brought Qwen4-35B-A3B onto those paths: what each one changed, what proves it changed nothing else, and which shapes and types each fused kernel takes, read from the source lines that decide it.
- Hyper-connection read5.88%
- Heads and draft vocabulary15.61%
- Both26.86%
- Parity checks7
One kernel at a time
The same engine, pack (UD-Q6_K_XL), flags and fixtures; each arm adds one change, so each step's gain belongs to that kernel. Gains are on the conversation fixture against the first arm.
| Arm | What it adds | Draft vocabulary | Conversation | Structured | Prose |
|---|---|---|---|---|---|
| main | nothing: the A3B on the generic hyper-connection read and head | no | 176.0eval | 212.4eval | 161.5eval |
| hc read | the fused hyper-connection read (hc_read_ada) at n_embd 2048, rank 256 | no | 186.3eval | 232.2eval | 179.0eval |
| heads | the Q8_0 bit-plane verify head and the 2-bit draft proxy at width 2048, with --draft-vocab n32768 | yes | 203.4eval | 249.6eval | 195.8eval |
| all | both, merged | yes | 223.2eval | 273.3eval | 205.2eval |
The Qwen4-35B-A3B pack carries no draft vocabulary, so the drafter scored every row of the head on every draft step until the vocabulary option reached this model. The head arm's gain is mostly that.
Where the time goes
The mean time of one verify pass by the number of tokens it checks (the first token pays the whole pass, each token after it costs the slope), then the whole window with its draft step, on the conversation fixture.
| Arm | Verify, one token | Two | Three | Whole window, draft and verify | Tokens a window |
|---|---|---|---|---|---|
| main | 6.7 mseval | 8.6 mseval | 10.3 mseval | 11.4 mseval | 2.02eval |
| hc read | 6.2 mseval | 7.8 mseval | 9.4 mseval | 10.7 mseval | 2.00eval |
| heads | 6.7 mseval | 8.5 mseval | 10.2 mseval | 9.8 mseval | 2.01eval |
| all | 6.1 mseval | 7.7 mseval | 9.3 mseval | 9.0 mseval | 2.02eval |
The hyper-connection read takes time off every window, because every layer reads twice per token. The head change barely moves the verify pass and leaves the tokens per window where they were; it cuts the draft step, which no longer scores the whole head, so the whole window gets shorter.
Parity before speed
A kernel counts only when its output matches the code it replaces. Each test runs at both shapes the engine serves.
| Test | Shape | Result |
|---|---|---|
| hc_read_ada_parity 3 | n_embd 2560, rank 320 | bitwiseeval |
| hc_read_ada_parity 3 --a3b | n_embd 2048, rank 256 | bitwiseeval |
| q80_vhead_parity 248320 3 | head width 2560 | OKeval |
| q80_vhead_parity 248320 3 --a3b | head width 2048 | OKeval |
| q80_proxy_parity 100000 200 | head width 2560 | OKeval |
| q80_proxy_parity 100000 200 --a3b | head width 2048 | OKeval |
| hc8_up_b16_parity | both widths | passeval |
The fused hyper-connection read runs 128eval blocks of 512eval threads, one per multiprocessor, with 51,200eval bytes of shared memory for the shortest windows. Its parity test compares it with the three kernels it replaces at every window size and finds no differing byte.
Which kernel takes what
Each fact below is the source line that decides it, so the page changes when the code does.
| Kernel | Takes |
|---|---|
| Fused mid-layer chain (GDN layers) | projection type ids 8, 8, 8 or 14, 14, 14 (all eight-bit or all six-bit K-quant); any other mix runs the unfused sequence |
| Grouped expert glue | expert width 640 only; other widths run the device-planned tail without it |
| Expert tail, six-bit down projection | gate/up and down pairs X(12, 14) X(13, 14) X(14, 14) |
| Dense tensor-core projection | integer tensor cores, m16n8k32.row.col.s32.s8.s8.s32 |
| The BF16 tensor-core option | m16n8k16.row.col.f32.bf16.bf16.f32, after rounding the activations |
The mid chain's type rule is why UD-Q8_K_XL, whose projections are all BF16, runs its GDN layers unfused today. A BF16 chain on full-precision activations is the open kernel for that tier.
The BF16 product
Window time by token count for the six-bit tier, the eight-bit tier on its default product, and the eight-bit tier on tensor cores.
| Arm | One token | Two | Three |
|---|---|---|---|
| UD-Q6_K_XL | 6.1 mseval | 7.7 mseval | 9.3 mseval |
| UD-Q8_K_XL | 8.3 mseval | 10.4 mseval | 12.3 mseval |
| UD-Q8_K_XL, tensor cores | 10.6 mseval | 12.3 mseval | 14.0 mseval |
The eight-bit tier's extra time at one token is its BF16 weights' bytes, read once per pass. The tensor-core product adds time at every window size: these products wait on memory, so rounding the activations buys nothing here.