Commit c033276
authored
Support passing setup_kwargs to DynamicModule.convert() (#577)
## What does this PR do?
**Type of change:** Implementation improvement <!-- Use one of the
following: Bug fix, new feature, new example, new tests, documentation.
-->
For Minitron, currently we define hparams in DynamicModule._setup() and
then overwrite it with hparams from other layers so they share the same
reference (e.g. hidden_size hparam from embedding should be used
throughout the model). Instead, allowing kwargs in _setup and passing
them from DMRegistry.convert() will make the code more intuitive and
less error-prone
## Testing
- No functionality change, only implementation improvement
- We have thorough CICD tests already that are passing after this change
## Before your PR is "*Ready for review*"
<!-- If you haven't finished some of the above items you can still open
`Draft` PR. -->
- **Make sure you read and follow [Contributor
guidelines](https://github.com/NVIDIA/TensorRT-Model-Optimizer/blob/main/CONTRIBUTING.md)**
and your commits are signed.
- **Is this change backward compatible?**: Yes <!--- If No, explain why.
-->
- **Did you write any new necessary tests?**: No
- **Did you add or update any necessary documentation?**: No
- **Did you update
[Changelog](https://github.com/NVIDIA/TensorRT-Model-Optimizer/blob/main/CHANGELOG.rst)?**:
No <!--- Only for new features, API changes, critical bug fixes or bw
breaking changes. -->
---------
Signed-off-by: Keval Morabia <[email protected]>1 parent e35db17 commit c033276
File tree
5 files changed
+128
-171
lines changed- modelopt/torch
- nas
- hparams
- plugins
- opt
5 files changed
+128
-171
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
0 commit comments