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
ColossalAI
Commits
765db512
Unverified
Commit
765db512
authored
Jan 28, 2022
by
Frank Lee
Committed by
GitHub
Jan 28, 2022
Browse files
fixed ddp bug on torch 1.8 (#194)
parent
569357fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
colossalai/initialize.py
colossalai/initialize.py
+2
-2
No files found.
colossalai/initialize.py
View file @
765db512
...
@@ -348,12 +348,12 @@ def initialize(model: Union[nn.Module, List[nn.Module]],
...
@@ -348,12 +348,12 @@ def initialize(model: Union[nn.Module, List[nn.Module]],
"added even though not specified in the configuration"
,
"added even though not specified in the configuration"
,
ranks
=
[
0
])
ranks
=
[
0
])
elif
is_using_sequence
():
elif
is_using_sequence
():
model
=
DDP
(
model
,
process_group
=
gpc
.
get_group
(
ParallelMode
.
SEQUENCE_DP
))
model
=
DDP
(
model
,
process_group
=
gpc
.
get_group
(
ParallelMode
.
SEQUENCE_DP
)
,
device_ids
=
[
torch
.
cuda
.
current_device
()]
)
if
verbose
:
if
verbose
:
logger
.
info
(
logger
.
info
(
'Model is using torch.nn.parallel.DistributedDataParallel for Sequence Parallelism'
,
ranks
=
[
0
])
'Model is using torch.nn.parallel.DistributedDataParallel for Sequence Parallelism'
,
ranks
=
[
0
])
elif
is_using_ddp
()
and
not
is_using_pp
()
and
amp_mode
!=
AMP_TYPE
.
NAIVE
:
elif
is_using_ddp
()
and
not
is_using_pp
()
and
amp_mode
!=
AMP_TYPE
.
NAIVE
:
model
=
DDP
(
model
,
process_group
=
gpc
.
get_group
(
ParallelMode
.
DATA
))
model
=
DDP
(
model
,
process_group
=
gpc
.
get_group
(
ParallelMode
.
DATA
)
,
device_ids
=
[
torch
.
cuda
.
current_device
()]
)
if
verbose
:
if
verbose
:
logger
.
info
(
logger
.
info
(
'Model is using torch.nn.parallel.DistributedDataParallel for Data Parallelism'
,
ranks
=
[
0
])
'Model is using torch.nn.parallel.DistributedDataParallel for Data Parallelism'
,
ranks
=
[
0
])
...
...
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