Op catalog¶
Every kernel family hk.ops ships: the GPUs it runs on, what it takes, the engine routes that call it and the GPU tests that run it. Generated from python/hk/ops/catalog.py and the route table; tests/hk/ir/test_ops_catalog.py holds the catalog to the code. Signatures and docstrings: the API reference. Which routes are on, per GPU: supported hardware.
| family | entry points | what | gfx1100 | gfx1201 | gfx942 | gfx950 | dtypes | engine routes (on by default) | GPU tests |
|---|---|---|---|---|---|---|---|---|---|
| elementwise | hk.ops.addhk.ops.subhk.ops.mulhk.ops.maximumhk.ops.minimumhk.ops.exphk.ops.reluhk.ops.geluhk.ops.neghk.ops.abs |
one op an element: arithmetic and activations; register strips on gfx1100, gfx1201 and gfx950; tiles on gfx942 | yes | yes | yes | yes | bf16, fp16, fp32 (the kernels HipKittens specialises per op) | -- | test_elementwise.py, test_cdna_rows.py |
| norm | hk.ops.rmsnormhk.ops.rms_normhk.ops.fused_add_rms_normhk.ops.layernormhk.ops.softmax |
RMSNorm, the fused add + RMSNorm, LayerNorm, softmax, over the last axis | yes | yes | yes | yes | bf16, fp16, fp32 | sglang_norm (on: gfx1100)vllm_norm (on: gfx1100, gfx1201) |
test_phase2.py, test_strip.py, test_rms_norm_weighted.py |
| fused | hk.ops.silu_mulhk.ops.ropehk.ops.rotary |
SwiGLU's activation half (SiLU-and-mul) and RoPE | yes | yes | yes | yes | bf16, fp16, fp32 | -- | test_phase2.py, test_cdna_rows.py |
| quant | hk.ops.quantizehk.ops.dequantize |
dynamic per-row int8 quantization and its inverse | yes | yes | yes | yes | bf16, fp16, fp32 to int8 and back | -- | test_phase2.py, test_cdna_rows.py |
| gemm | hk.ops.matmul |
the GEMM, C = A B^T with fp32 accumulate; its gfx950 kernels are gemm_cdna and gemm_cdna_dp |
yes | yes | -- | yes | bf16 | vllm_gemm (on: gfx1100, gfx1201)sglang_linear (on: gfx1100)sgld_linear (on: gfx1100) |
test_gemm_shipped.py, test_gemm_cdna.py, test_vllm_gemm.py |
| fp8_cast | hk.ops.fp8_cast.cast_transposehk.ops.fp8_cast.swiglu_bwd_cast_transpose |
fp8 casts for training: bf16 to fp8 rowwise and transposed with amax (Transformer Engine's delayed scaling), and Megatron's SwiGLU backward fused with it; padded row strides for the GEMMs that read them | -- | yes | -- | -- | bf16 in, fp8 (e4m3, e5m2) out, fp32 amax | megatron_fc1_bwd (opt-in) |
test_fp8_cast.py |
| scaled_mm | hk.ops.scaled_mm |
an fp8 GEMM with per-tensor or per-token x per-channel scales (torch._scaled_mm's product); gfx1100 has no fp8 WMMA; gfx950's fp8 GEMMs are the MXFP8 family | -- | yes | -- | -- | fp8 (e4m3, e5m2, or a mixed pair) in, bf16 out | -- | test_scaled_mm.py |
| decode_gemm | hk.ops.decode_gemm.matmul |
the decode GEMV / skinny GEMM, M <= 64 | yes | yes | -- | yes | bf16 | vllm_gemm (on: gfx1100, gfx1201)sglang_linear (on: gfx1100) |
test_decode_gemm.py |
| w4a16 | hk.ops.w4a16.matmul |
4-bit weights (AWQ, GPTQ) against 16-bit activations | yes | yes | -- | yes | int4 weights, fp16 or bf16 activations | vllm_int4 (off)vllm_gptq (on: gfx1100, gfx1201)vllm_quark (on: gfx1201) |
test_w4a16.py |
| moe | hk.ops.moe.moe_gemmhk.ops.moe.moe_align |
the expert GEMMs of a MoE layer, on vLLM's sorted token lists | yes | yes | -- | yes | bf16 | vllm_moe (on: gfx1100, gfx1201)sglang_moe (on: gfx1100) |
test_moe.py |
| moe_w4 | hk.ops.moe.moe_gemm_w4 |
the same expert GEMM on 4-bit weights with zero points (AWQ), as vLLM's moe_wna16 holds them | yes | yes | -- | -- | 4-bit weights with per-group scales and zero points, fp16 or bf16 activations | vllm_moe_wna16 (on: gfx1100, gfx1201) |
test_moe_w4.py |
| attention | hk.ops.attention |
flash attention, forward; its gfx950 kernel is attn_cdna |
yes | yes | -- | yes | bf16 | -- | test_attn.py |
| attn_bwd | hk.ops.attn_bwd.attention |
flash attention for training: the forward with its log-sum-exp and the dQ, dK, dV backward, as one autograd function; BSHD, MHA or GQA, causal or not, head_dim 64 or 128 | yes | yes | -- | -- | bf16 | megatron_attn (opt-in) |
test_attn_bwd.py |
| sdpa | hk.ops.sdpa.scaled_dot_product_attention |
F.scaled_dot_product_attention, on hk's attention where it fits and torch's elsewhere |
yes | yes | -- | yes | bf16 (other calls fall back to torch) | vllm_sdpa (on: gfx1100)sgld_attn (on: gfx1100, gfx1201) |
test_sdpa.py |
| attn_k3 | hk.ops.attn_k3.attention |
non-causal attention at head_dim 128, the DiT kernel hk.ops.sdpa takes on gfx1100 |
yes | -- | -- | -- | bf16 | sdpa_k3 (on: gfx1100)sgld_attn (on: gfx1100, gfx1201) |
test_attn_k3.py |
| paged | hk.ops.paged.split_kernelhk.ops.paged.fused_kernelhk.ops.paged.merge_kernelhk.ops.paged.plan_splitshk.ops.paged.merge_splits |
decode attention over a paged KV cache: the split walk and its merge; its gfx950 kernel is paged_cdna |
yes | yes | -- | yes | bf16 | vllm_backend (opt-in) |
test_paged.py, test_paged_fused.py |
| paged_prefill | hk.ops.paged_prefill.kernel_forhk.ops.paged_prefill.work_list |
prefill attention over a paged KV cache (chunked, causal) | yes | yes | -- | yes | bf16 | vllm_prefill (on: gfx1100, gfx1201) |
test_paged_prefill.py |
| hipkittens | hk.ops.hipkittens.gemm_bf16hk.ops.hipkittens.gqa_fwd |
HipKittens' own CDNA4 kernels as hk ops: the bf16 GEMM and GQA attention; a candidate in vLLM's gfx950 linear table, whose route is off by default there | -- | -- | -- | yes | bf16 | -- | test_hipkittens.py |
| mxfp8 | hk.ops.mxfp8.gemmhk.ops.mxfp8.quant |
the block-scaled MXFP8 GEMM and the activation quant (DeepSeek-V4.1) | -- | -- | -- | yes | MXFP8 (fp8 e4m3 with E8M0 scales) in, bf16 out | vllm_mxfp8 (on: gfx950) |
test_mxfp8_gemm.py, test_mxfp8_quant.py |
| moe_a8w4 | hk.ops.moe_a8w4.stage1_sortedhk.ops.moe_a8w4.stage2_sorted |
the a8w4 MoE: FP8 activations against MXFP4 expert weights (DeepSeek-V4.1) | -- | -- | -- | yes | fp8 activations, MXFP4 weights, bf16 out | vllm_moe_a8w4 (on: gfx950) |
test_moe_a8w4.py |
| sparse_mla | hk.ops.sparse_mla.prefillhk.ops.sparse_mla.prefill_mxfp8 |
DeepSeek-V4.1's sparse MLA prefill attention | -- | -- | -- | yes | bf16; MXFP8 output rows | vllm_sparse_mla (on: gfx950) |
test_sparse_mla.py |
| dsv41_index | hk.ops.dsv41_index.index_kernel |
DeepSeek-V4.1's index chain for a decode step, one resident launch | -- | -- | -- | yes | bf16 activations; MXFP8 (qr, wq_b) and MXFP4 (q, K cache) inside the chain | vllm_dsv41_index (on: gfx950) |
test_vllm_dsv41_index.py |
| convrot | hk.ops.convrot.linear |
ConvRot W8A8 linear: a rotated int8 GEMM | yes | -- | -- | -- | bf16 in, int8 W8A8, bf16 out | sgld_convrot (opt-in) |
test_convrot.py |
| rotary_pairs | hk.ops.fused.rotary_pairshk.ops.fused.rmsnorm_rotary_pairs |
RoPE on interleaved pairs, the complex form (Qwen-Image 2.1's view_as_complex(x) * rope), bit for bit torch's on RDNA |
yes | yes | -- | yes | bf16; fp32 cos / sin | sgld_rope (on: gfx1100, gfx1201)sgld_qknorm (on: gfx1100) |
test_route_paths.py |
| dit_norm | hk.ops.norm.layernorm_scale_shift |
a DiT block's norm in one launch: the gated residual, LayerNorm (optionally affine) and the scale and shift (SGLang-Diffusion's (ScaleResidual)LayerNormScaleShift) | yes | yes | -- | yes | bf16 activations; fp32 or bf16 vectors; bf16 or fp32 outputs | sgld_ditnorm (on: gfx1100) |
test_route_paths.py |
| conv3d | hk.ops.conv3d.as_conv2dhk.ops.conv3d.frames |
a conv3d as one conv2d over its time taps stacked on the channels, or as calls of 2 output frames, the engine's own convs: no hk kernel; it keeps MIOpen off its naive reference conv3d and its im2col. The routes also run a causal single frame as a conv2d with the last time tap (sgld_h3vae) and a kernel == stride patch embedding as one F.linear (sgld_patchembed) | yes | yes | -- | -- | any the engine's conv takes (bf16 measured) | sgld_vaeconv (on: gfx1100, gfx1201)sgld_h3vae (opt-in)sgld_patchembed (opt-in) |
test_route_paths.py |
A family that runs on a GPU has a kernel there and is run by CI's GPU tier where it has a runner for that GPU; gfx942 builds only (no part was available). A route marked off is off by default; its switch turns it on without the validation (integration).