MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / ggml_ssm_conv

Function ggml_ssm_conv

subprojects/llama.cpp/ggml/src/ggml.c:5405–5429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5403// ggml_ssm_conv
5404
5405struct ggml_tensor * ggml_ssm_conv(
5406 struct ggml_context * ctx,
5407 struct ggml_tensor * sx,
5408 struct ggml_tensor * c) {
5409 GGML_ASSERT(ggml_is_3d(sx));
5410 GGML_ASSERT(ggml_is_matrix(c));
5411
5412 const int64_t d_conv = c->ne[0];
5413 const int64_t d_inner = c->ne[1];
5414 const int64_t n_t = sx->ne[0] - d_conv + 1; // tokens per sequence
5415 const int64_t n_s = sx->ne[2];
5416
5417 // TODO: maybe support other strides than 1?
5418 GGML_ASSERT(sx->ne[0] == d_conv - 1 + n_t);
5419 GGML_ASSERT(sx->ne[1] == d_inner);
5420 GGML_ASSERT(n_t >= 0);
5421
5422 struct ggml_tensor * result = ggml_new_tensor_3d(ctx, GGML_TYPE_F32, d_inner, n_t, n_s);
5423
5424 result->op = GGML_OP_SSM_CONV;
5425 result->src[0] = sx;
5426 result->src[1] = c;
5427
5428 return result;
5429}
5430
5431// ggml_ssm_scan
5432

Callers 9

buildMethod · 0.85
weight_buft_supportedFunction · 0.85
build_shortconv_blockMethod · 0.85
build_mamba_layerMethod · 0.85
build_mamba2_layerMethod · 0.85
build_graphMethod · 0.85
ggml_vk_check_results_0Function · 0.85

Calls 3

ggml_is_3dFunction · 0.85
ggml_is_matrixFunction · 0.85
ggml_new_tensor_3dFunction · 0.85

Tested by 1

build_graphMethod · 0.68