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
d1b649f1
Unverified
Commit
d1b649f1
authored
Feb 18, 2025
by
Kyle Sayers
Committed by
GitHub
Feb 17, 2025
Browse files
[Quant] Aria SupportsQuant (#13416)
parent
ac19b519
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
vllm/model_executor/models/aria.py
vllm/model_executor/models/aria.py
+10
-3
No files found.
vllm/model_executor/models/aria.py
View file @
d1b649f1
...
...
@@ -36,7 +36,7 @@ from .idefics2_vision_model import Idefics2VisionConfig
from
.idefics2_vision_model
import
(
Idefics2VisionTransformer
as
Idefics3VisionTransformer
)
# yapf: enable
from
.interfaces
import
SupportsMultiModal
from
.interfaces
import
SupportsMultiModal
,
SupportsQuant
from
.llama
import
LlamaDecoderLayer
,
LlamaMLP
,
LlamaModel
from
.utils
import
(
AutoWeightsLoader
,
WeightsMapper
,
flatten_bn
,
is_pp_missing_parameter
,
maybe_prefix
,
...
...
@@ -53,7 +53,8 @@ class AriaImagePixelInputs(TypedDict):
"""
class
AriaVisionTransformer
(
Idefics3VisionTransformer
):
class
AriaVisionTransformer
(
Idefics3VisionTransformer
,
SupportsQuant
):
packed_modules_mapping
=
{
"qkv_proj"
:
[
"q_proj"
,
"k_proj"
,
"v_proj"
]}
def
__init__
(
self
,
...
...
@@ -304,11 +305,17 @@ class AriaTextDecoderLayer(LlamaDecoderLayer):
self
.
mlp
=
AriaTextMoELayer
(
config
,
quant_config
=
quant_config
)
class
AriaTextModel
(
LlamaModel
):
class
AriaTextModel
(
LlamaModel
,
SupportsQuant
):
"""
Custom LlamaModel for the AriaMoE model which modifies the standard
LlamaModel by replacing the `LlamaDecoderLayer` with `MoEDecoderLayer`.
"""
packed_modules_mapping
=
{
"qkv_proj"
:
[
"q_proj"
,
"k_proj"
,
"v_proj"
],
"gate_up_proj"
:
[
"gate_proj"
,
"up_proj"
],
"experts.w13_weight"
:
[
"experts.fc1.weight"
],
"experts.w2_weight"
:
[
"experts.fc2.weight"
],
}
def
__init__
(
self
,
*
,
vllm_config
:
VllmConfig
,
prefix
:
str
=
""
):
super
().
__init__
(
vllm_config
=
vllm_config
,
...
...
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