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
MMCV
Commits
14e8e490
Unverified
Commit
14e8e490
authored
Oct 31, 2022
by
wangjiangben-hw
Committed by
GitHub
Oct 31, 2022
Browse files
[Fix] Fix set_device bug when using multi-machine multi-device (#2370)
parent
b5134190
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
mmcv/runner/dist_utils.py
mmcv/runner/dist_utils.py
+2
-1
No files found.
mmcv/runner/dist_utils.py
View file @
14e8e490
...
...
@@ -60,7 +60,8 @@ def _init_dist_pytorch(backend: str, **kwargs) -> None:
**
kwargs
)
elif
IS_NPU_AVAILABLE
:
import
torch_npu
# noqa: F401
torch
.
npu
.
set_device
(
rank
)
num_npus
=
torch
.
npu
.
device_count
()
torch
.
npu
.
set_device
(
rank
%
num_npus
)
dist
.
init_process_group
(
backend
=
'hccl'
,
rank
=
rank
,
...
...
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