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
18ae428a
Unverified
Commit
18ae428a
authored
Sep 19, 2024
by
Amit Garg
Committed by
GitHub
Sep 20, 2024
Browse files
[Bugfix] Fix Phi3.5 mini and MoE LoRA inference (#8571)
parent
de6f90a1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
vllm/model_executor/models/__init__.py
vllm/model_executor/models/__init__.py
+1
-1
vllm/model_executor/models/phi3.py
vllm/model_executor/models/phi3.py
+17
-0
vllm/model_executor/models/phimoe.py
vllm/model_executor/models/phimoe.py
+4
-0
No files found.
vllm/model_executor/models/__init__.py
View file @
18ae428a
...
@@ -50,7 +50,7 @@ _GENERATION_MODELS = {
...
@@ -50,7 +50,7 @@ _GENERATION_MODELS = {
"OrionForCausalLM"
:
(
"orion"
,
"OrionForCausalLM"
),
"OrionForCausalLM"
:
(
"orion"
,
"OrionForCausalLM"
),
"PersimmonForCausalLM"
:
(
"persimmon"
,
"PersimmonForCausalLM"
),
"PersimmonForCausalLM"
:
(
"persimmon"
,
"PersimmonForCausalLM"
),
"PhiForCausalLM"
:
(
"phi"
,
"PhiForCausalLM"
),
"PhiForCausalLM"
:
(
"phi"
,
"PhiForCausalLM"
),
"Phi3ForCausalLM"
:
(
"
llama"
,
"Llama
ForCausalLM"
),
"Phi3ForCausalLM"
:
(
"
phi3"
,
"Phi3
ForCausalLM"
),
"PhiMoEForCausalLM"
:
(
"phimoe"
,
"PhiMoEForCausalLM"
),
"PhiMoEForCausalLM"
:
(
"phimoe"
,
"PhiMoEForCausalLM"
),
"Qwen2ForCausalLM"
:
(
"qwen2"
,
"Qwen2ForCausalLM"
),
"Qwen2ForCausalLM"
:
(
"qwen2"
,
"Qwen2ForCausalLM"
),
"Qwen2MoeForCausalLM"
:
(
"qwen2_moe"
,
"Qwen2MoeForCausalLM"
),
"Qwen2MoeForCausalLM"
:
(
"qwen2_moe"
,
"Qwen2MoeForCausalLM"
),
...
...
vllm/model_executor/models/phi3.py
0 → 100644
View file @
18ae428a
# coding=utf-8
# Adapted from llama.py
"""Inference-only Phi3 model code inherit from Llama.py"""
from
vllm.model_executor.models.llama
import
LlamaForCausalLM
class
Phi3ForCausalLM
(
LlamaForCausalLM
):
packed_modules_mapping
=
{
"qkv_proj"
:
[
"qkv_proj"
,
],
"gate_up_proj"
:
[
"gate_up_proj"
,
],
}
vllm/model_executor/models/phimoe.py
View file @
18ae428a
...
@@ -491,6 +491,10 @@ class PhiMoEForCausalLM(nn.Module, SupportsLoRA):
...
@@ -491,6 +491,10 @@ class PhiMoEForCausalLM(nn.Module, SupportsLoRA):
"o_proj"
,
"o_proj"
,
"embed_tokens"
,
"embed_tokens"
,
"lm_head"
,
"lm_head"
,
"w1"
,
"w2"
,
"w3"
,
"gate"
,
]
]
embedding_modules
=
{
embedding_modules
=
{
"embed_tokens"
:
"input_embeddings"
,
"embed_tokens"
:
"input_embeddings"
,
...
...
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