Skip to content

Commit 87b97d0

Browse files
committed
metal : fix SSM_SCAN pipeline scope
1 parent 2c77d79 commit 87b97d0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ggml/src/ggml-metal.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,11 +1693,13 @@ static void ggml_metal_encode_node(
16931693
const int64_t n_seq_tokens = ne11;
16941694
const int64_t n_seqs = ne13;
16951695

1696+
id<MTLComputePipelineState> pipeline = nil;
1697+
16961698
if (ne30 == 1) {
16971699
// Mamba-2
1698-
id<MTLComputePipelineState> pipeline = ctx->kernels[GGML_METAL_KERNEL_TYPE_SSM_SCAN_F32_GROUP].pipeline;
1700+
pipeline = ctx->kernels[GGML_METAL_KERNEL_TYPE_SSM_SCAN_F32_GROUP].pipeline;
16991701
} else {
1700-
id<MTLComputePipelineState> pipeline = ctx->kernels[GGML_METAL_KERNEL_TYPE_SSM_SCAN_F32].pipeline;
1702+
pipeline = ctx->kernels[GGML_METAL_KERNEL_TYPE_SSM_SCAN_F32].pipeline;
17011703
}
17021704

17031705
[encoder setComputePipelineState:pipeline];

0 commit comments

Comments
 (0)