-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] MMSeparateDistributedDataParallel skip init_weights #1042
Comments
Hi, the module is defined in
Therefore, if you implement the |
@zhouzaida But the sub_modules in mmengine/mmengine/model/wrappers/seperate_distributed.py Lines 75 to 87 in 4d7a293
Therefore, the MMSeparateDistributedDataParallel.module does have init_weights function but its sub-modules ( MMDistributedDataParallel ) do not have init_weights function, which causes the init_weights functions of the module wrapped in the MMDistributedDataParallel not accessible during the initialzation.
|
Oh, the |
@HAOCHENYE LGTM. The initialization works as expected with the PR. |
Prerequisite
Reproduces the problem - code sample
I encountered this problem when running my own custom project based on
mmengine
, which is too complicated to present.Additional information
The
MMSeparateDistributedDataParallel
is a model wrapper of model wrapper, whosemodule
may contain theMMDistributedDataParallel
.mmengine/mmengine/model/wrappers/seperate_distributed.py
Lines 82 to 87 in 4d7a293
When initializing the model_wrapper weights, the
runner
initialize the weight of therunner.model.module
:mmengine/mmengine/runner/runner.py
Lines 893 to 902 in 4d7a293
The above codes will cause the
init_weights
functions in model not work because the children module of therunner.model.module
in this case is of typeMMDistributedDataParallel
which does NOT haveinit_weights
function.The text was updated successfully, but these errors were encountered: