FEAT / Trainer: LOMO optimizer support (#30178)
* add V1 - adalomo not working yet * add todo docs + refactor from comments * adjust LR * add docs * add more elaborated test * Apply suggestions from code review Co-authored-by: Zach Mueller <muellerzr@gmail.com> * fix * push * add accelerate check * fix DDP case * Apply suggestions from code review Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com> * fix * init kwargs * safely add attribute * revert to enum logic * Update src/transformers/trainer.py --------- Co-authored-by: Zach Mueller <muellerzr@gmail.com> Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
This commit is contained in:
@@ -82,6 +82,7 @@ from .utils import (
|
||||
is_keras_nlp_available,
|
||||
is_levenshtein_available,
|
||||
is_librosa_available,
|
||||
is_lomo_available,
|
||||
is_natten_available,
|
||||
is_nltk_available,
|
||||
is_onnx_available,
|
||||
@@ -338,6 +339,14 @@ def require_galore_torch(test_case):
|
||||
return unittest.skipUnless(is_galore_torch_available(), "test requires GaLore")(test_case)
|
||||
|
||||
|
||||
def require_lomo(test_case):
|
||||
"""
|
||||
Decorator marking a test that requires LOMO. These tests are skipped when LOMO-optim isn't installed.
|
||||
https://github.com/OpenLMLab/LOMO
|
||||
"""
|
||||
return unittest.skipUnless(is_lomo_available(), "test requires LOMO")(test_case)
|
||||
|
||||
|
||||
def require_cv2(test_case):
|
||||
"""
|
||||
Decorator marking a test that requires OpenCV.
|
||||
|
||||
Reference in New Issue
Block a user