[Feature] Allow custom RINorm kwargs & fix foundation compatibility#3029
[Feature] Allow custom RINorm kwargs & fix foundation compatibility#3029dennisbader merged 11 commits intounit8co:masterfrom
Conversation
Co-authored-by: Zhihao Dai <zhihao.dai@eng.ox.ac.uk>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3029 +/- ##
==========================================
- Coverage 95.73% 95.66% -0.07%
==========================================
Files 158 158
Lines 17122 17131 +9
==========================================
- Hits 16391 16389 -2
- Misses 731 742 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Zhihao Dai <zhihao.dai@eng.ox.ac.uk>
dennisbader
left a comment
There was a problem hiding this comment.
Thanks for the PR @daidahao 🚀
Could we rather under the hood allow PLForecastingModule to already accept a bool or any kwargs (e.g. {"affine": True}) to instantiate the RINorm? If it's a bool, it would use the existing behavior.
Then for the foundation models we would pass {"affine": False} whenever use_reversible_instance_norm=True.
This would be a quick fix while still allowing the foundation models to use RINorm (could be good for fine-tuning).
Co-authored-by: Zhihao Dai <zhihao.dai@eng.ox.ac.uk>
Co-authored-by: Zhihao Dai <zhihao.dai@eng.ox.ac.uk>
Co-authored-by: Zhihao Dai <zhihao.dai@eng.ox.ac.uk>
Co-authored-by: Zhihao Dai <zhihao.dai@eng.ox.ac.uk>
Personally, I would not recommend using RINorm for prediction or fine-tuning since almost all foundation models have their own RINorm. That's why I have now removed any reference to RINorm in Chronos-2 and TimesFM. Nevertheless, in For all torch models, I've updated Let me know what you think. |
Co-authored-by: Zhihao Dai <zhihao.dai@eng.ox.ac.uk>
Co-authored-by: Zhihao Dai <zhihao.dai@eng.ox.ac.uk>
dennisbader
left a comment
There was a problem hiding this comment.
Looks great, thanks a lot @daidahao 🚀
I applied some minor updates (shortened a bit the parameter description and added it to all model docs)
Checklist before merging this PR:
Fixes #3028, fixes #2748.
Summary
use_reversible_instance_normas a flexible parameter that can be set toTrue,False, or a dictionary ofRINormhyperparameters. This allows users to customizeRINormfor their models.use_reversible_instance_norm=Trueor{"affine": True}for foundation models to prevent checkpoint loading errors due to incompatible weights.Other Information
#2758 is not being fixed in this PR.