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
Do not bundle cuDNN / NCCL for all wheel packages starting in CuPy v9 #4850
Comments
As we discussed earlier today on our call, could we extend this effort to conda packages, effectively making cuDNN an optional install rather than a requirement? |
@pentschev This is totally doable (cc: @jakirkham). Do you mind opening up an issue in https://github.com/conda-forge/cupy-feedstock so we can track this need there? |
Sorry, I spoke too fast. There is a tiny bit of work that needs to be done in CuPy, namely how to detect the absence of optional dependencies (cudnn/nccl/cutensor) and ask users to install them through Conda. We already have a mechanism to recommend doing |
So what happens when |
I filed conda-forge/cupy-feedstock#109 for that @leofang |
Currently, wheels use library metadata (in JSON) which is generated and bundled during the wheel build process. Warnings are displayed using the metadata as follows: We can extend the metadata format to support conda packages. Then conda build process can generate metadata and bundle it with CuPy distributions. (FYI we use How about adding |
Yeah that makes a lot of sense (though I think Leo and yourself are more familiar with the internal details in CuPy) When Conda-Build is running, it sets the |
We can just add the metadata to the conda recipe by hand, as I tried once (conda-forge/cupy-feedstock#75), it's not difficult. What could be potentially concerning is runtime version pinning. How restrictive is it if CuPy builds with library vX.Y, but later on Conda-Forge we release vX.Z (with Z > Y)? I suppose all optional CUDA libraries (cuDNN, NCCL, cuTENSOR) are stable enough to follow version semantics, so this is not a big concern in reality? But then we need to ignore the version spec in the json metadata, am I right @kmaehashi? (If I understand the metadata correctly, https://github.com/cupy/cupy/blob/v9.0.0b3/cupy/_environment.py#L22-L48, it pins at a particular version.) |
FYI the pinning is done here for cuDNN: cupy/cupyx/tools/install_library.py Lines 53 to 81 in aeea482
cuTENSOR and NCCL (#4848) are done in the same file, just scroll down a bit. |
I think there's no problem at API/ABI level. cuDNN won't remove old API in the same major version (docs). That being said, it seems other projects are pinning at vX.Y level (but not vX.Y.0 level)?
For conda packages, no preloading ( |
I am less certain about how Anaconda pins these dependencies, but on Conda-Forge we pin cuDNN at major version for CUDA 10.2+:
Same applies to cuTENSOR and NCCL:
Ah I see, thanks @kmaehashi. I took a closer look and you are right. This makes things much simper! See #4873, in which I followed your earlier suggestion:
|
How did you build cupy wheel without cudnn support? from doc
in other words, if we have cudnn library, it would be enable when building the wheel. How did you build cuda only wheel? |
Currently, there's no way to programmatically force building without cuDNN when it is available. You can comment out this line: cupy/install/cupy_builder/_modules.py Line 381 in 704f87e
or, you can make a faulty dummy header so that CuPy does not recognize cuDNN as available.
|
We have been distributing binary packages (
cupy-cudaXXX
) via PyPI. However recently the size of GPU-related packages (including CuPy) is starting to cause a problem on PyPI (see discussions on Python forum).We take this problem seriously, and to help PyPI ecosystem healthy, we are planning to stop bundling cuDNN / NCCL shared libraries from all wheels, starting in v9 releases.
Note that cuDNN / NCCL are still supported and enabled in wheels, but users who want to use these features need to install the library via
python -m cupyx.tools.install_library
command.FYI, here are our past efforts to reduce the package size on PyPI:
The text was updated successfully, but these errors were encountered: