Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ICV-mmengine_basecode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Schiffel
ICV-mmengine_basecode
Commits
9bbbd7dc
Unverified
Commit
9bbbd7dc
authored
2 years ago
by
Mashiro
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Fix] Fix error argument sequence in fsdp (#520)
parent
a6f52977
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mmengine/model/wrappers/fully_sharded_distributed.py
+11
-2
11 additions, 2 deletions
mmengine/model/wrappers/fully_sharded_distributed.py
with
11 additions
and
2 deletions
mmengine/model/wrappers/fully_sharded_distributed.py
+
11
−
2
View file @
9bbbd7dc
...
@@ -97,6 +97,9 @@ class MMFullyShardedDataParallel(FullyShardedDataParallel):
...
@@ -97,6 +97,9 @@ class MMFullyShardedDataParallel(FullyShardedDataParallel):
computation overlapping.
computation overlapping.
Pros and cons of each algorithm is explained in class
Pros and cons of each algorithm is explained in class
``BackwardPrefetch``.
``BackwardPrefetch``.
**kwargs: Keyword arguments passed to
:class:`FullyShardedDataParallel`.
"""
"""
def
__init__
(
def
__init__
(
...
@@ -106,6 +109,7 @@ class MMFullyShardedDataParallel(FullyShardedDataParallel):
...
@@ -106,6 +109,7 @@ class MMFullyShardedDataParallel(FullyShardedDataParallel):
cpu_offload
:
Optional
[
Union
[
bool
,
CPUOffload
]]
=
None
,
cpu_offload
:
Optional
[
Union
[
bool
,
CPUOffload
]]
=
None
,
fsdp_auto_wrap_policy
:
Optional
[
Union
[
str
,
Callable
]]
=
None
,
fsdp_auto_wrap_policy
:
Optional
[
Union
[
str
,
Callable
]]
=
None
,
backward_prefetch
:
Optional
[
Union
[
str
,
BackwardPrefetch
]]
=
None
,
backward_prefetch
:
Optional
[
Union
[
str
,
BackwardPrefetch
]]
=
None
,
**
kwargs
,
):
):
if
cpu_offload
is
not
None
:
if
cpu_offload
is
not
None
:
...
@@ -150,8 +154,13 @@ class MMFullyShardedDataParallel(FullyShardedDataParallel):
...
@@ -150,8 +154,13 @@ class MMFullyShardedDataParallel(FullyShardedDataParallel):
'
or `BackwardPrefetch`, but has type
'
'
or `BackwardPrefetch`, but has type
'
f
'
{
type
(
backward_prefetch
)
}
'
)
f
'
{
type
(
backward_prefetch
)
}
'
)
super
().
__init__
(
module
,
process_group
,
cpu_offload
,
super
().
__init__
(
fsdp_auto_wrap_policy
,
backward_prefetch
)
module
=
module
,
process_group
=
process_group
,
auto_wrap_policy
=
fsdp_auto_wrap_policy
,
cpu_offload
=
cpu_offload
,
backward_prefetch
=
backward_prefetch
,
**
kwargs
)
def
train_step
(
self
,
data
:
dict
,
def
train_step
(
self
,
data
:
dict
,
optim_wrapper
:
OptimWrapper
)
->
Dict
[
str
,
torch
.
Tensor
]:
optim_wrapper
:
OptimWrapper
)
->
Dict
[
str
,
torch
.
Tensor
]:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment