forked from pytorch/ignite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[create_supervised_trainer] add automatic mixed precision (pytorch#1589)
* amp init * docs complete * add tests * unscale_ + clip_grad_norm_, move checks to private func, more edge case checks * scaler must be provided by user and its optional * full docstring, on_cuda_amp test * extract into 4 functions for normal, amp, apex and tpu training * explicit training step, independent mode * mypy fix * fix(tests): pytest.raises checks with match, skipif < 1.6.0 * fix(tests): align tests name, coverage append in tpu ci * fix: remove ununsed amp import * fix: docstring with default values, more tests, code review suggestions * fix(docs): update function names * fix: docstring from code review * fix: engine state only has attribute scaler if scaler is only True * fix: address code review * fix: create scaler or None in _check_arg * fix: no return for scaler in supervised_training_step_amp * fix: gpu tests for apex * fix: gpu tests for apex and amp * chore: add more tests for coverage * fix: state only has scaler attribute if True * fix: use prefix for scaler * Apply suggestions from code review Co-authored-by: vfdev <vfdev.5@gmail.com> * fix: skip apex tests if apex is not installed * fix: skip apex error test if apex * fix: ImportError instead of ModuleNotFoundError * fix(docs): no device tpu in gpu functions and vice versa * fix: raise an error instead of warn for invalid scaler and amp_mode Co-authored-by: Sylvain Desroziers <sylvain.desroziers@gmail.com> Co-authored-by: vfdev <vfdev.5@gmail.com>
- Loading branch information
1 parent
51970e3
commit f379b18
Showing
5 changed files
with
402 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.