-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Add Dali MNIST example #3721
Add Dali MNIST example #3721
Conversation
Hello @irustandi! Thanks for updating this PR.
Comment last updated at 2020-11-06 13:45:49 UTC |
Codecov Report
@@ Coverage Diff @@
## master #3721 +/- ##
======================================
+ Coverage 93% 93% +1%
======================================
Files 116 116
Lines 8883 8815 -68
======================================
- Hits 8233 8225 -8
+ Misses 650 590 -60 |
Can you run
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add test as calling this CLI in examples/test_...py
Changes made as requested. Need to make sure that DALI (with the appropriate CUDA version) is available in the test environment. How can we do this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be nice to add some short docstrings to the class instead of general comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls add the package to the requirements
probably it has to be compiled from the source... https://docs.nvidia.com/deeplearning/dali/user-guide/docs/compilation.html
A couple of questions regarding this. According to DALI doc, I would need to install it like this:
How can I add it to requirements in this case? And also, is CUDA 10 OK? |
may be linked that I do not have gpu... |
With --extra-index-url added to requirements/examples.txt, the CI complete testing can get past the dependency installation step, however, it fails in the actual test since CUDA does not seem to be available (libcuda.so is missing). Also, DALI does not seem to be supported in Windows and Mac. Install pkg fails because the --extra-index-url line is somehow is not the expected format. |
To go forward on this, I see the following needs at the very least:
Let me know how I should proceed. |
@irustandi sure, that is what I wanted to suggest, mark the test as GPU needed and then we need to include Dali in our CUDA Docker image |
This pull request is now in conflict... :( |
requirements/examples.txt
Outdated
gym>=0.17.0 | ||
nvidia-dali --extra-index-url https://developer.download.nvidia.com/compute/redist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we shall install it at least on our Docker image from the source
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/c1/fc_9d4b10c1cwmsm0l6cgzxc0000gn/T/pip-install-xo27f9qp/nvidia-dali-cuda100/setup.py", line 150, in <module>
raise RuntimeError(open("ERROR.txt", "r").read())
RuntimeError:
###########################################################################################
The package you are trying to install is only a placeholder project on PyPI.org repository.
This package is hosted on NVIDIA Python Package Index.
This package can be installed as:
```
$ pip install nvidia-pyindex
$ pip install nvidia-dali-cuda100
```
Please refer to NVIDIA DALI installation guide for instructions:
https://docs.nvidia.com/deeplearning/dali/user-guide/docs/installation.html
###########################################################################################
cc: @ydcjeff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we won't be able to include this as a requirement here, but I think I'll add a note in the docs
.drone.yml
Outdated
@@ -32,6 +32,7 @@ steps: | |||
- pip --version | |||
- nvidia-smi | |||
- pip install -r ./requirements/devel.txt --upgrade-strategy only-if-needed -v --no-cache-dir | |||
- pip install --extra-index-url https://developer.download.nvidia.com/compute/redist nvidia-dali-cuda100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testing now if the example runs, later we shall add it to the used docker image
Let's wait till all tests are passing, some weirdness with one job... |
correct me if I'm wrong, this PR does not add any additional support for Dali, it only adds examples. Consider renaming the PR title. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR ! minors changes.
Thanks @irustandi for the work, apologies on the delay. NVIDIA DALI is awesome, hoping to see more integration into loaders :) |
* add MNIST DALI example, update README.md * Fix PEP8 warnings * reformatted using black * add mnist_dali to test_examples.py * Add documentation as docstrings * add nvidia-pyindex and nvidia-dali-cuda100 * replace nvidia-pyindex with --extra-index-url * mark mnist_dali test as Linux and GPU only * adjust CUDA docker and examples.txt, fix import error in test_examples.py * adjust the GPU check * Exit when DALI is not available * remove requirements-examples.txt and DALI pip install * Refactored example, moved to new logging api, added runtime check for test and dali script * Patch to reflect the mnist example module * add req. * Apply suggestions from code review * Removed requirement as it breaks CPU install, added note in README to install DALI * add DALI to Drone * test examples * Apply suggestions from code review * imports * ABC * cuda * cuda * pip DALI * Move build into init function Co-authored-by: SeanNaren <[email protected]> Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: Sean Naren <[email protected]>
What does this PR do?
Add a modification of the MNIST example using NVIDIA DALI.
Fixes #791
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃