From afe1ea463aa8ecc9f7496a956795f160b8365c51 Mon Sep 17 00:00:00 2001 From: GuanhuaWang Date: Mon, 26 Sep 2022 18:23:20 +0000 Subject: [PATCH 1/2] format --- csrc/transformer/inference/csrc/dequantize.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csrc/transformer/inference/csrc/dequantize.cu b/csrc/transformer/inference/csrc/dequantize.cu index 3843c2b6ea8b..ad4fcc50f6f7 100644 --- a/csrc/transformer/inference/csrc/dequantize.cu +++ b/csrc/transformer/inference/csrc/dequantize.cu @@ -173,7 +173,7 @@ void launch_dequantize(T* output, unsigned thd_cnt = (hidden_dim - 1) / threads + 1; hid_cnt = hid_cnt > 0 ? hid_cnt : 1; - unsigned blocks = output_size / hid_cnt / groups; + unsigned blocks = roundf((output_size + hid_cnt * groups - 1) / (hid_cnt * groups)); dim3 block_dims(threads); dim3 grid_dims(groups, blocks); From 9740b4de26fb600030caa09ba6590448ab760356 Mon Sep 17 00:00:00 2001 From: GuanhuaWang Date: Mon, 26 Sep 2022 18:26:01 +0000 Subject: [PATCH 2/2] remove round fn --- csrc/transformer/inference/csrc/dequantize.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csrc/transformer/inference/csrc/dequantize.cu b/csrc/transformer/inference/csrc/dequantize.cu index ad4fcc50f6f7..959016bf10e3 100644 --- a/csrc/transformer/inference/csrc/dequantize.cu +++ b/csrc/transformer/inference/csrc/dequantize.cu @@ -173,7 +173,7 @@ void launch_dequantize(T* output, unsigned thd_cnt = (hidden_dim - 1) / threads + 1; hid_cnt = hid_cnt > 0 ? hid_cnt : 1; - unsigned blocks = roundf((output_size + hid_cnt * groups - 1) / (hid_cnt * groups)); + unsigned blocks = (output_size + hid_cnt * groups - 1) / (hid_cnt * groups); dim3 block_dims(threads); dim3 grid_dims(groups, blocks);