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

This PR adds support to call kernels in CUDA from v2 Awkward Arrays. #1276

Merged
merged 20 commits into from
Feb 14, 2022

Conversation

findingmochi
Copy link
Collaborator

@findingmochi findingmochi commented Feb 3, 2022

Tasks to complete:

  • Implement copy_to for all array classes
  • Implement to_backend and backend(*arrays)
  • Write a minimal test using ak.num
  • Call a kernel whose implementation is not in CUDA and see if it's being handled correctly.
    - [ ] Don't upload artifacts during CI testing.

@codecov
Copy link

codecov bot commented Feb 3, 2022

Codecov Report

Merging #1276 (47c5e8b) into main (8e68200) will increase coverage by 1.27%.
The diff coverage is 74.82%.

Impacted Files Coverage Δ
src/awkward/_v2/_connect/numba/arrayview.py 96.24% <ø> (ø)
src/awkward/_v2/_connect/numba/layout.py 87.01% <ø> (ø)
src/awkward/_v2/operations/convert/ak_from_cupy.py 25.00% <0.00%> (-50.00%) ⬇️
src/awkward/_v2/operations/structure/ak_isclose.py 100.00% <ø> (ø)
src/awkward/_v2/operations/convert/ak_to_cupy.py 8.19% <3.44%> (-66.81%) ⬇️
src/awkward/_v2/operations/describe/ak_backend.py 9.52% <9.52%> (ø)
src/awkward/_v2/contents/unmaskedarray.py 54.95% <25.00%> (-1.12%) ⬇️
...c/awkward/_v2/operations/describe/ak_to_backend.py 37.50% <37.50%> (ø)
src/awkward/_v2/contents/indexedarray.py 58.62% <38.23%> (-2.03%) ⬇️
src/awkward/_v2/operations/io/ak_to_json_file.py 47.05% <43.75%> (-27.95%) ⬇️
... and 49 more

@findingmochi findingmochi marked this pull request as draft February 3, 2022 16:18
@findingmochi
Copy link
Collaborator Author

The functions _getitem_next*(many _getitem_next_jagged) are passing mixed nplike because I think they are passing slices and slices are Numpy nplike through and through, but when the typetracers tests come in, these two nplikes get mixed and hence they raise the assertion errors introduced in Wednesday's refactoring.

For now, I have commented out the assertions and they should be easy to find by doing a fgrep -rl "# assert" src.

Also, now to has been replaced by raw and ak.to_cupy and ak.from_cupy functions have also have been implemented.

@findingmochi findingmochi marked this pull request as ready for review February 11, 2022 11:54
Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

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

It's fantastic that this is working! On review, I found a few organizational things that, fixing them now, will save us trouble later. See the inline comments.

Thanks!

src/awkward/_cuda_kernels.py Outdated Show resolved Hide resolved
src/awkward/_v2/_util.py Outdated Show resolved Hide resolved
src/awkward/_v2/contents/listarray.py Outdated Show resolved Hide resolved
src/awkward/_v2/contents/listoffsetarray.py Outdated Show resolved Hide resolved
src/awkward/_v2/contents/content.py Outdated Show resolved Hide resolved
src/awkward/_v2/contents/regulararray.py Outdated Show resolved Hide resolved
src/awkward/_v2/index.py Outdated Show resolved Hide resolved
src/awkward/nplike.py Outdated Show resolved Hide resolved
src/awkward/nplike.py Outdated Show resolved Hide resolved
@findingmochi findingmochi enabled auto-merge (squash) February 14, 2022 15:08
@findingmochi findingmochi merged commit aaded1c into main Feb 14, 2022
@findingmochi findingmochi deleted the swishdiff/v2-cuda branch February 14, 2022 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants