@@ -3394,7 +3394,7 @@ def test_auto_batch_size_with_deepspeed(self):
3394
3394
)
3395
3395
trainer = Trainer (model , args , train_dataset = train_dataset , callbacks = [MockCudaOOMCallback ()])
3396
3396
trainer .train ()
3397
- self .assertEqual (trainer ._train_batch_size , 8 )
3397
+ self .assertEqual (trainer ._train_batch_size , 14 )
3398
3398
3399
3399
def test_auto_batch_size_with_resume_from_checkpoint (self ):
3400
3400
train_dataset = RegressionDataset (length = 128 )
@@ -3414,16 +3414,16 @@ def test_auto_batch_size_with_resume_from_checkpoint(self):
3414
3414
)
3415
3415
trainer = Trainer (model , args , train_dataset = train_dataset , callbacks = [MockCudaOOMCallback ()])
3416
3416
trainer .train ()
3417
- # After `auto_find_batch_size` is ran we should now be at 8
3418
- self .assertEqual (trainer ._train_batch_size , 8 )
3417
+ # After `auto_find_batch_size` is ran we should now be at 16*0.9=14
3418
+ self .assertEqual (trainer ._train_batch_size , 14 )
3419
3419
3420
3420
# We can then make a new Trainer
3421
3421
trainer = Trainer (model , args , train_dataset = train_dataset )
3422
3422
# Check we are at 16 to start
3423
3423
self .assertEqual (trainer ._train_batch_size , 16 * max (trainer .args .n_gpu , 1 ))
3424
3424
trainer .train (resume_from_checkpoint = True )
3425
- # We should be back to 8 again, picking up based upon the last ran Trainer
3426
- self .assertEqual (trainer ._train_batch_size , 8 )
3425
+ # We should be back to 14 again, picking up based upon the last ran Trainer
3426
+ self .assertEqual (trainer ._train_batch_size , 14 )
3427
3427
3428
3428
# regression for this issue: https://github.com/huggingface/transformers/issues/12970
3429
3429
def test_training_with_resume_from_checkpoint_false (self ):
0 commit comments