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
ccf3c58c
Unverified
Commit
ccf3c58c
authored
Jun 21, 2022
by
ver217
Committed by
GitHub
Jun 21, 2022
Browse files
embedding op use gather_out (#1143)
parent
e61dc31b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
colossalai/nn/_ops/embedding.py
colossalai/nn/_ops/embedding.py
+2
-1
No files found.
colossalai/nn/_ops/embedding.py
View file @
ccf3c58c
...
@@ -30,7 +30,8 @@ def colo_embedding_1Dcol(input_tensor: ColoTensor,
...
@@ -30,7 +30,8 @@ def colo_embedding_1Dcol(input_tensor: ColoTensor,
distspec
.
shard
(
weight
.
spec
.
get_process_group
(),
[
-
1
],
[
weight
.
spec
.
get_process_group_size
()]),
distspec
.
shard
(
weight
.
spec
.
get_process_group
(),
[
-
1
],
[
weight
.
spec
.
get_process_group_size
()]),
ParallelAction
(
ComputePattern
.
TP1D
))
ParallelAction
(
ComputePattern
.
TP1D
))
output
=
ColoTensor
.
from_torch_tensor
(
output_parallel
,
spec
=
output_spec
)
output
=
ColoTensor
.
from_torch_tensor
(
output_parallel
,
spec
=
output_spec
)
output
=
output
.
convert_to_dist_spec
(
distspec
.
replicate
(
weight
.
spec
.
get_process_group
()))
if
weight
.
spec
.
parallel_action
.
gather_out
:
output
=
output
.
convert_to_dist_spec
(
distspec
.
replicate
(
weight
.
spec
.
get_process_group
()))
return
output
return
output
...
...
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