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
e885bfdc
Unverified
Commit
e885bfdc
authored
Jul 23, 2025
by
Ke Bao
Committed by
GitHub
Jul 23, 2025
Browse files
Fix sgl-kernel ci test (#8284)
parent
e2d66f60
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
sgl-kernel/tests/test_moe_fused_gate.py
sgl-kernel/tests/test_moe_fused_gate.py
+4
-4
No files found.
sgl-kernel/tests/test_moe_fused_gate.py
View file @
e885bfdc
...
@@ -10,7 +10,6 @@ from sglang.srt.layers.moe.topk import biased_grouped_topk
...
@@ -10,7 +10,6 @@ from sglang.srt.layers.moe.topk import biased_grouped_topk
list
(
range
(
1
,
10
))
list
(
range
(
1
,
10
))
+
[
16
,
32
,
64
,
128
,
256
,
512
,
1024
,
2048
,
4096
,
8192
,
16384
,
32768
,
65536
],
+
[
16
,
32
,
64
,
128
,
256
,
512
,
1024
,
2048
,
4096
,
8192
,
16384
,
32768
,
65536
],
)
)
@
pytest
.
mark
.
parametrize
(
"dtype"
,
[
torch
.
float16
,
torch
.
float32
,
torch
.
bfloat16
])
@
pytest
.
mark
.
parametrize
(
@
pytest
.
mark
.
parametrize
(
"params"
,
"params"
,
[
[
...
@@ -20,13 +19,14 @@ from sglang.srt.layers.moe.topk import biased_grouped_topk
...
@@ -20,13 +19,14 @@ from sglang.srt.layers.moe.topk import biased_grouped_topk
],
],
)
)
@
pytest
.
mark
.
parametrize
(
"num_fused_shared_experts"
,
[
0
,
1
,
2
])
@
pytest
.
mark
.
parametrize
(
"num_fused_shared_experts"
,
[
0
,
1
,
2
])
def
test_moe_fused_gate_combined
(
seq_length
,
dtype
,
params
,
num_fused_shared_experts
):
def
test_moe_fused_gate_combined
(
seq_length
,
params
,
num_fused_shared_experts
):
num_experts
,
num_expert_group
,
topk_group
,
topk
=
params
num_experts
,
num_expert_group
,
topk_group
,
topk
=
params
dtype
=
torch
.
float32
torch
.
manual_seed
(
seq_length
)
torch
.
manual_seed
(
seq_length
)
tensor
=
torch
.
rand
((
seq_length
,
num_experts
)
).
to
(
dtype
).
cuda
(
)
tensor
=
torch
.
rand
((
seq_length
,
num_experts
)
,
dtype
=
dtype
,
device
=
"
cuda
"
)
scores
=
tensor
.
clone
()
scores
=
tensor
.
clone
()
bias
=
torch
.
rand
(
num_experts
).
to
(
dtype
).
cuda
(
)
bias
=
torch
.
rand
(
num_experts
,
dtype
=
dtype
,
device
=
"
cuda
"
)
topk
=
topk
+
num_fused_shared_experts
topk
=
topk
+
num_fused_shared_experts
output
,
indices
=
moe_fused_gate
(
output
,
indices
=
moe_fused_gate
(
...
...
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