Skip to content

vllm.model_executor.layers.mamba.ops.cpu.gdn_attention

Functions:

_conv_buffer_view(layer)

Return the conv-state cache as (num_slots, dim, state_len).

_spec_aware_nonspec(layer, attn_metadata_i, mixed_qkv, b, a, core_attn_out, conv_buf, ssm_state, width)

Non-spec prefill/decode with a wide conv buffer.

_spec_aware_nonspec_subset(layer, attn_metadata_i, mixed_qkv, b, a, conv_buf, ssm_state, width)

Process non-spec (prefill) tokens that coexist with spec sequences.

Returns outputs ordered like non_spec_token_indx.

_spec_forward(layer, attn_metadata_i, mixed_qkv_spec, b_spec, a_spec, conv_buf, ssm_state, width, state_len)

Run the GDN core for the multi-query (speculative) tokens.

Returns the core attention output for the spec tokens, in the same token order as mixed_qkv_spec (i.e. ordered by spec_query_start_loc).

_unpacked_conv_weight(layer)

Return the plain (dim, width) conv weight.

On AMX and aarch64+bf16 the conv1d weight is packed in place at load time, so the torch spec-decode path relies on the un-packed copy stashed by dispatch_cpu_unquantized_gemm.

cpu_gdn_attention_core(mixed_qkv, b, a, core_attn_out, layer_name)

CPU custom op for the core GDN attention computation.