[Deepspeed] Allow HF optimizer and scheduler to be passed to deepspeed (#10464)

* pass hf optimizer and scheduler to deepspeed if not specified in ds config

* pass hf optimizer and scheduler to deepspeed if not specified in ds config

* update

* make init_deepspeed support config dict

* fix docstring formatting

* clean up trainer's comments

* add new tests

* fix type

* composit argparse doesn't work

* style

* add a new test, rename others

* document new functionality

* complete tests, add docs

* style

* correct level

* Apply suggestions from code review

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* add new methods to the doc

* must tell DS we are using a non-native optimizer

* add protection against cpu_offload + HF optimizer combo

* fix the cli overrides

* sync docs + tests

* restore AdamW

* better docs

* need new version

* no longer needed

* remove outdate information

* refactor duplicated code

Co-authored-by: Stas Bekman <stas@stason.org>
Co-authored-by: Stas Bekman <stas00@users.noreply.github.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
This commit is contained in:
Cheng Li
2021-03-16 15:51:09 -07:00
committed by GitHub
parent c23248443c
commit c83fbc5f2d
6 changed files with 289 additions and 134 deletions

View File

@@ -491,10 +491,14 @@ def assert_screenout(out, what):
class CaptureStd:
"""
Context manager to capture:
stdout, clean it up and make it available via obj.out stderr, and make it available via obj.err
init arguments: - out - capture stdout: True/False, default True - err - capture stdout: True/False, default
True
- stdout, clean it up and make it available via obj.out
- stderr, and make it available via obj.err
init arguments:
- out - capture stdout: True/False, default True
- err - capture stdout: True/False, default True
Examples::