Fix gid calculation in per_tensor_absmax_kernel (#17126)

This commit is contained in:
cctry
2026-01-15 07:21:41 -08:00
committed by GitHub
parent d11e2dc6f4
commit dda35ccbd8

View File

@@ -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) {