Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
e7b68f4d
Unverified
Commit
e7b68f4d
authored
Jan 09, 2026
by
Xin Yang
Committed by
GitHub
Jan 09, 2026
Browse files
[Bugfix] Fix Triton FusedMoE LoRA (#30585)
Signed-off-by:
Xin Yang
<
xyangx@amazon.com
>
parent
1a19e9cd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
37 deletions
+53
-37
pyproject.toml
pyproject.toml
+1
-0
tests/lora/test_gptoss_tp.py
tests/lora/test_gptoss_tp.py
+47
-34
vllm/model_executor/layers/fused_moe/gpt_oss_triton_kernels_moe.py
...l_executor/layers/fused_moe/gpt_oss_triton_kernels_moe.py
+5
-3
No files found.
pyproject.toml
View file @
e7b68f4d
...
@@ -167,6 +167,7 @@ depthwise_seperable_CNN = "depthwise_seperable_CNN"
...
@@ -167,6 +167,7 @@ depthwise_seperable_CNN = "depthwise_seperable_CNN"
[tool.typos.default.extend-words]
[tool.typos.default.extend-words]
iy
=
"iy"
iy
=
"iy"
tendencias
=
"tendencias"
tendencias
=
"tendencias"
indx
=
"indx"
# intel cpu features
# intel cpu features
tme
=
"tme"
tme
=
"tme"
dout
=
"dout"
dout
=
"dout"
...
...
tests/lora/test_gptoss_tp.py
View file @
e7b68f4d
...
@@ -69,41 +69,54 @@ def generate_and_test(llm: vllm.LLM, lora_path: str, lora_id: int) -> None:
...
@@ -69,41 +69,54 @@ def generate_and_test(llm: vllm.LLM, lora_path: str, lora_id: int) -> None:
assert
generated_texts
[
i
].
startswith
(
EXPECTED_LORA_OUTPUT
[
i
])
assert
generated_texts
[
i
].
startswith
(
EXPECTED_LORA_OUTPUT
[
i
])
def
test_gpt_oss_lora
(
gptoss20b_lora_files
):
@
pytest
.
mark
.
parametrize
(
"mxfp4_use_marlin"
,
[
True
,
False
])
llm
=
vllm
.
LLM
(
def
test_gpt_oss_lora
(
MODEL_PATH
,
monkeypatch
:
pytest
.
MonkeyPatch
,
gptoss20b_lora_files
,
mxfp4_use_marlin
max_model_len
=
1024
,
):
enable_lora
=
True
,
with
monkeypatch
.
context
()
as
m
:
max_loras
=
4
,
m
.
setenv
(
"VLLM_MXFP4_USE_MARLIN"
,
"1"
if
mxfp4_use_marlin
else
"0"
)
max_lora_rank
=
8
,
llm
=
vllm
.
LLM
(
max_num_seqs
=
2
,
MODEL_PATH
,
max_num_batched_tokens
=
2048
,
max_model_len
=
1024
,
compilation_config
=
vllm
.
config
.
CompilationConfig
(
# Avoid OOM
enable_lora
=
True
,
cudagraph_specialize_lora
=
False
,
max_loras
=
4
,
),
max_lora_rank
=
8
,
)
max_num_seqs
=
2
,
max_num_batched_tokens
=
2048
,
generate_and_test
(
llm
,
gptoss20b_lora_files
,
lora_id
=
1
)
compilation_config
=
vllm
.
config
.
CompilationConfig
(
# Avoid OOM
generate_and_test
(
llm
,
gptoss20b_lora_files
,
lora_id
=
2
)
cudagraph_specialize_lora
=
False
,
),
)
generate_and_test
(
llm
,
gptoss20b_lora_files
,
lora_id
=
1
)
generate_and_test
(
llm
,
gptoss20b_lora_files
,
lora_id
=
2
)
@
multi_gpu_test
(
num_gpus
=
2
)
@
multi_gpu_test
(
num_gpus
=
2
)
@
pytest
.
mark
.
parametrize
(
"fully_sharded_loras"
,
[
False
,
True
])
@
pytest
.
mark
.
parametrize
(
"fully_sharded_loras"
,
[
False
,
True
])
def
test_gpt_oss_lora_tp2
(
gptoss20b_lora_files
,
fully_sharded_loras
):
@
pytest
.
mark
.
parametrize
(
"mxfp4_use_marlin"
,
[
True
,
False
])
llm
=
vllm
.
LLM
(
def
test_gpt_oss_lora_tp2
(
MODEL_PATH
,
monkeypatch
:
pytest
.
MonkeyPatch
,
max_model_len
=
1024
,
gptoss20b_lora_files
,
enable_lora
=
True
,
fully_sharded_loras
,
max_loras
=
2
,
mxfp4_use_marlin
,
max_num_seqs
=
2
,
):
max_num_batched_tokens
=
2048
,
with
monkeypatch
.
context
()
as
m
:
tensor_parallel_size
=
2
,
m
.
setenv
(
"VLLM_MXFP4_USE_MARLIN"
,
"1"
if
mxfp4_use_marlin
else
"0"
)
gpu_memory_utilization
=
0.8
,
llm
=
vllm
.
LLM
(
fully_sharded_loras
=
fully_sharded_loras
,
MODEL_PATH
,
compilation_config
=
vllm
.
config
.
CompilationConfig
(
# Avoid OOM
max_model_len
=
1024
,
cudagraph_specialize_lora
=
False
,
enable_lora
=
True
,
),
max_loras
=
2
,
)
max_num_seqs
=
2
,
max_num_batched_tokens
=
2048
,
generate_and_test
(
llm
,
gptoss20b_lora_files
,
lora_id
=
1
)
tensor_parallel_size
=
2
,
generate_and_test
(
llm
,
gptoss20b_lora_files
,
lora_id
=
2
)
gpu_memory_utilization
=
0.8
,
fully_sharded_loras
=
fully_sharded_loras
,
compilation_config
=
vllm
.
config
.
CompilationConfig
(
# Avoid OOM
cudagraph_specialize_lora
=
False
,
),
)
generate_and_test
(
llm
,
gptoss20b_lora_files
,
lora_id
=
1
)
generate_and_test
(
llm
,
gptoss20b_lora_files
,
lora_id
=
2
)
vllm/model_executor/layers/fused_moe/gpt_oss_triton_kernels_moe.py
View file @
e7b68f4d
...
@@ -502,16 +502,18 @@ class UnfusedOAITritonExperts(BaseOAITritonExperts):
...
@@ -502,16 +502,18 @@ class UnfusedOAITritonExperts(BaseOAITritonExperts):
)
)
self
.
activation
(
self
.
activation
(
activation
,
intermediate_cache2
,
intermediate_cache1
.
view
(
-
1
,
N
)
activation
,
intermediate_cache2
,
intermediate_cache1
.
view
(
-
1
,
N
)[
gather_indx
.
dst_indx
],
)
)
# matmul_ogs grouped reduction fuse sum across multiple experts:
# matmul_ogs grouped reduction fuse sum across multiple experts:
# y[dst_ind // n_expts_act, :] += x
[src_ind, :]
# y[dst_ind
x
// n_expts_act, :] += x
# Need to set n_expts_act to 1 to unfuse moe_sum
# Need to set n_expts_act to 1 to unfuse moe_sum
routing_data
.
n_expts_act
=
1
routing_data
.
n_expts_act
=
1
matmul_ogs
(
matmul_ogs
(
intermediate_cache2
,
intermediate_cache2
[
gather_indx
.
src_indx
]
,
w2
,
w2
,
self
.
quant_config
.
w2_bias
,
self
.
quant_config
.
w2_bias
,
routing_data
,
routing_data
,
...
...
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