-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix accumulate_grad_batches
on init
#9652
Conversation
accumulate_grad_batches
on init
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Codecov Report
@@ Coverage Diff @@
## master #9652 +/- ##
=======================================
- Coverage 93% 89% -4%
=======================================
Files 179 179
Lines 15286 15285 -1
=======================================
- Hits 14177 13566 -611
- Misses 1109 1719 +610 |
pytorch_lightning/trainer/connectors/training_trick_connector.py
Outdated
Show resolved
Hide resolved
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
1 similar comment
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
moved the logic to callback connector since |
seems like there is some issue with ipus + accumulate_grad_batches.. need to explore more on this. |
accumulate_grad_batches
on initaccumulate_grad_batches
on init
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
db0fbb1
to
c63c00c
Compare
667b8bd
to
9e6cee9
Compare
accumulate_grad_batches
on initaccumulate_grad_batches
on init
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
1 similar comment
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
apologies for this.. initially I thought this is going to be a simple fix.. but turns out there were 2 more issues. |
That is fine, take it easy... |
Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Carlos Mocholí <[email protected]>
What does this PR do?
Just a small fix to make sure that accumulate_grad_batches is an int all the time and we use gradient accumulation scheduler to define it's value.
the reason to have this one even here though it's updated inside on_train_epoch_start is because I have seen users using it to calculate total training_steps which is usually used while defining some of the schedulers. So this is required at this point.
also in case a scheduler is passed inside callbacks then that is also taken care off now.
Does your PR introduce any breaking changes? If yes, please list them.
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃