Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[tests] Speed up test_unlikelihood #3605

Merged
merged 1 commit into from Apr 19, 2021
Merged

[tests] Speed up test_unlikelihood #3605

merged 1 commit into from Apr 19, 2021

Conversation

stephenroller
Copy link
Contributor

Patch description
Slow tests be slow. Drop a few redundant tests (identical models that only differed in a hyperparameter from the paper), delete tests that were being skipped, and significantly reduce computation in the others.

Testing steps

Before:

136.48s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_train_model_repeat_ul
136.43s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_train_model_vocab_ul
107.48s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_vocab_alpha1e3
100.23s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_vocab_alpha1e2
61.46s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_repeat_wiki_labelonly
59.10s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_repeat_wiki_contextandlabel
57.25s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_repeat_wiki_contextonly
39.91s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_vocab_alpha1e0
38.64s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_vocab_alpha1e1
27.01s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_repeat_convai_contextandlabel
======= 12 passed, 3 skipped, 113 warnings in 811.53s (0:13:31) =======

After:

$ pytest tests/nightly/gpu/test_unlikelihood.py
tests/nightly/gpu/test_unlikelihood.py .......... [100%]

56.96s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_train_model_vocab_ul
32.12s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_repeat_wiki_contextandlabel
30.61s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_repeat_wiki_contextonly
28.69s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_repeat_wiki_labelonly
12.26s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_vocab_alpha1e0
11.91s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_train_model_repeat_ul
11.86s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_vocab_alpha1e1
11.39s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_repeat_convai_contextandlabel
7.30s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_repeat_convai_contextonly
7.14s call     tests/nightly/gpu/test_unlikelihood.py::TestUnlikelihood::test_repeat_convai_labelonly
======= 10 passed, 113 warnings in 213.02s (0:03:33) =======

Copy link
Contributor

@jxmsML jxmsML left a comment

Choose a reason for hiding this comment

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

lgtm

@stephenroller stephenroller merged commit 1fa2029 into master Apr 19, 2021
@stephenroller stephenroller deleted the speed_test_unlike branch April 19, 2021 17:12
@EricMichaelSmith
Copy link
Contributor

Yeah makes sense - great fix!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants