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
537c9755
Unverified
Commit
537c9755
authored
Feb 18, 2024
by
Zhuohan Li
Committed by
GitHub
Feb 18, 2024
Browse files
[Minor] Small fix to make distributed init logic in worker looks cleaner (#2905)
parent
786b7f18
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
vllm/worker/worker.py
vllm/worker/worker.py
+4
-2
No files found.
vllm/worker/worker.py
View file @
537c9755
...
@@ -93,8 +93,6 @@ class Worker:
...
@@ -93,8 +93,6 @@ class Worker:
# Initialize the distributed environment.
# Initialize the distributed environment.
init_distributed_environment
(
self
.
parallel_config
,
self
.
rank
,
init_distributed_environment
(
self
.
parallel_config
,
self
.
rank
,
cupy_port
,
self
.
distributed_init_method
)
cupy_port
,
self
.
distributed_init_method
)
if
not
self
.
parallel_config
.
disable_custom_all_reduce
:
init_custom_ar
()
# Initialize the model.
# Initialize the model.
set_random_seed
(
self
.
model_config
.
seed
)
set_random_seed
(
self
.
model_config
.
seed
)
...
@@ -288,6 +286,10 @@ def init_distributed_environment(
...
@@ -288,6 +286,10 @@ def init_distributed_environment(
ensure_model_parallel_initialized
(
parallel_config
.
tensor_parallel_size
,
ensure_model_parallel_initialized
(
parallel_config
.
tensor_parallel_size
,
parallel_config
.
pipeline_parallel_size
)
parallel_config
.
pipeline_parallel_size
)
# Initialize a custom fast all-reduce implementation.
if
not
parallel_config
.
disable_custom_all_reduce
:
init_custom_ar
()
def
_check_if_gpu_supports_dtype
(
torch_dtype
:
torch
.
dtype
):
def
_check_if_gpu_supports_dtype
(
torch_dtype
:
torch
.
dtype
):
# Check if the GPU supports the dtype.
# Check if the GPU supports the dtype.
...
...
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