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
12f2e6c3
"vscode:/vscode.git/clone" did not exist on "aed161e63f02233b56aaff8ef54c670d71f938da"
Unverified
Commit
12f2e6c3
authored
Mar 04, 2025
by
Xihuai Wang
Committed by
GitHub
Mar 03, 2025
Browse files
Fix: #3988 using blockwise_int8 (#4023)
parent
95575aa7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
python/sglang/srt/layers/quantization/blockwise_int8.py
python/sglang/srt/layers/quantization/blockwise_int8.py
+4
-1
No files found.
python/sglang/srt/layers/quantization/blockwise_int8.py
View file @
12f2e6c3
...
@@ -371,6 +371,8 @@ class BlockInt8MoEMethod:
...
@@ -371,6 +371,8 @@ class BlockInt8MoEMethod:
custom_routing_function
:
Optional
[
Callable
]
=
None
,
custom_routing_function
:
Optional
[
Callable
]
=
None
,
correction_bias
:
Optional
[
torch
.
Tensor
]
=
None
,
correction_bias
:
Optional
[
torch
.
Tensor
]
=
None
,
activation
:
str
=
"silu"
,
activation
:
str
=
"silu"
,
inplace
:
bool
=
True
,
no_combine
:
bool
=
False
,
)
->
torch
.
Tensor
:
)
->
torch
.
Tensor
:
from
sglang.srt.layers.moe.fused_moe_triton.fused_moe
import
fused_experts
from
sglang.srt.layers.moe.fused_moe_triton.fused_moe
import
fused_experts
from
sglang.srt.layers.moe.topk
import
select_experts
from
sglang.srt.layers.moe.topk
import
select_experts
...
@@ -395,7 +397,7 @@ class BlockInt8MoEMethod:
...
@@ -395,7 +397,7 @@ class BlockInt8MoEMethod:
layer
.
w2_weight
,
layer
.
w2_weight
,
topk_weights
=
topk_weights
,
topk_weights
=
topk_weights
,
topk_ids
=
topk_ids
,
topk_ids
=
topk_ids
,
inplace
=
Tru
e
,
inplace
=
inplac
e
,
activation
=
activation
,
activation
=
activation
,
use_int8_w8a8
=
True
,
use_int8_w8a8
=
True
,
w1_scale
=
(
layer
.
w13_weight_scale_inv
),
w1_scale
=
(
layer
.
w13_weight_scale_inv
),
...
@@ -403,4 +405,5 @@ class BlockInt8MoEMethod:
...
@@ -403,4 +405,5 @@ class BlockInt8MoEMethod:
a1_scale
=
layer
.
w13_input_scale
,
a1_scale
=
layer
.
w13_input_scale
,
a2_scale
=
layer
.
w2_input_scale
,
a2_scale
=
layer
.
w2_input_scale
,
block_shape
=
self
.
quant_config
.
weight_block_size
,
block_shape
=
self
.
quant_config
.
weight_block_size
,
no_combine
=
no_combine
,
)
)
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