Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/transformers/modelcard.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,10 +895,10 @@ def extract_hyperparameters_from_trainer(trainer):
hyperparameters["num_epochs"] = trainer.args.num_train_epochs

if trainer.args.fp16:
if trainer.use_cuda_amp:
hyperparameters["mixed_precision_training"] = "Native AMP"
elif trainer.use_apex:
if trainer.use_apex:
hyperparameters["mixed_precision_training"] = f"Apex, opt level {trainer.args.fp16_opt_level}"
else:
hyperparameters["mixed_precision_training"] = "Native AMP"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't know well this part. Could you share why use_cuda_amp is no longer available from trainer? Otherwise LGTM. Thank you!

Copy link
Contributor

@muellerzr muellerzr Oct 11, 2023

Choose a reason for hiding this comment

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

SharedDDP was deprecated (and now removed) in favor of using Accelerate natively: #25702


if trainer.args.label_smoothing_factor != 0.0:
hyperparameters["label_smoothing_factor"] = trainer.args.label_smoothing_factor
Expand Down