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
9b8333d9
Unverified
Commit
9b8333d9
authored
Mar 17, 2025
by
yiakwy-xpu-ml-framework-team
Committed by
GitHub
Mar 16, 2025
Browse files
[ROCm] enable moe topk softmax in amd (#4448)
parent
f5bbf603
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
sgl-kernel/csrc/torch_extension_rocm.cc
sgl-kernel/csrc/torch_extension_rocm.cc
+4
-0
sgl-kernel/setup_rocm.py
sgl-kernel/setup_rocm.py
+1
-0
No files found.
sgl-kernel/csrc/torch_extension_rocm.cc
View file @
9b8333d9
...
...
@@ -61,6 +61,10 @@ TORCH_LIBRARY_EXPAND(sgl_kernel, m) {
"moe_align_block_size(Tensor topk_ids, int num_experts, int block_size, Tensor! sorted_token_ids, Tensor! "
"experts_ids, Tensor! num_tokens_post_pad, Tensor! token_cnts_buffer, Tensor! cumsum_buffer) -> ()"
);
m
.
impl
(
"moe_align_block_size"
,
torch
::
kCUDA
,
&
moe_align_block_size
);
m
.
def
(
"topk_softmax(Tensor! topk_weights, Tensor! topk_indices, Tensor! "
"token_expert_indices, Tensor gating_output) -> ()"
);
m
.
impl
(
"topk_softmax"
,
torch
::
kCUDA
,
&
topk_softmax
);
}
REGISTER_EXTENSION
(
common_ops
)
sgl-kernel/setup_rocm.py
View file @
9b8333d9
...
...
@@ -41,6 +41,7 @@ include_dirs = [
sources
=
[
"csrc/allreduce/custom_all_reduce.hip"
,
"csrc/moe/moe_align_kernel.cu"
,
"csrc/moe/moe_topk_softmax_kernels.cu"
,
"csrc/torch_extension_rocm.cc"
,
]
...
...
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