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
7aadcbd0
Unverified
Commit
7aadcbd0
authored
Jul 12, 2022
by
ver217
Committed by
GitHub
Jul 12, 2022
Browse files
hotfix colotensor _scan_for_pg_from_args (#1276)
parent
0cf8e8e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
colossalai/tensor/colo_tensor.py
colossalai/tensor/colo_tensor.py
+2
-2
No files found.
colossalai/tensor/colo_tensor.py
View file @
7aadcbd0
...
@@ -40,7 +40,7 @@ def _scan_for_pg_from_args(args, kwargs) -> ProcessGroup:
...
@@ -40,7 +40,7 @@ def _scan_for_pg_from_args(args, kwargs) -> ProcessGroup:
pg
=
_scan_for_pg_from_args
(
elem
,
{})
pg
=
_scan_for_pg_from_args
(
elem
,
{})
if
pg
is
not
None
:
if
pg
is
not
None
:
return
pg
return
pg
for
k
,
v
in
kwargs
:
for
k
,
v
in
kwargs
.
items
()
:
if
isinstance
(
v
,
ColoTensor
):
if
isinstance
(
v
,
ColoTensor
):
pg
=
v
.
get_process_group
()
pg
=
v
.
get_process_group
()
return
pg
return
pg
...
@@ -52,7 +52,7 @@ class ColoTensor(torch.Tensor):
...
@@ -52,7 +52,7 @@ class ColoTensor(torch.Tensor):
Args:
Args:
data (torch.Tensor): a torch tensor used as the payload the colotensor.
data (torch.Tensor): a torch tensor used as the payload the colotensor.
spec (ColoTensorSpec, optional): the tensor spec of initialization. Defaults to ColoTensorSpec(ReplicaSpec()).
spec (ColoTensorSpec, optional): the tensor spec of initialization. Defaults to ColoTensorSpec(ReplicaSpec()).
The signature of the function has to be consistent with the __new__ except for the 1st arg.
The signature of the function has to be consistent with the __new__ except for the 1st arg.
The class should be initialized with a torch tensor in the following ways.
The class should be initialized with a torch tensor in the following ways.
1. directly init.
1. directly init.
...
...
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