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

Run Python OP tests in a single Python process to improve test time. #8286

Closed
wants to merge 2 commits into from

Conversation

helinwang
Copy link
Contributor

@helinwang helinwang commented Feb 8, 2018

Currently, our tests run with 2 GPUs, the init time is absurdly long: about 4s for each process.
Currently, we run each OP test on different processes. This PR:

  1. create cmake function py_test_modules which will generate the Makefile that runs a list of Python unittest module in a single Python process.
  2. move all "python unittest compatible" (e.g., used the unittest package, not just a regular python file). from fluid/tests to fluid/tests/unittests.
  3. cmake now will run all OP tests in fluid/tests/unittests in a single process, except the time-consuming tests, they are separated into different processes to utilize parallelism. Please make sure to use the unittest package if you put the python test file in fluid/tests/unittests
  4. remove all exit(0) from fluid/tests/unittests/*.py, exit(0) is used to disable unittest, we can not do it when running all tests in a single process since it will terminate the process without running the other tests. Instead, the test is disabled in fluid/tests/unittests/CMakeLists.txt. FIXME is added for each disabled item. Please disable the unittest from fluid/tests/unittests/CMakeLists.txt, instead of adding exit(0) to the Python file, for all Python file in fluid/tests/unittests/.

@helinwang helinwang force-pushed the stash branch 2 times, most recently from 991fa02 to 53c1376 Compare February 8, 2018 23:25
@helinwang helinwang changed the title run Python OP tests in a single Python process to save init times Run Python OP tests in a single Python process to improve test time. Feb 9, 2018
@helinwang helinwang force-pushed the stash branch 2 times, most recently from f3b1e59 to 065c9ee Compare February 9, 2018 01:59
@helinwang
Copy link
Contributor Author

Still testing if this solution works, would love to have some initial feedback: @typhoonzero @reyoung @qingqing01 @dzhwinter @luotao1

Currently, our tests run with 2 GPUs, the init time is absurdly long:
about 4s for each process.  Currently, we run each OP test on
different processes. This PR:

1. create cmake function py_test_modules which will generate the
Makefile that runs a list of Python unittest module in a single Python
process.

1. move all "python unittest compatible" (e.g., used the unittest
package, not just a regular python file). from fluid/tests to
fluid/tests/unittests.

1. cmake now will run all OP tests in fluid/tests/unittests in a
single process, except the time-consuming tests, they are separated
into different processes to utilize parallelism. Please make sure to
use the unittest package if you put the python test file in
fluid/tests/unittests

1. remove all exit(0) from fluid/tests/unittests/*.py, exit(0) is used
to disable unittest, we can not do it when running all tests in a
single process since it will terminate the process without running the
other tests. Instead, the test is disabled in
fluid/tests/unittests/CMakeLists.txt. FIXME is added for each disabled
item. Please disable the unittest from
fluid/tests/unittests/CMakeLists.txt, instead of adding exit(0) to the
Python file, for all Python file in fluid/tests/unittests/.
@CLAassistant
Copy link

CLAassistant commented Feb 10, 2018

CLA assistant check
All committers have signed the CLA.

@helinwang
Copy link
Contributor Author

Done by #8362 , some of the commits in this PR is transferred to that PR.

@helinwang helinwang closed this Feb 21, 2018
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.

3 participants