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
2f427491
"examples/multigpu/vscode:/vscode.git/clone" did not exist on "1b5c02c16cfd10e84e6b5d2c9f1f11094d82d620"
Unverified
Commit
2f427491
authored
May 23, 2025
by
Li Hui
Committed by
GitHub
May 23, 2025
Browse files
Fix topk inference performance reduce (#6474)
parent
d8189660
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
python/sglang/srt/layers/moe/topk.py
python/sglang/srt/layers/moe/topk.py
+2
-0
No files found.
python/sglang/srt/layers/moe/topk.py
View file @
2f427491
...
@@ -264,6 +264,8 @@ def biased_grouped_topk(
...
@@ -264,6 +264,8 @@ def biased_grouped_topk(
# TODO merge into kernel for this branch
# TODO merge into kernel for this branch
topk_ids
=
topk_ids_logical_to_physical
(
topk_ids
,
expert_location_dispatch_info
)
topk_ids
=
topk_ids_logical_to_physical
(
topk_ids
,
expert_location_dispatch_info
)
# TODO will fuse this into kernel, thus use slow manual operation now
# TODO will fuse this into kernel, thus use slow manual operation now
if
num_token_non_padded
is
None
:
return
topk_weights
,
topk_ids
torch
.
compile
(
torch
.
compile
(
_mask_topk_ids_padded_region
,
dynamic
=
True
,
backend
=
get_compiler_backend
()
_mask_topk_ids_padded_region
,
dynamic
=
True
,
backend
=
get_compiler_backend
()
)(
topk_ids
,
num_token_non_padded
)
)(
topk_ids
,
num_token_non_padded
)
...
...
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