Fix missing groups in EfficientNet MBConv depthwise convolution - #1042
Fix missing groups in EfficientNet MBConv depthwise convolution#1042Amitesh-Sinha5 wants to merge 1 commit into
Conversation
|
MLCommons CLA bot: |
This comment has been minimized.
This comment has been minimized.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 4 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
cbd3856 to
f4cc6be
Compare
…ixes mlcommons#1041 Signed-off-by: Amitesh Sinha <amiteshsinha005@gmail.com>
f4cc6be to
a6525b9
Compare
Fixes #1041
Proposed Changes
groups=6 * num_in_featsargument to_MBConv6.depthconv1inGANDLF/models/efficientnet.py, so it is a depthwise convolution as an MBConv block requires (it was silently running as a dense conv withgroups=1)._MBConv1already setsgroupscorrectly; this brings_MBConv6in line, matching the reference EfficientNet (Tan & Le, 2019).testing/test_mbconv6_is_depthwise.py) asserting_MBConv6.depthconv1is depthwise and that a block stays within a sane parameter budget.Why it matters
Because the depthwise conv is the defining op of an MBConv block, making it dense inflates the whole network:
So
efficientnetb0was ~23× larger than a real EfficientNet-B0 — heavier than thedensenet121baseline it is meant to be a lighter alternative to. This affects everyefficientnetb*architecture.Block-level repro (no training needed):
Checklist
CONTRIBUTINGguide has been followed._MBConv6has different weight shapes, so any checkpoint saved from the buggyefficientnetb*will not load into the fixed model — those weights corresponded to an unintended dense conv and would need retraining.GANDLF/version.py. N/A — bugfix, no version bump.pyproject.toml. N/A.logginglibrary is being used and noprintstatements are left.