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
47fb214b
Unverified
Commit
47fb214b
authored
Mar 01, 2023
by
YuliangLiu0306
Committed by
GitHub
Mar 01, 2023
Browse files
[hotfix] add shard dim to aviod backward communication error (#2954)
parent
090f14fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
colossalai/auto_parallel/tensor_shard/node_handler/strategy/reshape_generator.py
...l/tensor_shard/node_handler/strategy/reshape_generator.py
+1
-0
colossalai/tensor/comm_spec.py
colossalai/tensor/comm_spec.py
+2
-0
No files found.
colossalai/auto_parallel/tensor_shard/node_handler/strategy/reshape_generator.py
View file @
47fb214b
...
...
@@ -343,6 +343,7 @@ class DefaultReshapeGenerator(ReshapeGenerator):
comm_type
=
CommType
.
BEFORE
,
arg_index
=
0
)
input_comm_action
.
comm_spec
.
gather_dim
=
total_mesh_dim_list
input_comm_action
.
comm_spec
.
shard_dim
=
total_mesh_dim_list
elif
len
(
total_mesh_dim_list
)
>=
2
:
source_spec
=
sharding_spec_mapping
[
"input"
]
...
...
colossalai/tensor/comm_spec.py
View file @
47fb214b
...
...
@@ -429,6 +429,7 @@ class CommSpec:
if
self
.
comm_pattern
==
CollectiveCommPattern
.
GATHER_FWD_SPLIT_BWD
:
res_list
.
append
(
f
"comm_pattern:GATHER_FWD_SPLIT_BWD, "
)
res_list
.
append
(
f
"gather_dim:
{
self
.
gather_dim
}
, "
)
res_list
.
append
(
f
"shard_dim:
{
self
.
shard_dim
}
, "
)
res_list
.
append
(
f
"logical_process_axis:
{
self
.
logical_process_axis
}
)"
)
elif
self
.
comm_pattern
==
CollectiveCommPattern
.
ALL2ALL_FWD_ALL2ALL_BWD
:
res_list
.
append
(
f
"comm_pattern:ALL2ALL_FWD_ALL2ALL_BWD, "
)
...
...
@@ -437,6 +438,7 @@ class CommSpec:
res_list
.
append
(
f
"logical_process_axis:
{
self
.
logical_process_axis
}
)"
)
elif
self
.
comm_pattern
==
CollectiveCommPattern
.
SPLIT_FWD_GATHER_BWD
:
res_list
.
append
(
f
"comm_pattern:SPLIT_FWD_GATHER_BWD, "
)
res_list
.
append
(
f
"gather_dim:
{
self
.
gather_dim
}
, "
)
res_list
.
append
(
f
"shard_dim:
{
self
.
shard_dim
}
, "
)
res_list
.
append
(
f
"logical_process_axis:
{
self
.
logical_process_axis
}
)"
)
elif
self
.
comm_pattern
==
CollectiveCommPattern
.
ALLREDUCE_FWD_IDENTITY_BWD
:
...
...
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