Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test_number_of_steps_in_training_with_ipex #17889

Merged
merged 1 commit into from
Jun 28, 2022

Conversation

ydshieh
Copy link
Collaborator

@ydshieh ydshieh commented Jun 27, 2022

What does this PR do?

Fix test_number_of_steps_in_training_with_ipex.

Details

This test uses no_cuda=True, which will change n_gpu to 0 (see _setup_devices), and train_batch_size will be 8 (with the default training args). However this line

self.batch_size = args.train_batch_size

is computed (earlier) with GPUs, and therefore the (total) batch size is 16 when 2 GPUs is available.

This cause the following error.

Currently test error

tests/trainer/test_trainer.py::TrainerIntegrationTest::test_number_of_steps_in_training_with_ipex
(line 652)  AssertionError: 24 != 12.0

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jun 27, 2022

The documentation is not available anymore as the PR was closed or merged.

@ydshieh ydshieh requested review from sgugger and stas00 and removed request for sgugger June 27, 2022 07:08
Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Makes sense! Thanks a lot for the detailed explanation and the fix!

Copy link
Contributor

@stas00 stas00 left a comment

Choose a reason for hiding this comment

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

Super! Thanks a lot for the fix, @ydshieh!

@ydshieh ydshieh merged commit f717d47 into huggingface:main Jun 28, 2022
@ydshieh ydshieh deleted the fix_trainer_test branch June 28, 2022 06:55
younesbelkada pushed a commit to younesbelkada/transformers that referenced this pull request Jun 29, 2022
viclzhu pushed a commit to viclzhu/transformers that referenced this pull request Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants