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
c069086b
Unverified
Commit
c069086b
authored
Nov 27, 2025
by
Jee Jee Li
Committed by
GitHub
Nov 26, 2025
Browse files
[Bugfix] Fix getting device for MoE LoRA (#29475)
Signed-off-by:
Jee Jee Li
<
pandaleefree@gmail.com
>
parent
11ea5ec1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
vllm/lora/layers/fused_moe.py
vllm/lora/layers/fused_moe.py
+3
-1
vllm/lora/layers/utils.py
vllm/lora/layers/utils.py
+9
-0
No files found.
vllm/lora/layers/fused_moe.py
View file @
c069086b
...
...
@@ -30,6 +30,8 @@ from vllm.model_executor.layers.fused_moe.fused_moe_modular_method import (
FusedMoEModularMethod
,
)
from
.utils
import
_get_lora_device
class
FusedMoEWithLoRA
(
BaseLayerWithLoRA
):
def
__init__
(
self
,
base_layer
:
FusedMoE
)
->
None
:
...
...
@@ -41,7 +43,7 @@ class FusedMoEWithLoRA(BaseLayerWithLoRA):
)
self
.
tp_size
=
get_tensor_model_parallel_world_size
()
self
.
tp_rank
=
get_tensor_model_parallel_rank
()
self
.
device
=
base_layer
.
w2_weight
.
device
self
.
device
=
_get_lora_device
(
base_layer
)
self
.
_w13_slices
=
2
self
.
_inject_lora_into_fused_moe
()
...
...
vllm/lora/layers/utils.py
View file @
c069086b
...
...
@@ -33,6 +33,15 @@ def _get_lora_device(base_layer: nn.Module) -> torch.device:
# HQQ marlin
elif
hasattr
(
base_layer
,
"W_q"
):
return
base_layer
.
W_q
.
device
# MoE layer
elif
hasattr
(
base_layer
,
"w2_weight"
):
return
base_layer
.
w2_weight
.
device
# MoE Compressed Tensor
elif
hasattr
(
base_layer
,
"w2_weight_packed"
):
return
base_layer
.
w2_weight_packed
.
device
# MoE GPTQ/AWQ/GGUF
elif
hasattr
(
base_layer
,
"w2_qweight"
):
return
base_layer
.
w2_qweight
.
device
else
:
raise
ValueError
(
f
"Unsupported base layer:
{
base_layer
}
"
)
...
...
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