Skip to content
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

New callbacks API #607

Merged
merged 22 commits into from
Jan 16, 2023
Merged

New callbacks API #607

merged 22 commits into from
Jan 16, 2023

Conversation

BloodAxe
Copy link
Collaborator

@BloodAxe BloodAxe commented Jan 9, 2023

  • New callback class to enable more fine-grained control of events during training + can get more than one phase event.
  • No BC to existing callbacks

This PR introduce a new intermediate class Callback that PhaseCallback derive from. This way we keep backward compatibility with existing callbacks, while gaining the ability to implement callbacks that needs access to more than one event. Many hard-coded logic pieces in Trainer class can be reimplemented as callbacks (Logging, EMA, LR Warmups, QAT).

@dagshub
Copy link

dagshub bot commented Jan 9, 2023

@BloodAxe BloodAxe marked this pull request as ready for review January 12, 2023 10:14
Copy link
Collaborator

@shaydeci shaydeci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! especially on the docs work, really appreciated.
I got some comments/suggestions inline.

src/super_gradients/training/sg_trainer/sg_trainer.py Outdated Show resolved Hide resolved
src/super_gradients/training/sg_trainer/sg_trainer.py Outdated Show resolved Hide resolved
tests/unit_tests/training_utils_test.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@shaydeci shaydeci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@BloodAxe BloodAxe merged commit 03972c0 into master Jan 16, 2023
@BloodAxe BloodAxe deleted the feature/SG-581 branch January 16, 2023 12:56
Louis-Dupont pushed a commit that referenced this pull request Jan 17, 2023
* New callbacks API

* New callbacks API

* New callbacks API

* Fix imports

* Uncomment sanity check

* Fix callbacks order

* Fix callbacks order

* Fix callbacks order

* Fix wrong import

* Fix wrong import

* Call update_context

* Call update_context

* Fix on_train_batch_start timing

* Added docs clarifying mapping of new events to old Phase enum values

* Instantiate context after _prep_for_test

Co-authored-by: Shay Aharon <80472096+shaydeci@users.noreply.github.com>
Louis-Dupont added a commit that referenced this pull request Jan 19, 2023
* change requirements.txt

* try to fix version

* add version

* test 1.13.5

* New callbacks API (#607)

* New callbacks API

* New callbacks API

* New callbacks API

* Fix imports

* Uncomment sanity check

* Fix callbacks order

* Fix callbacks order

* Fix callbacks order

* Fix wrong import

* Fix wrong import

* Call update_context

* Call update_context

* Fix on_train_batch_start timing

* Added docs clarifying mapping of new events to old Phase enum values

* Instantiate context after _prep_for_test

Co-authored-by: Shay Aharon <80472096+shaydeci@users.noreply.github.com>

* first version (#626)

Co-authored-by: Shay Aharon <80472096+shaydeci@users.noreply.github.com>

* Improve env sanity check to be more robust (#612)

* first version - a few things to change

* improve

* imrpove doc

* undo requirements change

* mini update

* support wildcards and improve code

* move all to same file, and only raise error when version too small

* move all to same file, and only raise error when version too small

* remove arg

* 1.13.*

* catch warning and fix requirement

* remove catching * warning

* try 1.14 to pass security check

* replace <=1.13 to <1.14

Co-authored-by: Eugene Khvedchenya <ekhvedchenya@gmail.com>
Co-authored-by: Shay Aharon <80472096+shaydeci@users.noreply.github.com>
Co-authored-by: Ofri Masad <ofrimasad@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants