Commit 6fb428332 for llama.cpp
commit 6fb428332ecef16ac82c4e8cf961ac287bb3217b
Author: Plasmatix Ultra <stevenrichardbarnett@gmail.com>
Date: Tue Nov 24 03:38:47 2026 -0800
CUDA: NVFP4 dequant, pack 8 blocks per CTA (#32875)
Launch dequantize_block_nvfp4 with dim3(32, 8) so each CTA covers 8 NVFP4 blocks (256 values), as the K-quants do.
Assisted-by: Claude Code
Co-authored-by: plasmatixultra <plasmatixultra@users.noreply.github.com>
diff --git a/ggml/src/ggml-cuda/convert.cu b/ggml/src/ggml-cuda/convert.cu
index a8f5047a2..601c63232 100644
--- a/ggml/src/ggml-cuda/convert.cu
+++ b/ggml/src/ggml-cuda/convert.cu
@@ -385,7 +385,7 @@ static __global__ void dequantize_block_nvfp4(
const void * __restrict__ vx,
dst_t * __restrict__ yy,
const int64_t ne) {
- const int64_t i = blockIdx.x;
+ const int64_t i = (int64_t) blockIdx.x*blockDim.y + threadIdx.y;
const int tid = threadIdx.x;
const int64_t base = i * QK_NVFP4;
@@ -417,7 +417,7 @@ static void dequantize_row_nvfp4_cuda(
cudaStream_t stream) {
GGML_ASSERT(k % QK_NVFP4 == 0);
const int nb = k / QK_NVFP4;
- dequantize_block_nvfp4<<<nb, 32, 0, stream>>>(vx, y, k);
+ dequantize_block_nvfp4<<<(nb + 7)/8, dim3(32, 8), 0, stream>>>(vx, y, k);
}
template <typename src_t, typename dst_t>
static __global__ void convert_unary(