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
OpenDAS
text-generation-inference
Commits
ae466a87
Unverified
Commit
ae466a87
authored
Jun 26, 2023
by
Antoni Baum
Committed by
GitHub
Jun 26, 2023
Browse files
fix(server): Do not init process group if already initialized (#388)
parent
aefde28b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
server/text_generation_server/utils/dist.py
server/text_generation_server/utils/dist.py
+13
-8
No files found.
server/text_generation_server/utils/dist.py
View file @
ae466a87
...
...
@@ -2,6 +2,7 @@ import os
import
torch
from
datetime
import
timedelta
from
loguru
import
logger
class
FakeBarrier
:
...
...
@@ -59,13 +60,17 @@ def initialize_torch_distributed():
else
:
if
os
.
getenv
(
"DEBUG"
,
None
)
==
"1"
:
return
FakeGroup
(
rank
,
world_size
),
rank
,
world_size
# Call the init process.
torch
.
distributed
.
init_process_group
(
backend
=
backend
,
world_size
=
world_size
,
rank
=
rank
,
timeout
=
timedelta
(
seconds
=
60
),
pg_options
=
options
,
)
if
not
torch
.
distributed
.
is_initialized
():
# Call the init process.
torch
.
distributed
.
init_process_group
(
backend
=
backend
,
world_size
=
world_size
,
rank
=
rank
,
timeout
=
timedelta
(
seconds
=
60
),
pg_options
=
options
,
)
else
:
logger
.
warning
(
"torch.distributed is already initialized."
)
return
torch
.
distributed
.
group
.
WORLD
,
rank
,
world_size
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