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
d58fa705
Commit
d58fa705
authored
Mar 28, 2023
by
Yuanchen
Committed by
binmakeswell
Mar 29, 2023
Browse files
[NFC] polish code style (#3268)
Co-authored-by:
Yuanchen Xu
<
yuanchen.xu00@gmail.com
>
parent
c4a226b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
colossalai/nn/_ops/_utils.py
colossalai/nn/_ops/_utils.py
+5
-6
No files found.
colossalai/nn/_ops/_utils.py
View file @
d58fa705
import
torch
from
typing
import
List
,
Optional
,
Union
from
typing
import
Union
,
Optional
,
List
from
colossalai.tensor
import
ColoTensor
import
torch
import
torch
import
torch.distributed
as
dist
import
torch.distributed
as
dist
from
colossalai.global_variables
import
tensor_parallel_env
as
env
from
colossalai.global_variables
import
tensor_parallel_env
as
env
from
colossalai.nn.layer.utils
import
divide
from
colossalai.nn.layer.utils
import
divide
from
colossalai.tensor
import
ProcessGroup
,
ColoTensorSpec
from
colossalai.tensor
import
ColoTensor
,
ColoTensorSpec
,
ProcessGroup
GeneralTensor
=
Union
[
ColoTensor
,
torch
.
Tensor
]
GeneralTensor
=
Union
[
ColoTensor
,
torch
.
Tensor
]
Number
=
Union
[
int
,
float
]
Number
=
Union
[
int
,
float
]
...
@@ -135,7 +134,7 @@ class _ReduceInput(torch.autograd.Function):
...
@@ -135,7 +134,7 @@ class _ReduceInput(torch.autograd.Function):
class
_SplitForwardGatherBackward
(
torch
.
autograd
.
Function
):
class
_SplitForwardGatherBackward
(
torch
.
autograd
.
Function
):
"""
"""
Split the input and keep only the corresponding chuck to the rank.
Split the input and keep only the corresponding chuck to the rank.
Args:
Args:
input_: input matrix.
input_: input matrix.
process_group: parallel mode.
process_group: parallel mode.
...
...
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