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
e3fde4ee
Unverified
Commit
e3fde4ee
authored
Jun 02, 2022
by
ver217
Committed by
GitHub
Jun 02, 2022
Browse files
fix import error in sharded model v2 (#1053)
parent
e1922ea4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
colossalai/zero/sharded_model/sharded_model_v2.py
colossalai/zero/sharded_model/sharded_model_v2.py
+5
-1
No files found.
colossalai/zero/sharded_model/sharded_model_v2.py
View file @
e3fde4ee
...
...
@@ -2,7 +2,6 @@ import functools
from
collections
import
OrderedDict
from
typing
import
Any
,
Optional
,
Iterator
,
Tuple
from
copy
import
deepcopy
from
torch.nn.modules.module
import
_EXTRA_STATE_KEY_SUFFIX
import
itertools
import
torch
import
torch.distributed
as
dist
...
...
@@ -28,6 +27,11 @@ from colossalai.gemini.tensor_placement_policy import TensorPlacementPolicyFacto
from
._utils
import
(
cast_float_arguments
,
cast_tensor_to_fp16
,
cast_tensor_to_fp32
,
chunk_and_pad
,
free_storage
,
get_gradient_predivide_factor
)
try
:
from
torch.nn.modules.module
import
_EXTRA_STATE_KEY_SUFFIX
except
ImportError
:
_EXTRA_STATE_KEY_SUFFIX
=
'_extra_state'
class
ShardedModelV2
(
nn
.
Module
):
"""
...
...
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