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

CI: run doctests only on GPU machine #2098

Closed
awaelchli opened this issue Jun 6, 2020 · 6 comments
Closed

CI: run doctests only on GPU machine #2098

awaelchli opened this issue Jun 6, 2020 · 6 comments
Labels
ci Continuous Integration feature Is an improvement or enhancement help wanted Open to be worked on

Comments

@awaelchli
Copy link
Member

awaelchli commented Jun 6, 2020

Currently the doctests run on CPU and GPU but we can't include any GPU related doctests, otherwise they would fail on CPU-only machines.

I propose to turn off CI doctests for CPU-only machines and only let them run on machines with GPU (i.e. drone).

This would allow us to write doctests also for GPU related stuff.

@Borda

@awaelchli awaelchli added feature Is an improvement or enhancement help wanted Open to be worked on ci Continuous Integration labels Jun 6, 2020
@Borda
Copy link
Member

Borda commented Jun 6, 2020

I would rather have doctest that would work on both CPU and GPU as it allows anyone to run all test suite locally and move GPU test in docstring to code samples (or find a way to run then under conditions of GPU)

@awaelchli
Copy link
Member Author

awaelchli commented Jun 7, 2020

I understand, but it will block us of writing doctests for many things. For example here: #1905 I would like a doctest as an example how it works, but it is impossible if the CI fails when no gpus are found.

@awaelchli
Copy link
Member Author

awaelchli commented Jun 7, 2020

or find a way to run then under conditions of GPU

I have not found a way. It seem impossible with pytest to skip conditionally like in the other tests.

@Borda
Copy link
Member

Borda commented Jun 7, 2020

I understand, but it will block us of writing doctests for many things. For example here: #1905 I would like a doctest as an example how it works, but it is impossible if the CI fails when no gpus are found.

I understand, but unfortunately, I do not see any other solution for now as doctests supports only +SKIP not skipif, see the docs https://docs.python.org/3/library/doctest.html#option-flags

@awaelchli
Copy link
Member Author

😢 that's a bummer. I wonder how PyTorch does it?
not sure, but probably this is an unsolvable problem if we want to keep it everywhere in CI. So shall I close the issue then?

@Borda
Copy link
Member

Borda commented Jun 7, 2020

Actually they may not run it and ignore some files in pytest without GPU...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous Integration feature Is an improvement or enhancement help wanted Open to be worked on
Projects
None yet
Development

No branches or pull requests

2 participants