Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norm
vllm
Commits
47c04371
Commit
47c04371
authored
May 12, 2024
by
zhuwenwen
Browse files
fix qkv linear
parent
0d27f0c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
vllm/model_executor/layers/linear.py
vllm/model_executor/layers/linear.py
+2
-2
No files found.
vllm/model_executor/layers/linear.py
View file @
47c04371
...
...
@@ -481,7 +481,7 @@ class QKVParallelLinear(ColumnParallelLinear):
else
:
param_data
=
param_data
.
narrow
(
output_dim
,
shard_offset
,
shard_size
)
if
loaded_shard_id
==
"q"
and
len
(
param_data
.
shape
)
==
2
:
if
loaded_shard_id
==
"q"
:
shard_id
=
tp_rank
else
:
shard_id
=
tp_rank
//
self
.
num_kv_head_replicas
...
...
@@ -499,7 +499,7 @@ class QKVParallelLinear(ColumnParallelLinear):
if
self
.
use_llama_nn
:
assert
param_data_
.
shape
==
loaded_weight
.
shape
param_data_
.
copy_
(
loaded_weight
)
if
loaded_shard_id
==
"v"
:
if
loaded_shard_id
==
"v"
and
len
(
param_data
.
shape
)
==
2
:
param_data
=
param_data
.
transpose
(
0
,
1
)
param
.
data
=
param_data
.
reshape
(
param_data
.
shape
[
1
],
-
1
)
else
:
...
...
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