Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Add weight_decay_filter and lars_adaptation_filter to LARS #1432

Open
turian opened this issue Aug 29, 2022 · 9 comments
Open

Add weight_decay_filter and lars_adaptation_filter to LARS #1432

turian opened this issue Aug 29, 2022 · 9 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed won't fix This will not be worked on

Comments

@turian
Copy link

turian commented Aug 29, 2022

🚀 Feature

Add weight_decay_filter and lars_adaptation_filter to LARS

Motivation

weight decay typically shouldn't be applied to BatchNorm. See fast.ai and this pytorch discuss thread.

The facebook vicreg code has parameters weight_decay_filter and lars_adaptation_filter which they set to True for any parameter that has ndim 1.

Pitch

There should be a simple way to disable weight decay and LARS adaptation on ndim==1 parameters.

Alternatives

Port Facebook LARS code and use it instead of lightning flash LARS code.

@turian turian added enhancement New feature or request help wanted Extra attention is needed labels Aug 29, 2022
@krshrimali
Copy link
Contributor

Hi, @turian - Thank you for creating the issue. Just to let you know, I have this on my list to take a look at, and I'll try to get back by this weekend. A bit occupied, apologies for the delay.

@krshrimali
Copy link
Contributor

Hi, @turian - Thank you for giving the context, I went through the discussion on the PyTorch forum. I think it's fair to give an option to the user to disable this based on the condition (ndim == 1). Would you like to create a PR to add this? If not, I'll be able to take a look, hopefully soon. Thank you! ⚡

@turian
Copy link
Author

turian commented Sep 4, 2022

@krshrimali I am not sure that I would able to create a PR that covers all corner cases. :(

@krshrimali
Copy link
Contributor

@krshrimali I am not sure that I would able to create a PR that covers all corner cases. :(

No worries at all! I will try to take a look, we are working towards a release tomorrow, so I will need some time but I have added this to my list. Thank you again!!

@turian
Copy link
Author

turian commented Sep 12, 2022

@krshrimali Great! I am following this issue.

@krshrimali
Copy link
Contributor

@krshrimali Great! I am following this issue.

I'll try to pick this up over the coming weekend. 🤞🏻 Thanks for your patience, @turian 🚀

@turian
Copy link
Author

turian commented Sep 12, 2022

@krshrimali Thanks! And I am happy to help with code review if you tag me in the PR

@krshrimali
Copy link
Contributor

@krshrimali Thanks! And I am happy to help with code review if you tag me in the PR

Thanks! I'll make sure to request your review :)

@stale
Copy link

stale bot commented Mar 18, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the won't fix This will not be worked on label Mar 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed won't fix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants