Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
3601aa8f
Unverified
Commit
3601aa8f
authored
May 18, 2022
by
Stas Bekman
Committed by
GitHub
May 18, 2022
Browse files
[tests] fix copy-n-paste error (#17312)
* [tests] fix copy-n-paste error * fix
parent
1b20c970
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
tests/trainer/test_trainer.py
tests/trainer/test_trainer.py
+4
-4
No files found.
tests/trainer/test_trainer.py
View file @
3601aa8f
...
@@ -1551,7 +1551,7 @@ class TrainerIntegrationTest(TestCasePlus, TrainerIntegrationCommon):
...
@@ -1551,7 +1551,7 @@ class TrainerIntegrationTest(TestCasePlus, TrainerIntegrationCommon):
a
=
torch
.
ones
(
1000
,
bs
)
+
0.001
a
=
torch
.
ones
(
1000
,
bs
)
+
0.001
b
=
torch
.
ones
(
1000
,
bs
)
-
0.001
b
=
torch
.
ones
(
1000
,
bs
)
-
0.001
# 1. with
mem metrics en
abled
# 1. with
fp16_full_eval dis
abled
trainer
=
get_regression_trainer
(
a
=
a
,
b
=
b
,
eval_len
=
eval_len
,
skip_memory_metrics
=
False
)
trainer
=
get_regression_trainer
(
a
=
a
,
b
=
b
,
eval_len
=
eval_len
,
skip_memory_metrics
=
False
)
metrics
=
trainer
.
evaluate
()
metrics
=
trainer
.
evaluate
()
del
trainer
del
trainer
...
@@ -1572,7 +1572,7 @@ class TrainerIntegrationTest(TestCasePlus, TrainerIntegrationCommon):
...
@@ -1572,7 +1572,7 @@ class TrainerIntegrationTest(TestCasePlus, TrainerIntegrationCommon):
# perfect world: fp32_eval == close to zero
# perfect world: fp32_eval == close to zero
self
.
assertLess
(
fp32_eval
,
5_000
)
self
.
assertLess
(
fp32_eval
,
5_000
)
# 2. with
mem metrics dis
abled
# 2. with
fp16_full_eval en
abled
trainer
=
get_regression_trainer
(
a
=
a
,
b
=
b
,
eval_len
=
eval_len
,
fp16_full_eval
=
True
,
skip_memory_metrics
=
False
)
trainer
=
get_regression_trainer
(
a
=
a
,
b
=
b
,
eval_len
=
eval_len
,
fp16_full_eval
=
True
,
skip_memory_metrics
=
False
)
metrics
=
trainer
.
evaluate
()
metrics
=
trainer
.
evaluate
()
fp16_init
=
metrics
[
"init_mem_gpu_alloc_delta"
]
fp16_init
=
metrics
[
"init_mem_gpu_alloc_delta"
]
...
@@ -1611,7 +1611,7 @@ class TrainerIntegrationTest(TestCasePlus, TrainerIntegrationCommon):
...
@@ -1611,7 +1611,7 @@ class TrainerIntegrationTest(TestCasePlus, TrainerIntegrationCommon):
a
=
torch
.
ones
(
1000
,
bs
)
+
0.001
a
=
torch
.
ones
(
1000
,
bs
)
+
0.001
b
=
torch
.
ones
(
1000
,
bs
)
-
0.001
b
=
torch
.
ones
(
1000
,
bs
)
-
0.001
# 1. with
mem metrics en
abled
# 1. with
bf16_full_eval dis
abled
trainer
=
get_regression_trainer
(
a
=
a
,
b
=
b
,
eval_len
=
eval_len
,
skip_memory_metrics
=
False
)
trainer
=
get_regression_trainer
(
a
=
a
,
b
=
b
,
eval_len
=
eval_len
,
skip_memory_metrics
=
False
)
metrics
=
trainer
.
evaluate
()
metrics
=
trainer
.
evaluate
()
del
trainer
del
trainer
...
@@ -1632,7 +1632,7 @@ class TrainerIntegrationTest(TestCasePlus, TrainerIntegrationCommon):
...
@@ -1632,7 +1632,7 @@ class TrainerIntegrationTest(TestCasePlus, TrainerIntegrationCommon):
# perfect world: fp32_eval == close to zero
# perfect world: fp32_eval == close to zero
self
.
assertLess
(
fp32_eval
,
5_000
)
self
.
assertLess
(
fp32_eval
,
5_000
)
# 2. with
mem metrics dis
abled
# 2. with
bf16_full_eval en
abled
trainer
=
get_regression_trainer
(
a
=
a
,
b
=
b
,
eval_len
=
eval_len
,
bf16_full_eval
=
True
,
skip_memory_metrics
=
False
)
trainer
=
get_regression_trainer
(
a
=
a
,
b
=
b
,
eval_len
=
eval_len
,
bf16_full_eval
=
True
,
skip_memory_metrics
=
False
)
metrics
=
trainer
.
evaluate
()
metrics
=
trainer
.
evaluate
()
bf16_init
=
metrics
[
"init_mem_gpu_alloc_delta"
]
bf16_init
=
metrics
[
"init_mem_gpu_alloc_delta"
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment