Skip to content

vllm.model_executor.layers.mamba.ops.gdn_chunk_cutedsl

Modules:

Functions:

chunk_gated_delta_rule_cutedsl(q, k, v, g, beta, initial_state, cu_seqlens, chunk_indices, chunk_offsets, core_attn_out=None)

Run the GDN chunk CuteDSL prefill kernels.

Parameters:

  • q

    (Tensor) –

    Query tensor with shape [1, T, H, K].

  • k

    (Tensor) –

    Key tensor with shape [1, T, H, K].

  • v

    (Tensor) –

    Value tensor with shape [1, T, Hv, V].

  • g

    (Tensor) –

    Log-space decay tensor with shape [1, T, Hv].

  • beta

    (Tensor) –

    Delta-rule beta tensor with shape [1, T, Hv].

  • initial_state

    (Tensor) –

    Recurrent state with shape [N, Hv, V, K].

  • cu_seqlens

    (Tensor) –

    Cumulative sequence lengths with shape [N + 1].

  • chunk_indices

    (Tensor) –

    Chunk index metadata with shape [NT, 2].

  • chunk_offsets

    (Tensor) –

    Cumulative chunk offsets with shape [N + 1].

  • core_attn_out

    (Tensor | None, default: None ) –

    Optional output buffer with shape [T, Hv, V].

Returns:

  • Tensor –

    A tuple (output, final_state) where output has shape

  • Tensor –

    [1, T, Hv, V] and final_state has shape [N, Hv, V, K].

  • tuple[Tensor, Tensor] –

    When core_attn_out is provided, output is an unsqueezed view of

  • tuple[Tensor, Tensor] –

    that buffer.