Skip to content

vllm.model_executor.layers.mamba.ops.gdn_prefill_conv

Fused GDN prefill causal conv1d + post-conv prep (csrc/mamba/gdn_prefill_conv.cu).

Covers bf16, head dim 128, width-4 conv without bias, and SiLU; callers fall back to causal_conv1d_fn + fused_post_conv_prep otherwise.

Functions:

gdn_prefill_conv(x, weight, conv_states, query_start_loc, cache_indices, has_initial_state, a, b, A_log, dt_bias, num_k_heads, head_dim, output_g_exp=False, beta_scale=1.0, null_block_id=NULL_BLOCK_ID)

SiLU causal conv of x (tokens, [Q | K | V]), then the post-conv prep.

Updates conv_states in place. Returns q, k (tokens, H, D), v (tokens, HV, D), and fp32 g, beta (tokens, HV).

gdn_prefill_conv_supported(x, weight, conv_states, head_k_dim, head_v_dim)

Whether the kernel covers these tensors. Bias and activation are checked by the caller.