diff --git a/ggml/src/ggml-cuda/mmvq.cu b/ggml/src/ggml-cuda/mmvq.cu index 97053480980..0bd28e0275b 100644 --- a/ggml/src/ggml-cuda/mmvq.cu +++ b/ggml/src/ggml-cuda/mmvq.cu @@ -1024,6 +1024,17 @@ static void mul_mat_vec_q_switch_ncols_dst( stream); }; + // Fast-path for RDNA3 single-token vector multiplication + if (table_id == MMVQ_PARAMETERS_RDNA3_0 && !has_ids && nchannels_dst == 1) { + const std::pair dims = calc_launch_params(1, nrows_x, 1, 1, warp_size, table_id, false, false); + mul_mat_vec_q_switch_fusion( + vx, vy, ids, fusion, dst, ncols_x, nchannels_y_fd, stride_row_x, stride_col_y, stride_col_dst, + channel_ratio_fd, stride_channel_x, stride_channel_y, stride_channel_dst, sample_ratio_fd, + stride_sample_x, stride_sample_y, stride_sample_dst, dims.first, dims.second, 0, ids_stride, + stream); + break; + } + if (should_use_small_k(c_ncols_dst)) { launch(std::true_type{}, std::false_type{}); } else if (should_halve_iters()) {