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
148254d4
Unverified
Commit
148254d4
authored
Jan 02, 2025
by
kk
Committed by
GitHub
Jan 02, 2025
Browse files
Improve moe reduce sum kernel performance (#2705)
Co-authored-by:
wunhuang
<
wunhuang@amd.com
>
parent
a4d6d6f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
docker/Dockerfile.rocm
docker/Dockerfile.rocm
+1
-1
python/sglang/srt/layers/moe/fused_moe_triton/fused_moe.py
python/sglang/srt/layers/moe/fused_moe_triton/fused_moe.py
+11
-5
No files found.
docker/Dockerfile.rocm
View file @
148254d4
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# docker build --build-arg SGL_BRANCH=v0.4.1.post3 -t v0.4.1.post3-rocm620 -f Dockerfile.rocm .
# docker build --build-arg SGL_BRANCH=v0.4.1.post3 -t v0.4.1.post3-rocm620 -f Dockerfile.rocm .
# default base image
# default base image
ARG BASE_IMAGE="rocm/vllm-
dev
:20241031-tuned"
ARG BASE_IMAGE="rocm
shared
/vllm-
rocm
:20241031-tuned"
FROM $BASE_IMAGE AS base
FROM $BASE_IMAGE AS base
USER root
USER root
...
...
python/sglang/srt/layers/moe/fused_moe_triton/fused_moe.py
View file @
148254d4
...
@@ -854,11 +854,17 @@ def fused_experts_impl(
...
@@ -854,11 +854,17 @@ def fused_experts_impl(
block_shape
=
block_shape
,
block_shape
=
block_shape
,
)
)
torch
.
sum
(
if
not_hip
:
intermediate_cache3
.
view
(
*
intermediate_cache3
.
shape
),
torch
.
sum
(
dim
=
1
,
intermediate_cache3
.
view
(
*
intermediate_cache3
.
shape
),
out
=
out_hidden_states
[
begin_chunk_idx
:
end_chunk_idx
],
dim
=
1
,
)
out
=
out_hidden_states
[
begin_chunk_idx
:
end_chunk_idx
],
)
else
:
ops
.
moe_sum
(
intermediate_cache3
.
view
(
*
intermediate_cache3
.
shape
),
out_hidden_states
[
begin_chunk_idx
:
end_chunk_idx
],
)
return
out_hidden_states
return
out_hidden_states
...
...
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