Skip to content

Commit

Permalink
[tests] fix copy-n-paste error (huggingface#17312)
Browse files Browse the repository at this point in the history
* [tests] fix copy-n-paste error

* fix
  • Loading branch information
stas00 authored May 18, 2022
1 parent 1b20c97 commit 3601aa8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/trainer/test_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,7 @@ def test_fp16_full_eval(self):
a = torch.ones(1000, bs) + 0.001
b = torch.ones(1000, bs) - 0.001

# 1. with mem metrics enabled
# 1. with fp16_full_eval disabled
trainer = get_regression_trainer(a=a, b=b, eval_len=eval_len, skip_memory_metrics=False)
metrics = trainer.evaluate()
del trainer
Expand All @@ -1572,7 +1572,7 @@ def test_fp16_full_eval(self):
# perfect world: fp32_eval == close to zero
self.assertLess(fp32_eval, 5_000)

# 2. with mem metrics disabled
# 2. with fp16_full_eval enabled
trainer = get_regression_trainer(a=a, b=b, eval_len=eval_len, fp16_full_eval=True, skip_memory_metrics=False)
metrics = trainer.evaluate()
fp16_init = metrics["init_mem_gpu_alloc_delta"]
Expand Down Expand Up @@ -1611,7 +1611,7 @@ def test_bf16_full_eval(self):
a = torch.ones(1000, bs) + 0.001
b = torch.ones(1000, bs) - 0.001

# 1. with mem metrics enabled
# 1. with bf16_full_eval disabled
trainer = get_regression_trainer(a=a, b=b, eval_len=eval_len, skip_memory_metrics=False)
metrics = trainer.evaluate()
del trainer
Expand All @@ -1632,7 +1632,7 @@ def test_bf16_full_eval(self):
# perfect world: fp32_eval == close to zero
self.assertLess(fp32_eval, 5_000)

# 2. with mem metrics disabled
# 2. with bf16_full_eval enabled
trainer = get_regression_trainer(a=a, b=b, eval_len=eval_len, bf16_full_eval=True, skip_memory_metrics=False)
metrics = trainer.evaluate()
bf16_init = metrics["init_mem_gpu_alloc_delta"]
Expand Down

0 comments on commit 3601aa8

Please sign in to comment.