Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
92823069
Unverified
Commit
92823069
authored
Apr 09, 2025
by
kk
Committed by
GitHub
Apr 09, 2025
Browse files
Fix ci test "test_eval_fp8_accuracy" failed (#5185)
Co-authored-by:
wunhuang
<
wunhuang@amd.com
>
parent
d2e507df
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
python/sglang/srt/layers/quantization/fp8_utils.py
python/sglang/srt/layers/quantization/fp8_utils.py
+13
-3
No files found.
python/sglang/srt/layers/quantization/fp8_utils.py
View file @
92823069
...
@@ -243,8 +243,18 @@ def apply_fp8_linear(
...
@@ -243,8 +243,18 @@ def apply_fp8_linear(
if
_is_cuda
:
if
_is_cuda
:
qinput
,
x_scale
=
sglang_per_token_quant_fp8
(
input_2d
)
qinput
,
x_scale
=
sglang_per_token_quant_fp8
(
input_2d
)
else
:
else
:
# TODO(kkhuang): temporarily enforce per-tensor activation scaling if weight is per-tensor scaling
# final solution should be: 1. add support to per-tensor activation scaling.
# 2. solve the torch.compile error from weight_scale.numel() == 1 and x_scale.numel() > 1 (below line#308)
if
_is_hip
and
weight_scale
.
numel
()
==
1
:
qinput
,
x_scale
=
ops
.
scaled_fp8_quant
(
qinput
,
x_scale
=
ops
.
scaled_fp8_quant
(
input_2d
,
input_scale
,
use_per_token_if_dynamic
=
use_per_token_if_dynamic
input_2d
,
input_scale
,
use_per_token_if_dynamic
=
use_per_token_if_dynamic
,
)
else
:
qinput
,
x_scale
=
per_token_group_quant_fp8
(
input_2d
,
group_size
=
input_2d
.
shape
[
1
]
)
)
if
cutlass_fp8_supported
:
if
cutlass_fp8_supported
:
...
...
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