Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
2357480b
Unverified
Commit
2357480b
authored
Sep 23, 2025
by
rivos-shreeasish
Committed by
GitHub
Sep 23, 2025
Browse files
[BugFix] Fix UB in per_token_group_quant.cu (#24913)
Signed-off-by:
Shreeasish Kumar
<
shreeasish@rivosinc.com
>
parent
f11e3c51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
csrc/quantization/fp8/per_token_group_quant.cu
csrc/quantization/fp8/per_token_group_quant.cu
+3
-3
No files found.
csrc/quantization/fp8/per_token_group_quant.cu
View file @
2357480b
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
#include "../vectorization_utils.cuh"
#include "../vectorization_utils.cuh"
#include "../../dispatch_utils.h"
#include "../../dispatch_utils.h"
__device__
__forceinline__
float
GroupReduceMax
(
float
val
,
const
int
tid
)
{
__device__
__forceinline__
float
GroupReduceMax
(
float
val
)
{
unsigned
mask
=
0
x
ffff
;
unsigned
mask
=
threadIdx
.
x
%
32
>=
16
?
0xffff0000
:
0x000
0ffff
;
val
=
fmaxf
(
val
,
__shfl_xor_sync
(
mask
,
val
,
8
));
val
=
fmaxf
(
val
,
__shfl_xor_sync
(
mask
,
val
,
8
));
val
=
fmaxf
(
val
,
__shfl_xor_sync
(
mask
,
val
,
4
));
val
=
fmaxf
(
val
,
__shfl_xor_sync
(
mask
,
val
,
4
));
...
@@ -86,7 +86,7 @@ __global__ void per_token_group_quant_8bit_kernel(
...
@@ -86,7 +86,7 @@ __global__ void per_token_group_quant_8bit_kernel(
threads_per_group
,
// stride in group
threads_per_group
,
// stride in group
scalar_op_cache
);
// scalar handler
scalar_op_cache
);
// scalar handler
local_absmax
=
GroupReduceMax
(
local_absmax
,
lane_id
);
local_absmax
=
GroupReduceMax
(
local_absmax
);
float
y_s
=
local_absmax
/
max_8bit
;
float
y_s
=
local_absmax
/
max_8bit
;
if
constexpr
(
SCALE_UE8M0
)
{
if
constexpr
(
SCALE_UE8M0
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment