Skip to content

[Quantization]add prefix for commandA quantized model #17017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion vllm/model_executor/models/commandr.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
self,
config: CohereConfig,
quant_config: Optional[QuantizationConfig] = None,
prefix: str = "",
):
super().__init__()
self.config = config
Expand All @@ -99,12 +100,14 @@
[self.intermediate_size] * 2,
bias=False,
quant_config=quant_config,
prefix=f"{prefix}.gate_up_proj",
)
self.down_proj = RowParallelLinear(
self.intermediate_size,
self.hidden_size,
bias=False,
quant_config=quant_config,
prefix=f"{prefix}.down_proj",
)
self.act_fn = SiluAndMul()

Expand Down Expand Up @@ -158,12 +161,14 @@
self.total_num_kv_heads,
bias=False,
quant_config=quant_config,
prefix=f"{prefix}.qkv_proj",
)
self.o_proj = RowParallelLinear(
self.total_num_heads * self.head_dim,
self.hidden_size,
bias=False,
quant_config=quant_config,
prefix=f"{prefix}.o_proj",
)
self.rotary_emb = get_rope(
self.head_dim,
Expand Down Expand Up @@ -244,7 +249,7 @@
quant_config=quant_config,
prefix=f"{prefix}.self_attn")

self.mlp = CohereMLP(config, quant_config=quant_config)
self.mlp = CohereMLP(config, quant_config=quant_config, prefix=f"{prefix}.mlp"))

Check failure on line 252 in vllm/model_executor/models/commandr.py

View workflow job for this annotation

GitHub Actions / pre-commit

Ruff

vllm/model_executor/models/commandr.py:252:88: SyntaxError: Expected a statement

Check failure on line 252 in vllm/model_executor/models/commandr.py

View workflow job for this annotation

GitHub Actions / pre-commit

Ruff (E501)

vllm/model_executor/models/commandr.py:252:81: E501 Line too long (88 > 80)
self.input_layernorm = LayerNorm(param_shape=(config.hidden_size),

Check failure on line 253 in vllm/model_executor/models/commandr.py

View workflow job for this annotation

GitHub Actions / pre-commit

Ruff

vllm/model_executor/models/commandr.py:252:89: SyntaxError: Expected a statement
eps=config.layer_norm_eps)

Expand Down
Loading