Skip to content

Inkling 2: fuse the dynamic conv tail, depth mix and MoE expert scale - #133

Merged
rafasmour merged 2 commits into
masterfrom
inkling/upstream-opt
Nov 22, 2026
Merged

rafasmour merged 2 commits into
masterfrom
inkling/upstream-opt

Conversation

@rafasmour

Copy link
Copy Markdown
Owner

Follow-up to #132: the remaining Inkling 2 optimizations.

  • CUDA fused kernels: dynamic conv tail (transpose + per-lag mul/add + residual + scale, from the conv input directly), depth mix (rms_norm + scores + softmax + weighted sum, one block per token), MoE per-expert weight scale (repeat + get_rows + mul)
  • element-wise fusions (add+scale, tanh gate, conv tail, expert scale) may now write in place over an input they read at the same index; before, the graph allocator's in-place reuse made the memory check reject them in the model
  • inkling2: dynamic taps ordered before the conv tail; the dense rel-pos bias fallback (backends without the indexed bias) builds its single-pass mask in F16 without the two casts
  • test-backend-ops: DYN_CONV_TAIL, DEPTH_MIX, MOE_EXPERT_SCALE

RX 7900 XT, Inkling-2-Mini UD-Q3_K_XL, llama-bench fa on f16 KV: tg128 37.9 -> 43.3 t/s (31.0 before #132), pp512 1135 -> 1274 t/s; decode kernels per token 5219 -> 3664 (6986 before #132).
KL divergence vs the build before #132: 0.0025 (noise floor 0.0023); -nkvo dense F16 fallback 0.0027. test-backend-ops ROCm0 vs CPU: all six fusion groups pass.

Assisted-by: Claude Opus 5.5

…scale; in-place element-wise fusions

Assisted-by: Claude Opus 5.5
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