ggml_ssm_conv: State-Space Convolution (Mamba)

View source: R/operations.R

ggml_ssm_convR Documentation

State-Space Convolution (Mamba)

Description

Depthwise causal convolution over a sequence, the convolution branch of a Mamba block. Each of the d_inner channels is convolved with its own d_conv-tap kernel; the leading d_conv - 1 positions of sx are the carried-over context from the previous chunk, which is what makes the op resumable across chunks.

Usage

ggml_ssm_conv(ctx, sx, c)

Arguments

ctx

GGML context

sx

Input with carried context, [d_conv - 1 + n_t, d_inner, n_s]

c

Convolution kernels, [d_conv, d_inner]

Value

A tensor [d_inner, n_t, n_s]

Shapes

sx is [d_conv - 1 + n_t, d_inner, n_s] and c is [d_conv, d_inner]; the result is [d_inner, n_t, n_s], where n_t is the number of tokens per sequence and n_s the number of sequences. All tensors are F32.

Inference only

GGML_OP_SSM_CONV has no backward pass in ggml, so a graph containing it cannot be trained – see ggml_ssm_scan.

See Also

ggml_ssm_scan

Other state-space: ggml_gated_linear_attn(), ggml_gated_linear_attn_back(), ggml_rwkv_output(), ggml_rwkv_wkv6(), ggml_rwkv_wkv6_back(), ggml_rwkv_wkv7(), ggml_rwkv_wkv7_back(), ggml_ssm_conv_back(), ggml_ssm_scan(), ggml_ssm_scan_back(), ggml_ssm_scan_output()


ggmlR documentation built on Oct. 23, 2026, 1:07 a.m.