[ESPnet-Codec] Bug fix on codec activation function#6273
[ESPnet-Codec] Bug fix on codec activation function#6273sw005320 merged 2 commits intoespnet:masterfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request correctly addresses a bug in the Snake1d activation function that was preventing BF16 inference. By converting self.alpha to an nn.Parameter, it will now be correctly managed by PyTorch for device placement and data type casting, such as with auto_cast. The changes in the forward method are also a good improvement, removing the modification of instance state during the forward pass and eliminating a now-redundant .to(x.device) call. The fix is well-implemented and improves the robustness of the module.
|
Looks good to me! |
|
It looks like the CI failure is due to ESPnet building process and is beyond the scope of this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6273 +/- ##
=======================================
Coverage 56.49% 56.49%
=======================================
Files 896 896
Lines 84814 84814
=======================================
Hits 47914 47914
Misses 36900 36900
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks, @jctian98! |
What did you change?
Find a bug that prohibits the BF16 inference using the ESPnet-codec model.
The torch.ones is not a registered parameter and would not be affected by auto_cast for its dtype and device.
@ftshijt