Skip to content

Commit 9913bff

Browse files
committed
Remove extra references to adamw_hf
1 parent ee87ce2 commit 9913bff

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

src/transformers/trainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,7 @@ def optimizer_hook(param):
14211421
if args.optim == OptimizerNames.ADAFACTOR:
14221422
optimizer_cls = Adafactor
14231423
optimizer_kwargs.update({"scale_parameter": False, "relative_step": False})
1424-
elif args.optim in [OptimizerNames.ADAMW_TORCH, OptimizerNames.ADAMW_TORCH_FUSED, OptimizerNames.ADAMW_HF]:
1424+
elif args.optim in [OptimizerNames.ADAMW_TORCH, OptimizerNames.ADAMW_TORCH_FUSED]:
14251425
from torch.optim import AdamW
14261426

14271427
optimizer_cls = AdamW

src/transformers/training_args.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ class OptimizerNames(ExplicitEnum):
146146
Stores the acceptable string identifiers for optimizers.
147147
"""
148148

149-
ADAMW_HF = "adamw_hf"
150149
ADAMW_TORCH = "adamw_torch"
151150
ADAMW_TORCH_FUSED = "adamw_torch_fused"
152151
ADAMW_TORCH_XLA = "adamw_torch_xla"
@@ -628,7 +627,7 @@ class TrainingArguments:
628627
629628
The options should be separated by whitespaces.
630629
optim (`str` or [`training_args.OptimizerNames`], *optional*, defaults to `"adamw_torch"`):
631-
The optimizer to use, such as "adamw_hf", "adamw_torch", "adamw_torch_fused", "adamw_apex_fused", "adamw_anyprecision",
630+
The optimizer to use, such as "adamw_torch", "adamw_torch_fused", "adamw_apex_fused", "adamw_anyprecision",
632631
"adafactor". See `OptimizerNames` in [training_args.py](https://github.com/huggingface/transformers/blob/main/src/transformers/training_args.py)
633632
for a full list of optimizers.
634633
optim_args (`str`, *optional*):
@@ -2986,7 +2985,7 @@ def set_optimizer(
29862985
29872986
Args:
29882987
name (`str` or [`training_args.OptimizerNames`], *optional*, defaults to `"adamw_torch"`):
2989-
The optimizer to use: `"adamw_hf"`, `"adamw_torch"`, `"adamw_torch_fused"`, `"adamw_apex_fused"`,
2988+
The optimizer to use: `"adamw_torch"`, `"adamw_torch_fused"`, `"adamw_apex_fused"`,
29902989
`"adamw_anyprecision"` or `"adafactor"`.
29912990
learning_rate (`float`, *optional*, defaults to 5e-5):
29922991
The initial learning rate.

tests/trainer/test_trainer.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5376,16 +5376,6 @@ def hp_name(trial):
53765376
}
53775377

53785378
optim_test_params = [
5379-
(
5380-
OptimizerNames.ADAMW_HF,
5381-
torch.optim.AdamW,
5382-
default_adam_kwargs,
5383-
),
5384-
(
5385-
OptimizerNames.ADAMW_HF.value,
5386-
torch.optim.AdamW,
5387-
default_adam_kwargs,
5388-
),
53895379
(
53905380
OptimizerNames.ADAMW_TORCH,
53915381
torch.optim.AdamW,

0 commit comments

Comments
 (0)