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
[Feature] Turning On fast_conv_bn_eval #1202
Conversation
Meeting Notes with @zhouzaida and @HAOCHENYE : The logic happens in Ideally, we would like to have Some users would set param groups when building optimizers. The param groups might depend on the key values of parameters. To keep these users unaffected, we should place Therfore, we finally agreed on the order of |
Tested on MMDetection, with a small fraction of coco data, in my laptop. The optimizer works fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi~ We should provide corresponding unittest for turn_on_fast_conv_bn_eval
to check output will not be influenced when model is modified by it. It could be more reliable to validate that turn_on_fast_conv_bn_eval
works fine with different network architecture.
BTW, we should also update this function in FlexibleRunner |
Unit test is intended to be used for simple functions. However, the validity of this feature usually requires days of GPUs to run detection experiments on the whole MSCOCO dataset. Do we have this much resource for unit testing? |
We don't need to validate the training accuracy for the specific model. We can construct some |
Fixed in 23bc688. |
This PR enables This PR does not support dynamic computation graph (which changes across different To sum up:
|
Motivation
The
mmcv
package will introduce afast_conv_bn_eval
feature in2.0.1
, as discussed in open-mmlab/mmcv#2807 .This PR enables the
mmengine
to use that feature.Modification
Runner
tries to read fromcfg
to know if thefast_conv_bn_eval
option is turned on. If it is, and themmcv
supportsfast_conv_bn_eval
, then:fast_conv_bn_eval
feature will be turned on for existingConvModule
.ConvModule
(with existing parameters).BC-breaking (Optional)
This feature does not break the backward-compatibility. It relies on a new cfg option
fast_conv_bn_eval
.Use cases (Optional)
Downstream projects can leverage this feature by adding command-line options
fast_conv_bn_eval=True
. They also need to specify the parts of module to use with this features. For example,fast_conv_bn_eval_modules=['backbone']
. This limitation comes from the fact that whole models might be too complex to trace (e.g. detection models) to find consecutive conv-bn blocks, while parts of the model are simple enough to trace. The main usecases are to replace consecutive conv-bn blocks in the pre-trained backbone.Checklist