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

CUDA 12 Support #1201

Merged
merged 7 commits into from
Jun 28, 2023
Merged

CUDA 12 Support #1201

merged 7 commits into from
Jun 28, 2023

Conversation

quasiben
Copy link
Member

@quasiben quasiben commented Jun 22, 2023

Adds CUDA 12 Support to build matrix

Fixes #1115

@quasiben quasiben requested a review from a team as a code owner June 22, 2023 16:58
@jakirkham
Copy link
Member

Thanks Ben! 🙏

Would suggest looking at the RMM CUDA 12 PR ( rapidsai/rmm#1223 ) and lining this up with that

@quasiben quasiben added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jun 22, 2023
@jakirkham
Copy link
Member

Think we may also want these GHA changes

Not seeing any environment files here

Also pyproject.toml, which the Conda recipe pulls from, doesn't appear to have any CUDA specific changes needed

So that may be it

@bdice
Copy link
Contributor

bdice commented Jun 22, 2023

I agree with all @jakirkham's suggestions above. Maybe also need updates for docs/source/install.rst?

@jakirkham
Copy link
Member

Thanks Bradley! 🙏

Good catch. Yeah this cudatoolkit here should be changed to cuda-version

https://github.com/rapidsai/dask-cuda/blame/83c64765ec6612cb7c04b077e30edf6f846d90e0/docs/source/install.rst#L19

@pentschev
Copy link
Member

I pushed GHA and docs changes.

@jakirkham @bdice could you check that the docs is correct, is that supposed to work for both CUDA 11.x and 12.x, or the correct way to document it is CUDA 11.x requires cudatoolkit=11.x and CUDA >= 12.x requires cuda-verison=12.x?

@pentschev
Copy link
Member

Also seems like cuCIM needs to be handled before Dask-CUDA.

@jakirkham
Copy link
Member

cuda-version should work on both CUDA 11 & 12

Ok could you please add cuCIM to the list in this issue ( #1115 )?

@pentschev
Copy link
Member

I'm not quite sure what's going on in the CUDA 12 tests, it seems Numba is failing to find NVVM files:

Traceback (most recent call last):
  File "<string>", line 7, in <module>
  File "/opt/conda/envs/test/lib/python3.10/site-packages/numba/cuda/cudadrv/runtime.py", line 111, in get_version
    self.cudaRuntimeGetVersion(ctypes.byref(rtver))
  File "/opt/conda/envs/test/lib/python3.10/site-packages/numba/cuda/cudadrv/runtime.py", line 65, in __getattr__
    self._initialize()
  File "/opt/conda/envs/test/lib/python3.10/site-packages/numba/cuda/cudadrv/runtime.py", line 51, in _initialize
    self.lib = open_cudalib('cudart')
  File "/opt/conda/envs/test/lib/python3.10/site-packages/numba/cuda/cudadrv/libs.py", line 63, in open_cudalib
    path = get_cudalib(lib)
  File "/opt/conda/envs/test/lib/python3.10/site-packages/numba/cuda/cudadrv/libs.py", line 55, in get_cudalib
    libdir = get_cuda_paths()[dir_type].info
  File "/opt/conda/envs/test/lib/python3.10/site-packages/numba/cuda/cuda_paths.py", line 223, in get_cuda_paths
    'nvvm': _get_nvvm_path(),
  File "/opt/conda/envs/test/lib/python3.10/site-packages/numba/cuda/cuda_paths.py", line 201, in _get_nvvm_path
    candidates = find_lib('nvvm', path)
  File "/opt/conda/envs/test/lib/python3.10/site-packages/numba/misc/findlib.py", line 44, in find_lib
    return find_file(regex, libdir)
  File "/opt/conda/envs/test/lib/python3.10/site-packages/numba/misc/findlib.py", line 56, in find_file
    entries = os.listdir(ldir)
FileNotFoundError: [Errno 2] No such file or directory: '/opt/conda/envs/test/nvvm/lib64'

@bdice @jakirkham do you know if we're missing something here? Also cc @gmarkall for Numba, in case you have suggestions.

@jakirkham
Copy link
Member

Yeah numba needs cuda-nvcc installed

This is needed to get nvvm, cudart & compilers

@pentschev
Copy link
Member

Yeah numba needs cuda-nvcc installed

This is needed to get nvvm, cudart & compilers

Shouldn't this be provided when Numba gets installed then? Note that it happens during a test, and I don't think Dask-CUDA should be requiring cuda-nvcc at runtime.

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting a small change to use cuda-version in dependencies.yaml.

@@ -59,6 +59,10 @@ dependencies:
cuda: "11.8"
packages:
- cudatoolkit=11.8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change all these entries like the example below? This is needed to constrain the CUDA version of the RAPIDS packages used for Python testing. (It may be possible to derive the correct constraint from a pin on cudatoolkit but that's going to be less direct for the environment solver.)

Suggested change
- cudatoolkit=11.8
- cuda-version=11.8
- cudatoolkit

@jakirkham
Copy link
Member

jakirkham commented Jun 27, 2023

Similar to ucx, which can operate without cudatoolkit, numba doesn't require cuda-nvcc (except when CUDA is used). So it is up to us to install this when we need it

Edit: Maybe we can handle this on the cuDF side

@pentschev
Copy link
Member

Similar to ucx, which can operate without cudatoolkit, numba doesn't require cuda-nvcc (except when CUDA is used). So it is up to us to install this when we need it

Edit: Maybe we can handle this on the cuDF side

Numba is an optional dependency, so the user will certainly need to satisfy that when using Numba+Dask-CUDA but without RAPIDS. I'm guessing we will want to update Numba's installation instructions for CUDA 12 too?

@jakirkham
Copy link
Member

Yeah that's a good idea. Could you please raise an issue on the Numba repo and cc me?

@pentschev
Copy link
Member

@jakirkham raised the issue in numba/numba#9045

@pentschev
Copy link
Member

Yeah numba needs cuda-nvcc installed

This is needed to get nvvm, cudart & compilers

Adding cuda-nvcc raised a different error now:

cuda-nvcc: Please add the `compiler("c")` and `compiler("cxx")` packages to the environment.

It seems that this can't be added as a runtime dependency, is that the case?

@jakirkham
Copy link
Member

Thanks Peter! 🙏

This could be worked around by adding the c-compiler & cxx-compiler packages. Alternatively cuda-compiler pulls both of them in for us

That said, it seems reasonable to harden this requirement in cuda-nvcc. Submitted upstream PR ( conda-forge/cuda-nvcc-feedstock#21 )

@pentschev
Copy link
Member

Thanks @jakirkham , after merging of conda-forge/cuda-nvcc-feedstock#21 all tests now pass! 😄

- cudatoolkit
- matrix:
cuda: "12.0"
packages:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need cuda-nvrtc for Numba?

Copy link

@gmarkall gmarkall Jun 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can get away without it if you're not linking .cu files with Python kernels or using float16. But for full functionality it should be present.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this suggestion below

Copy link
Member

@jakirkham jakirkham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Peter! 🙏

This is looking pretty good. Added a minor suggestion to include cuda-nvrtc based on the thread below

- cudatoolkit
- matrix:
cuda: "12.0"
packages:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this suggestion below

cuda: "12.0"
packages:
- cuda-version=12.0
- cuda-nvcc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- cuda-nvcc
- cuda-nvrtc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I understand of @gmarkall 's suggestion we don't need cuda-nvrtc given we're not doing any linkage whatsoever in Dask-CUDA, thus I think we should have only cuda-nvcc here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok will leave this here and we can revisit as needed

@jakirkham jakirkham changed the title [WIP] CUDA 12 Support CUDA 12 Support Jun 28, 2023
@jakirkham
Copy link
Member

/merge

@rapids-bot rapids-bot bot merged commit eafde5f into rapidsai:branch-23.08 Jun 28, 2023
22 checks passed
@jakirkham
Copy link
Member

Thanks all! 🙏

@pentschev
Copy link
Member

Thanks everyone for reviews! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dask-CUDA: CUDA 12 Conda Packages
6 participants