diff --git a/ggml/src/ggml-sycl/ssm_conv.cpp b/ggml/src/ggml-sycl/ssm_conv.cpp index e55223586..3eafa1a68 100644 --- a/ggml/src/ggml-sycl/ssm_conv.cpp +++ b/ggml/src/ggml-sycl/ssm_conv.cpp @@ -36,9 +36,13 @@ static void kernel_ssm_conv( return; } - const int channel = static_cast(idx % d_inner); - const int token = static_cast((idx / d_inner) % n_t); - const int seq = static_cast(idx / (static_cast(d_inner) * static_cast(n_t))); + // src has the tokens of one channel contiguous, dst has the channels of one + // token contiguous, so either the loads or the store must be strided. Indexing + // token-fastest coalesces the d_conv loads, which measured faster except for + // short, cache-resident rows. + const int token = static_cast(idx % n_t); + const int channel = static_cast((idx / n_t) % d_inner); + const int seq = static_cast(idx / (static_cast(n_t) * static_cast(d_inner))); const float *s = src_data + static_cast(seq) * static_cast(src_stride_seq)