Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1875, #1871. Also includes a change so that pickled files can be loaded by
np.load
inmulti_mnist
, which would otherwise throw ValueError when we try to load already downloaded dataset in the AIR example. See this notice.Caveat: This changes the Makefile default so that
make test
does not run pytest in a distributed setting. Doing so can lead to race conditions as pointed out by @null-a when multiple subprocesses running the same example (with different arguments, for instance) try to download the dataset to the same directory.The ideal way to handle this would be by grouping some tests to run on the same worker in xdist. The support for such a feature is lacking. See: pytest-dev/pytest-xdist#365, pytest-dev/pytest-xdist#18. There are other alternatives that we can explore too - including grouping same examples into test classes and using LoadScope scheduler, or having a script that downloads and populates the datasets for all examples before distributing the tests.
I am however not sure if
make test-examples
is used that often locally that this is worth optimizing for, and have therefore opted for the simplest solution that wouldn't give unexpected results to new users. Existing users who already have datasets populated locally can always distribute the tests if they so like. Suggestions on alternatives are welcome.