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
964a2867
"git@developer.sourcefind.cn:OpenDAS/colossalai.git" did not exist on "afb239bbf83737655bf6b6baef2e261768d5c60f"
Commit
964a2867
authored
Mar 28, 2023
by
Kai Wang (Victor Kai)
Committed by
binmakeswell
Mar 29, 2023
Browse files
[NFC] polish initializer_3d.py code style (#3279)
parent
94eec1c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
colossalai/context/process_group_initializer/initializer_3d.py
...salai/context/process_group_initializer/initializer_3d.py
+5
-2
No files found.
colossalai/context/process_group_initializer/initializer_3d.py
View file @
964a2867
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
import
math
import
math
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.registry
import
DIST_GROUP_INITIALIZER
from
colossalai.registry
import
DIST_GROUP_INITIALIZER
...
@@ -213,7 +214,8 @@ class Initializer_3D_InputxWeight(ProcessGroupInitializer):
...
@@ -213,7 +214,8 @@ class Initializer_3D_InputxWeight(ProcessGroupInitializer):
for
h
in
range
(
self
.
num_group
):
for
h
in
range
(
self
.
num_group
):
for
k
in
range
(
self
.
depth
):
for
k
in
range
(
self
.
depth
):
ranks
=
[
ranks
=
[
h
*
self
.
depth
**
3
+
i
+
self
.
depth
*
(
j
+
self
.
depth
*
k
)
for
j
in
range
(
self
.
depth
)
h
*
self
.
depth
**
3
+
i
+
self
.
depth
*
(
j
+
self
.
depth
*
k
)
for
j
in
range
(
self
.
depth
)
for
i
in
range
(
self
.
depth
)
for
i
in
range
(
self
.
depth
)
]
]
group
=
dist
.
new_group
(
ranks
)
group
=
dist
.
new_group
(
ranks
)
...
@@ -266,7 +268,8 @@ class Initializer_3D_OutputxWeight(ProcessGroupInitializer):
...
@@ -266,7 +268,8 @@ class Initializer_3D_OutputxWeight(ProcessGroupInitializer):
for
h
in
range
(
self
.
num_group
):
for
h
in
range
(
self
.
num_group
):
for
j
in
range
(
self
.
depth
):
for
j
in
range
(
self
.
depth
):
ranks
=
[
ranks
=
[
h
*
self
.
depth
**
3
+
i
+
self
.
depth
*
(
j
+
self
.
depth
*
k
)
for
k
in
range
(
self
.
depth
)
h
*
self
.
depth
**
3
+
i
+
self
.
depth
*
(
j
+
self
.
depth
*
k
)
for
k
in
range
(
self
.
depth
)
for
i
in
range
(
self
.
depth
)
for
i
in
range
(
self
.
depth
)
]
]
group
=
dist
.
new_group
(
ranks
)
group
=
dist
.
new_group
(
ranks
)
...
...
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