Skip to content

vllm.model_executor.layers.mamba.ops.hip_gdn_chunk

Gated delta net prefill on RDNA3.5, as a single HIP kernel.

Replaces the cumsum, WY transform, state recurrence and output kernels with one launch of torch.ops._rocm_C.rdna35_gdn_chunked.

Functions:

chunk_gdn_hip_fwd(q, k, v, g, beta, scale, initial_state, cu_seqlens, core_attn_out=None)

Run the gated delta rule and return (output, final_state).

g is the raw per-token log decay; the kernel takes the cumsum itself, so this must be called before any chunk-local cumsum.

is_hip_gdn_available() cached

Whether the op is in this build and the device can run it.

The device test is the RDNA3.5 family rather than a broader question such as "is this Navi": gfx1100, gfx1103 and gfx12xx would answer yes, and the kernel's wave32 block layout does not hold on them.

is_hip_gdn_supported(query, value, cu_seqlens)

Whether chunk_gdn_hip_fwd can serve this call.

Mirrors every shape and dtype the kernel asserts on, so an unsupported call falls back to the Triton kernels instead of raising.