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
90979c38
Unverified
Commit
90979c38
authored
Sep 17, 2023
by
Zhuohan Li
Committed by
GitHub
Sep 17, 2023
Browse files
[FIX] Don't initialize parameter by default (#1067)
parent
e21d7687
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
vllm/model_executor/parallel_utils/tensor_parallel/layers.py
vllm/model_executor/parallel_utils/tensor_parallel/layers.py
+4
-4
No files found.
vllm/model_executor/parallel_utils/tensor_parallel/layers.py
View file @
90979c38
...
@@ -83,7 +83,7 @@ class VocabParallelEmbedding(torch.nn.Module):
...
@@ -83,7 +83,7 @@ class VocabParallelEmbedding(torch.nn.Module):
init_method
=
init
.
xavier_normal_
,
init_method
=
init
.
xavier_normal_
,
params_dtype
:
torch
.
dtype
=
None
,
params_dtype
:
torch
.
dtype
=
None
,
use_cpu_initialization
:
bool
=
False
,
use_cpu_initialization
:
bool
=
False
,
perform_initialization
:
bool
=
Tru
e
):
perform_initialization
:
bool
=
Fals
e
):
super
(
VocabParallelEmbedding
,
self
).
__init__
()
super
(
VocabParallelEmbedding
,
self
).
__init__
()
assert
not
perform_initialization
assert
not
perform_initialization
assert
not
use_cpu_initialization
assert
not
use_cpu_initialization
...
@@ -113,7 +113,7 @@ class VocabParallelEmbedding(torch.nn.Module):
...
@@ -113,7 +113,7 @@ class VocabParallelEmbedding(torch.nn.Module):
self
.
weight
=
Parameter
(
torch
.
empty
(
self
.
weight
=
Parameter
(
torch
.
empty
(
self
.
num_embeddings_per_partition
,
self
.
embedding_dim
,
self
.
num_embeddings_per_partition
,
self
.
embedding_dim
,
device
=
torch
.
cuda
.
current_device
(),
dtype
=
params_dtype
))
device
=
torch
.
cuda
.
current_device
(),
dtype
=
params_dtype
))
def
forward
(
self
,
input_
):
def
forward
(
self
,
input_
):
if
self
.
tensor_model_parallel_size
>
1
:
if
self
.
tensor_model_parallel_size
>
1
:
# Build the mask.
# Build the mask.
...
@@ -172,7 +172,7 @@ class ColumnParallelLinear(torch.nn.Module):
...
@@ -172,7 +172,7 @@ class ColumnParallelLinear(torch.nn.Module):
skip_bias_add
=
False
,
skip_bias_add
=
False
,
params_dtype
=
None
,
params_dtype
=
None
,
use_cpu_initialization
=
False
,
use_cpu_initialization
=
False
,
perform_initialization
=
Tru
e
,
perform_initialization
=
Fals
e
,
quant_config
=
None
,
quant_config
=
None
,
):
):
super
(
ColumnParallelLinear
,
self
).
__init__
()
super
(
ColumnParallelLinear
,
self
).
__init__
()
...
@@ -288,7 +288,7 @@ class RowParallelLinear(torch.nn.Module):
...
@@ -288,7 +288,7 @@ class RowParallelLinear(torch.nn.Module):
skip_bias_add
=
False
,
skip_bias_add
=
False
,
params_dtype
=
None
,
params_dtype
=
None
,
use_cpu_initialization
=
False
,
use_cpu_initialization
=
False
,
perform_initialization
=
Tru
e
,
perform_initialization
=
Fals
e
,
reduce_results
=
True
,
reduce_results
=
True
,
quant_config
=
None
,
quant_config
=
None
,
):
):
...
...
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