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
41d0696e
Commit
41d0696e
authored
Feb 18, 2025
by
gaoqiong
Browse files
增加lm_nn的量化控控控制,控制为tn
parent
8c61b2ed
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
0 deletions
+4
-0
vllm/model_executor/models/gpt_neox.py
vllm/model_executor/models/gpt_neox.py
+1
-0
vllm/model_executor/models/llama.py
vllm/model_executor/models/llama.py
+1
-0
vllm/model_executor/models/qwen.py
vllm/model_executor/models/qwen.py
+1
-0
vllm/model_executor/models/qwen2.py
vllm/model_executor/models/qwen2.py
+1
-0
No files found.
vllm/model_executor/models/gpt_neox.py
View file @
41d0696e
...
@@ -360,6 +360,7 @@ class GPTNeoXForCausalLM(nn.Module, SupportsPP):
...
@@ -360,6 +360,7 @@ class GPTNeoXForCausalLM(nn.Module, SupportsPP):
loaded_params
.
add
(
name
)
loaded_params
.
add
(
name
)
#当为triton支持推理的时候不能进行处理
#当为triton支持推理的时候不能进行处理
if
self
.
quant_method
==
"compressed_tensors"
:
if
self
.
quant_method
==
"compressed_tensors"
:
os
.
environ
[
'LM_NN'
]
=
'0'
lay_key_words
=
[
lay_key_words
=
[
"attention.query_key_value.weight"
,
"attention.query_key_value.weight"
,
"attention.dense.weight"
,
"attention.dense.weight"
,
...
...
vllm/model_executor/models/llama.py
View file @
41d0696e
...
@@ -550,6 +550,7 @@ class LlamaModel(nn.Module):
...
@@ -550,6 +550,7 @@ class LlamaModel(nn.Module):
#当为triton支持推理的时候不能进行处理
#当为triton支持推理的时候不能进行处理
if
self
.
quant_method
==
"compressed_tensors"
:
if
self
.
quant_method
==
"compressed_tensors"
:
os
.
environ
[
'LM_NN'
]
=
'0'
lay_key_words
=
[
lay_key_words
=
[
"self_attn.qkv_proj.weight"
,
"self_attn.qkv_proj.weight"
,
"self_attn.o_proj.weight"
,
"self_attn.o_proj.weight"
,
...
...
vllm/model_executor/models/qwen.py
View file @
41d0696e
...
@@ -1174,6 +1174,7 @@ class QWenBaseModel(nn.Module, SupportsPP, SupportsLoRA):
...
@@ -1174,6 +1174,7 @@ class QWenBaseModel(nn.Module, SupportsPP, SupportsLoRA):
qweight
.
data
=
torch
.
cat
((
qweight
.
data
,
qweight_pad
),
dim
=
1
).
contiguous
()
qweight
.
data
=
torch
.
cat
((
qweight
.
data
,
qweight_pad
),
dim
=
1
).
contiguous
()
if
self
.
quant_method
==
"compressed_tensors"
:
if
self
.
quant_method
==
"compressed_tensors"
:
os
.
environ
[
'LM_NN'
]
=
'0'
lay_key_words
=
[
lay_key_words
=
[
"attn.c_attn.weight"
,
"attn.c_attn.weight"
,
"attn.c_proj.weight"
,
"attn.c_proj.weight"
,
...
...
vllm/model_executor/models/qwen2.py
View file @
41d0696e
...
@@ -527,6 +527,7 @@ class Qwen2Model(nn.Module):
...
@@ -527,6 +527,7 @@ class Qwen2Model(nn.Module):
qweight
.
data
=
torch
.
cat
((
qweight
.
data
,
qweight_pad
),
dim
=
1
).
contiguous
()
qweight
.
data
=
torch
.
cat
((
qweight
.
data
,
qweight_pad
),
dim
=
1
).
contiguous
()
if
self
.
quant_method
==
"compressed_tensors"
:
if
self
.
quant_method
==
"compressed_tensors"
:
os
.
environ
[
'LM_NN'
]
=
'0'
lay_key_words
=
[
lay_key_words
=
[
"self_attn.qkv_proj.weight"
,
"self_attn.qkv_proj.weight"
,
"self_attn.o_proj.weight"
,
"self_attn.o_proj.weight"
,
...
...
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