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
14d80648
"vscode:/vscode.git/clone" did not exist on "d98433c2d171c0f3ef743d174371b0c607bc2d7f"
Unverified
Commit
14d80648
authored
Nov 03, 2025
by
Atream
Committed by
GitHub
Nov 03, 2025
Browse files
fix: Fix KTransformers hybrid inference with int8 quantization and format (#12536)
parent
ab8b83f7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
python/sglang/srt/layers/quantization/compressed_tensors/compressed_tensors_moe.py
...quantization/compressed_tensors/compressed_tensors_moe.py
+1
-0
python/sglang/srt/models/deepseek_v2.py
python/sglang/srt/models/deepseek_v2.py
+2
-4
No files found.
python/sglang/srt/layers/quantization/compressed_tensors/compressed_tensors_moe.py
View file @
14d80648
...
@@ -751,6 +751,7 @@ class CompressedTensorsWNA16AMXMoEMethod(CompressedTensorsMoEMethod):
...
@@ -751,6 +751,7 @@ class CompressedTensorsWNA16AMXMoEMethod(CompressedTensorsMoEMethod):
threadpool_count
=
self
.
threadpool_count
,
threadpool_count
=
self
.
threadpool_count
,
amx_weight_path
=
self
.
amx_weight_path
,
amx_weight_path
=
self
.
amx_weight_path
,
chunked_prefill_size
=
self
.
chunked_prefill_size
,
chunked_prefill_size
=
self
.
chunked_prefill_size
,
amx_method
=
envs
.
SGLANG_KT_AMX_METHOD
.
value
,
)
)
def
process_weights_after_loading
(
self
,
layer
:
torch
.
nn
.
Module
)
->
None
:
def
process_weights_after_loading
(
self
,
layer
:
torch
.
nn
.
Module
)
->
None
:
...
...
python/sglang/srt/models/deepseek_v2.py
View file @
14d80648
...
@@ -751,12 +751,10 @@ class DeepseekV2MoE(nn.Module):
...
@@ -751,12 +751,10 @@ class DeepseekV2MoE(nn.Module):
# router_logits: (num_tokens, n_experts)
# router_logits: (num_tokens, n_experts)
router_logits
=
self
.
gate
(
hidden_states
,
gemm_output_zero_allocator
)
router_logits
=
self
.
gate
(
hidden_states
,
gemm_output_zero_allocator
)
topk_output
=
self
.
topk
(
hidden_states
,
router_logits
)
topk_output
=
self
.
topk
(
hidden_states
,
router_logits
)
if
isinstance
(
final_hidden_states
=
self
.
experts
(
hidden_states
,
topk_output
)
if
not
_is_cuda
or
isinstance
(
self
.
experts
.
quant_method
,
CompressedTensorsWNA16AMXEPMoEMethod
self
.
experts
.
quant_method
,
CompressedTensorsWNA16AMXEPMoEMethod
):
):
topk_output
.
topk_weights
.
mul_
(
self
.
routed_scaling_factor
)
final_hidden_states
=
self
.
experts
(
hidden_states
,
topk_output
)
if
not
_is_cuda
:
final_hidden_states
*=
self
.
routed_scaling_factor
final_hidden_states
*=
self
.
routed_scaling_factor
current_stream
.
wait_stream
(
self
.
alt_stream
)
current_stream
.
wait_stream
(
self
.
alt_stream
)
...
...
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