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
88787bce
Unverified
Commit
88787bce
authored
Feb 18, 2025
by
Kyle Sayers
Committed by
GitHub
Feb 17, 2025
Browse files
[Quant] Molmo SupportsQuant (#13336)
parent
932b51ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
vllm/model_executor/models/molmo.py
vllm/model_executor/models/molmo.py
+7
-5
No files found.
vllm/model_executor/models/molmo.py
View file @
88787bce
...
...
@@ -52,7 +52,8 @@ from vllm.multimodal.profiling import BaseDummyInputsBuilder, ProcessorInputs
from
vllm.sequence
import
IntermediateTensors
from
vllm.utils
import
JSONTree
,
json_map_leaves
from
.interfaces
import
SupportsLoRA
,
SupportsMultiModal
,
SupportsPP
from
.interfaces
import
(
SupportsLoRA
,
SupportsMultiModal
,
SupportsPP
,
SupportsQuant
)
from
.utils
import
(
AutoWeightsLoader
,
WeightsMapper
,
flatten_bn
,
is_pp_missing_parameter
,
make_empty_intermediate_tensors_factory
,
make_layers
,
...
...
@@ -633,7 +634,8 @@ class MolmoDecoderNormAfterLayer(MolmoDecoderLayer):
return
hidden_states
,
residual
class
MolmoVisionBackbone
(
nn
.
Module
):
class
MolmoVisionBackbone
(
nn
.
Module
,
SupportsQuant
):
packed_modules_mapping
=
{
"merged_linear"
:
[
"gate_proj"
,
"up_proj"
]}
def
__init__
(
self
,
...
...
@@ -794,7 +796,7 @@ class MolmoVisionBackbone(nn.Module):
@
support_torch_compile
class
MolmoModel
(
nn
.
Module
):
class
MolmoModel
(
nn
.
Module
,
SupportsQuant
):
def
__init__
(
self
,
*
,
vllm_config
:
VllmConfig
,
prefix
:
str
=
""
):
super
().
__init__
()
...
...
@@ -1402,8 +1404,8 @@ class MolmoMultiModalProcessor(BaseMultiModalProcessor[MolmoProcessingInfo]):
@
MULTIMODAL_REGISTRY
.
register_processor
(
MolmoMultiModalProcessor
,
info
=
MolmoProcessingInfo
,
dummy_inputs
=
MolmoDummyInputsBuilder
)
class
MolmoForCausalLM
(
nn
.
Module
,
SupportsMultiModal
,
SupportsPP
,
Supports
LoRA
):
class
MolmoForCausalLM
(
nn
.
Module
,
SupportsMultiModal
,
SupportsPP
,
SupportsLoRA
,
Supports
Quant
):
hf_to_vllm_mapper
=
WeightsMapper
(
orig_to_new_substr
=
{
# vision backbone mapping
...
...
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