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
DeepEP
Commits
9d4f7ef8
Commit
9d4f7ef8
authored
Jun 18, 2025
by
Chenggang Zhao
Browse files
Surpass type checks
parent
b56f7c2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
tests/utils.py
tests/utils.py
+3
-2
No files found.
tests/utils.py
View file @
9d4f7ef8
import
inspect
import
numpy
as
np
import
os
import
sys
import
numpy
as
np
import
torch
import
torch.distributed
as
dist
from
typing
import
Optional
...
...
@@ -23,7 +23,8 @@ def init_dist(local_rank: int, num_local_ranks: int):
'rank'
:
node_rank
*
num_local_ranks
+
local_rank
,
}
if
'device_id'
in
sig
.
parameters
:
params
[
'device_id'
]
=
torch
.
device
(
f
"cuda:
{
local_rank
}
"
)
# noinspection PyTypeChecker
params
[
'device_id'
]
=
torch
.
device
(
f
'cuda:
{
local_rank
}
'
)
dist
.
init_process_group
(
**
params
)
torch
.
set_default_dtype
(
torch
.
bfloat16
)
torch
.
set_default_device
(
'cuda'
)
...
...
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