Skip to content

Use pytest-forked for tensorflow tests#10151

Closed
driazati wants to merge 2 commits intoapache:mainfrom
driazati:forkd
Closed

Use pytest-forked for tensorflow tests#10151
driazati wants to merge 2 commits intoapache:mainfrom
driazati:forkd

Conversation

@driazati
Copy link
Member

@driazati driazati commented Feb 2, 2022

This auto-marks all tensorflow frontend tests with pytest.mark.forked, which tells pytest to run each test in a subprocess rather than in the main test process. Hopefully this will help alleviate #10150 as the memory used should be released when the test subprocess ends.

Tested locally by running a tensorflow test then ps -aef --forest and confirming that with the decorator a subprocess is spawned.

cc @areusch @altanh @tkonolige

@areusch
Copy link
Contributor

areusch commented Feb 2, 2022

this looks pretty good, let's see how it does in CI

@junrushao
Copy link
Member

This is great improvement!

This auto-marks all tensorflow frontend tests with `pytest.mark.forked`, which tells pytest to run each test in a subprocess rather than in the main test process. Hopefully this will help alleviate #10150 as the memory used should be released when the test subprocess ends.

Tested locally by running a tensorflow test then `ps -aef --forest` and confirming that with the decorator a subprocess is spawned.

cc @areusch @altanh @tkonolige
masahi pushed a commit that referenced this pull request Feb 10, 2022
* [ci] Invoke tensorflow tests individually

This is another (simpler) attempt at #10151 to avoid CUDA issues with tensorflow tests. This should work by cleaning up any reserved GPU memory by tearing down the whole process that has imported tensorflow each time a test is run.

* [ci] Invoke tensorflow tests individually

Copy of #10197 but using a pytest plugin instead of manually grepping through test files

Co-authored-by: driazati <driazati@users.noreply.github.com>
alnah005 pushed a commit to alnah005/tvm that referenced this pull request Feb 10, 2022
* [ci] Invoke tensorflow tests individually

This is another (simpler) attempt at apache#10151 to avoid CUDA issues with tensorflow tests. This should work by cleaning up any reserved GPU memory by tearing down the whole process that has imported tensorflow each time a test is run.

* [ci] Invoke tensorflow tests individually

Copy of apache#10197 but using a pytest plugin instead of manually grepping through test files

Co-authored-by: driazati <driazati@users.noreply.github.com>
@driazati driazati closed this Feb 10, 2022
ylc pushed a commit to ylc/tvm that referenced this pull request Feb 16, 2022
* [ci] Invoke tensorflow tests individually

This is another (simpler) attempt at apache#10151 to avoid CUDA issues with tensorflow tests. This should work by cleaning up any reserved GPU memory by tearing down the whole process that has imported tensorflow each time a test is run.

* [ci] Invoke tensorflow tests individually

Copy of apache#10197 but using a pytest plugin instead of manually grepping through test files

Co-authored-by: driazati <driazati@users.noreply.github.com>
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