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
36d1ccb2
Unverified
Commit
36d1ccb2
authored
Mar 13, 2025
by
Kyle Sayers
Committed by
GitHub
Mar 13, 2025
Browse files
[Quant] BartModel SupportsQuant (#14699)
Signed-off-by:
Kyle Sayers
<
kylesayrs@gmail.com
>
parent
1bc3b739
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
vllm/model_executor/models/bart.py
vllm/model_executor/models/bart.py
+4
-3
No files found.
vllm/model_executor/models/bart.py
View file @
36d1ccb2
...
@@ -44,7 +44,7 @@ from vllm.model_executor.model_loader.weight_utils import default_weight_loader
...
@@ -44,7 +44,7 @@ from vllm.model_executor.model_loader.weight_utils import default_weight_loader
from
vllm.model_executor.sampling_metadata
import
SamplingMetadata
from
vllm.model_executor.sampling_metadata
import
SamplingMetadata
from
vllm.sequence
import
IntermediateTensors
from
vllm.sequence
import
IntermediateTensors
from
.interfaces
import
SupportsV0Only
from
.interfaces
import
SupportsQuant
,
SupportsV0Only
from
.utils
import
maybe_prefix
from
.utils
import
maybe_prefix
logger
=
logging
.
get_logger
(
__name__
)
logger
=
logging
.
get_logger
(
__name__
)
...
@@ -697,7 +697,7 @@ class BartDecoder(nn.Module):
...
@@ -697,7 +697,7 @@ class BartDecoder(nn.Module):
return
hidden_states
return
hidden_states
class
BartModel
(
nn
.
Module
):
class
BartModel
(
nn
.
Module
,
SupportsQuant
):
_tied_weights_keys
=
[
_tied_weights_keys
=
[
"encoder.embed_tokens.weight"
,
"decoder.embed_tokens.weight"
"encoder.embed_tokens.weight"
,
"decoder.embed_tokens.weight"
]
]
...
@@ -763,7 +763,8 @@ class BartModel(nn.Module):
...
@@ -763,7 +763,8 @@ class BartModel(nn.Module):
return
decoder_outputs
return
decoder_outputs
class
BartForConditionalGeneration
(
nn
.
Module
,
SupportsV0Only
):
class
BartForConditionalGeneration
(
nn
.
Module
,
SupportsV0Only
,
SupportsQuant
):
packed_modules_mapping
=
{
"qkv_proj"
:
[
"q_proj"
,
"k_proj"
,
"v_proj"
]}
base_model_prefix
=
"model"
base_model_prefix
=
"model"
def
__init__
(
self
,
*
,
vllm_config
:
VllmConfig
,
prefix
:
str
=
""
):
def
__init__
(
self
,
*
,
vllm_config
:
VllmConfig
,
prefix
:
str
=
""
):
...
...
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