From dda35ccbd85c35cdfc96ecd3b3d89fad272f4c83 Mon Sep 17 00:00:00 2001 From: cctry Date: Thu, 15 Jan 2026 07:21:41 -0800 Subject: [PATCH] Fix gid calculation in per_tensor_absmax_kernel (#17126) --- python/sglang/jit_kernel/csrc/gemm/per_tensor_quant_fp8.cuh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sglang/jit_kernel/csrc/gemm/per_tensor_quant_fp8.cuh b/python/sglang/jit_kernel/csrc/gemm/per_tensor_quant_fp8.cuh index 344648ffc..17c5de888 100644 --- a/python/sglang/jit_kernel/csrc/gemm/per_tensor_quant_fp8.cuh +++ b/python/sglang/jit_kernel/csrc/gemm/per_tensor_quant_fp8.cuh @@ -23,7 +23,7 @@ per_tensor_absmax_kernel(const T* __restrict__ input, float* __restrict__ output using namespace device; constexpr uint32_t VEC_SIZE = 16 / sizeof(T); - const int64_t gid = blockIdx.x * gridDim.x + threadIdx.x; + const int64_t gid = blockIdx.x * blockDim.x + threadIdx.x; float max_value = 0.0f; if (gid * VEC_SIZE + VEC_SIZE <= num_elements) {