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
7db3ccc7
Unverified
Commit
7db3ccc7
authored
Apr 12, 2022
by
Jiarui Fang
Committed by
GitHub
Apr 12, 2022
Browse files
[hotfix] remove duplicated param register to stateful tensor manager (#728)
parent
600e769a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
colossalai/zero/sharded_model/sharded_model_v2.py
colossalai/zero/sharded_model/sharded_model_v2.py
+3
-5
No files found.
colossalai/zero/sharded_model/sharded_model_v2.py
View file @
7db3ccc7
...
...
@@ -106,9 +106,7 @@ class ShardedModelV2(nn.Module):
GLOBAL_MODEL_DATA_TRACER
.
register_model
(
self
)
self
.
_memstats_collector
=
MemStatsCollector
()
self
.
_stateful_tensor_mgr
=
StatefulTensorMgr
(
self
.
_memstats_collector
)
# for param in module.parameters():
for
submodule
in
module
.
modules
():
for
param
in
submodule
.
parameters
(
recurse
=
False
):
for
param
in
module
.
parameters
():
if
hasattr
(
param
,
'colo_attr'
):
self
.
_stateful_tensor_mgr
.
register_stateful_param
(
param
.
colo_attr
)
self
.
_start_collect_memstats
=
disposable
(
self
.
_memstats_collector
.
start_collection
)
...
...
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