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
598cde4a
Commit
598cde4a
authored
May 16, 2022
by
Zirui Zhu
Committed by
binmakeswell
May 17, 2022
Browse files
[NFC] polish colossalai/nn/layer/parallel_2p5d/layers.py code style (#972)
parent
632e94ab
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
colossalai/nn/layer/parallel_2p5d/layers.py
colossalai/nn/layer/parallel_2p5d/layers.py
+8
-8
No files found.
colossalai/nn/layer/parallel_2p5d/layers.py
View file @
598cde4a
...
...
@@ -189,7 +189,7 @@ class Linear2p5D(ParallelLayer):
def
forward
(
self
,
x
:
Tensor
)
->
Tensor
:
# input: [m/dq, n/q, k/q]
# output: [m/dq, n/q, h/q]
out_shape
=
x
.
shape
[:
-
1
]
+
(
self
.
hidden_size_per_partition
,
)
out_shape
=
x
.
shape
[:
-
1
]
+
(
self
.
hidden_size_per_partition
,)
output
=
Matmul_AB_2p5D
.
apply
(
x
,
...
...
@@ -1038,7 +1038,7 @@ class Classifier2p5D(ParallelLayer):
destination
.
update
(
local_state
)
def
forward
(
self
,
input_
:
Tensor
)
->
Tensor
:
out_shape
=
input_
.
shape
[:
-
1
]
+
(
self
.
num_classes
,
)
out_shape
=
input_
.
shape
[:
-
1
]
+
(
self
.
num_classes
,)
return
classifier_2p5d
(
input_
,
self
.
weight
,
self
.
bias
,
self
.
tesseract_dim
,
out_shape
,
self
.
row_rank
,
self
.
col_rank
,
ParallelMode
.
PARALLEL_2P5D_ROW
,
ParallelMode
.
PARALLEL_2P5D_COL
,
...
...
@@ -1172,7 +1172,7 @@ class VocabParallelClassifier2p5D(ParallelLayer):
def
forward
(
self
,
x
:
Tensor
)
->
Tensor
:
# input: [m/dq, n/q, k/q]
# output: [m/dq, n/q, h/q]
out_shape
=
x
.
shape
[:
-
1
]
+
(
self
.
hidden_size_per_partition
,
)
out_shape
=
x
.
shape
[:
-
1
]
+
(
self
.
hidden_size_per_partition
,)
output
=
Matmul_ABT_2p5D
.
apply
(
x
,
...
...
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