metal : fix SSM_SCAN pipeline scope

This commit is contained in:
Francis Couture-Harpin 2024-10-02 10:41:10 -04:00
parent 2c77d799f9
commit 87b97d08f4

View File

@ -1693,11 +1693,13 @@ static void ggml_metal_encode_node(
const int64_t n_seq_tokens = ne11; const int64_t n_seq_tokens = ne11;
const int64_t n_seqs = ne13; const int64_t n_seqs = ne13;
id<MTLComputePipelineState> pipeline = nil;
if (ne30 == 1) { if (ne30 == 1) {
// Mamba-2 // Mamba-2
id<MTLComputePipelineState> pipeline = ctx->kernels[GGML_METAL_KERNEL_TYPE_SSM_SCAN_F32_GROUP].pipeline; pipeline = ctx->kernels[GGML_METAL_KERNEL_TYPE_SSM_SCAN_F32_GROUP].pipeline;
} else { } else {
id<MTLComputePipelineState> pipeline = ctx->kernels[GGML_METAL_KERNEL_TYPE_SSM_SCAN_F32].pipeline; pipeline = ctx->kernels[GGML_METAL_KERNEL_TYPE_SSM_SCAN_F32].pipeline;
} }
[encoder setComputePipelineState:pipeline]; [encoder setComputePipelineState:pipeline];