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
e952eee6
Unverified
Commit
e952eee6
authored
Sep 30, 2025
by
Zhewen Li
Committed by
GitHub
Sep 30, 2025
Browse files
[Bugfix] Fix `__syncwarp` on ROCM (#25996)
parent
66bca9b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
csrc/cache_kernels.cu
csrc/cache_kernels.cu
+5
-1
No files found.
csrc/cache_kernels.cu
View file @
e952eee6
...
@@ -536,7 +536,9 @@ __global__ void indexer_k_quant_and_cache_kernel(
...
@@ -536,7 +536,9 @@ __global__ void indexer_k_quant_and_cache_kernel(
for
(
int
i
=
0
;
i
<
VEC_SIZE
;
i
++
)
{
for
(
int
i
=
0
;
i
<
VEC_SIZE
;
i
++
)
{
amax
=
fmaxf
(
amax
,
fabsf
(
float
(
k_val_ptr
[
i
])));
amax
=
fmaxf
(
amax
,
fabsf
(
float
(
k_val_ptr
[
i
])));
}
}
#ifndef USE_ROCM
__syncwarp
();
__syncwarp
();
#endif
// Reduced amax
// Reduced amax
for
(
int
mask
=
16
;
mask
>
0
;
mask
/=
2
)
{
for
(
int
mask
=
16
;
mask
>
0
;
mask
/=
2
)
{
...
@@ -546,7 +548,9 @@ __global__ void indexer_k_quant_and_cache_kernel(
...
@@ -546,7 +548,9 @@ __global__ void indexer_k_quant_and_cache_kernel(
amax
=
fmaxf
(
amax
,
__shfl_xor_sync
(
unsigned
(
-
1
),
amax
,
mask
));
amax
=
fmaxf
(
amax
,
__shfl_xor_sync
(
unsigned
(
-
1
),
amax
,
mask
));
#endif
#endif
}
}
#ifndef USE_ROCM
__syncwarp
();
__syncwarp
();
#endif
float
scale
=
fmaxf
(
amax
,
1e-4
)
/
448.0
f
;
float
scale
=
fmaxf
(
amax
,
1e-4
)
/
448.0
f
;
if
(
use_ue8m0
)
{
if
(
use_ue8m0
)
{
scale
=
exp2f
(
ceilf
(
log2f
(
scale
)));
scale
=
exp2f
(
ceilf
(
log2f
(
scale
)));
...
@@ -1167,4 +1171,4 @@ void indexer_k_quant_and_cache(
...
@@ -1167,4 +1171,4 @@ void indexer_k_quant_and_cache(
DISPATCH_BY_KV_CACHE_DTYPE
(
k
.
dtype
(),
"fp8_e4m3"
,
DISPATCH_BY_KV_CACHE_DTYPE
(
k
.
dtype
(),
"fp8_e4m3"
,
CALL_INDEXER_K_QUANT_AND_CACHE
);
CALL_INDEXER_K_QUANT_AND_CACHE
);
}
}
\ No newline at end of file
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