Skip to content

Commit

Permalink
Update FAQ to meet current api (#549)
Browse files Browse the repository at this point in the history
Summary:
Update hint for fixing `IncompatibleModuleException` from deprecated `opacus.utils.module_modification.convert_batchnorm_modules` to `ModuleValidator.fix()`

## Types of changes

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [x] Docs change / refactoring / dependency upgrade

## Motivation and Context / Related issue

outdated FAQ

https://discuss.pytorch.org/t/convert-batchnorm-modules-does-not-exist/157156/3

## How Has This Been Tested (if it applies)

## Checklist

- [x] The documentation is up-to-date with the changes I made.
- [x] I have read the **CONTRIBUTING** document and completed the CLA (see **CONTRIBUTING**).
- [ ] All tests passed, and additional code has been covered with new tests.

Pull Request resolved: #549

Reviewed By: karthikprasad

Differential Revision: D43082750

Pulled By: ffuuugor

fbshipit-source-id: 4f2da6c08a927d57da0eda2e0a8831b8bbc581e7
  • Loading branch information
MarcinMisiurewicz authored and facebook-github-bot committed Feb 9, 2023
1 parent affcf22 commit 1e661e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Assuming that batches are randomly selected, an increase in the batch size incre

## My model throws IncompatibleModuleException. What is going wrong?

Your model most likely contains modules that are not compatible with Opacus. The most prominent example of these modules is batch-norm types. Luckily there is a good substitute for a `BatchNorm` layer, and it is called `GroupNorm`. You can convert all your batch norm submodules using this utility function: `opacus.utils.module_modification.convert_batchnorm_modules.`
Your model most likely contains modules that are not compatible with Opacus. The most prominent example of these modules is batch-norm types. Before validating you model try to fix incompatible modules using `ModuleValidator.fix(model)` as described [here](https://opacus.ai/tutorials/guide_to_module_validator#Registering-fixer).

## What is virtual batch size?

Expand Down

0 comments on commit 1e661e8

Please sign in to comment.