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

docs: add Numba CUDA guide (#2260) #2260

Merged
merged 14 commits into from
Mar 3, 2023
Merged

docs: add Numba CUDA guide (#2260) #2260

merged 14 commits into from
Mar 3, 2023

Conversation

ianna
Copy link
Collaborator

@ianna ianna commented Feb 21, 2023

No description provided.

@ianna ianna changed the title doc: add Numba CUDA guide docs: add Numba CUDA guide Feb 21, 2023
@ianna
Copy link
Collaborator Author

ianna commented Feb 21, 2023

@agoose77 - I'm not sure if I need to link it. Please, have a look. Thanks!

@codecov
Copy link

codecov bot commented Feb 21, 2023

Codecov Report

Merging #2260 (93b5226) into main (ef3e2a9) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

❗ Current head 93b5226 differs from pull request most recent head a06ce43. Consider uploading reports for the commit a06ce43 to get more accurate results

Additional details and impacted files
Impacted Files Coverage Δ
src/awkward/numba.py 93.87% <100.00%> (ø)
src/awkward/_util.py 74.42% <0.00%> (-0.58%) ⬇️
src/awkward/forms/unionform.py 81.95% <0.00%> (-0.14%) ⬇️
src/awkward/typing.py 83.33% <0.00%> (ø)
src/awkward/__init__.py 97.14% <0.00%> (ø)
src/awkward/operations/__init__.py 100.00% <0.00%> (ø)
src/awkward/operations/ak_almost_equal.py 94.54% <0.00%> (ø)
src/awkward/operations/ak_broadcast_fields.py
src/awkward/contents/recordarray.py 84.77% <0.00%> (+0.07%) ⬆️

@agoose77
Copy link
Collaborator

We need to think about how to deploy these docs; we don't have a CUDA-enabled runner currently in-action. My current thinking is that we might be able to deploy only the CUDA docs from e.g. a scheduled CUDA worker. This would push an .ipynb to our repo, so that we can build the rest of docs with our normal CI such that they are always in sync with main.

It's not a perfect solution, and for now we can just do this manually.

@agoose77
Copy link
Collaborator

@ianna I changed the result to be a CuPy array instead of Numba. The reason for this is that backend="cuda" uses CuPy under the hood (so it's already a required dependency for zero-copy CUDA use), CuPy arrays can be passed directly into ak.Array, and they also have nice reprs. We might want to make ak.Array et al. understand how to consume __cuda_array_interface__ so that ak.Array can consume Numba's DeviceArray, but that's another PR :)

@agoose77 agoose77 temporarily deployed to docs-preview February 26, 2023 16:51 — with GitHub Actions Inactive
@ianna
Copy link
Collaborator Author

ianna commented Feb 27, 2023

@ianna I changed the result to be a CuPy array instead of Numba. The reason for this is that backend="cuda" uses CuPy under the hood (so it's already a required dependency for zero-copy CUDA use), CuPy arrays can be passed directly into ak.Array, and they also have nice reprs. We might want to make ak.Array et al. understand how to consume __cuda_array_interface__ so that ak.Array can consume Numba's DeviceArray, but that's another PR :)

I'm actually updating the PR with a better example :-)

@jpivarski
Copy link
Member

I'm actually updating the PR with a better example :-)

I didn't notice this before I clicked "Update branch", so be sure to git pull.

(I wanted to see if the "Build Docs" failure is the same everywhere, or if it's only in #2268.)

@agoose77 agoose77 temporarily deployed to docs-preview February 28, 2023 23:32 — with GitHub Actions Inactive
@jpivarski jpivarski mentioned this pull request Mar 1, 2023
5 tasks
@ianna ianna temporarily deployed to docs-preview March 2, 2023 11:37 — with GitHub Actions Inactive
@ianna ianna temporarily deployed to docs-preview March 2, 2023 12:46 — with GitHub Actions Inactive
@ianna ianna temporarily deployed to docs-preview March 2, 2023 13:33 — with GitHub Actions Inactive
@ianna ianna temporarily deployed to docs-preview March 2, 2023 15:41 — with GitHub Actions Inactive
@ianna ianna requested a review from jpivarski March 2, 2023 16:08
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.

I streamlined the text and code samples to make them easier to learn from. But on the whole, it's a very good tutorial!

I'm assuming that the reason it's a notebook (ipynb file) rather than Jupytest (md file) is because it must not be allowed to run on the CI, due to the dependence on a GPU. If that's the reason, it makes sense to me.

Feel free to merge it when you're ready.

@jpivarski jpivarski temporarily deployed to docs-preview March 2, 2023 21:14 — with GitHub Actions Inactive
@agoose77
Copy link
Collaborator

agoose77 commented Mar 2, 2023

Yes, the file is an ipynb so that the outputs can be stored in the notebook. There is discussion around extending the scope of text based notebooks in future, but for our purposes this works :)

Copy link
Collaborator Author

@ianna ianna left a comment

Choose a reason for hiding this comment

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

@jpivarski - thanks, it looks great! I don't know why the tests are not finished - but before they do I cannot merge it.

@agoose77 agoose77 changed the title docs: add Numba CUDA guide docs: add Numba CUDA guide (#2260)Co-authored-by: Angus Hollands <[email protected]> Co-authored-by: Jim Pivarski <[email protected]> Co-authored-by: Jim Pivarski <[email protected]> Mar 3, 2023
@agoose77 agoose77 merged commit 11bb54f into main Mar 3, 2023
@agoose77 agoose77 deleted the ianna/cuda-numba-docs branch March 3, 2023 16:04
@agoose77
Copy link
Collaborator

agoose77 commented Mar 3, 2023

Tests don't run for non-code changes! I can merge this, then :)

@jpivarski jpivarski changed the title docs: add Numba CUDA guide (#2260)Co-authored-by: Angus Hollands <[email protected]> Co-authored-by: Jim Pivarski <[email protected]> Co-authored-by: Jim Pivarski <[email protected]> docs: add Numba CUDA guide (#2260) Mar 8, 2023
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.

3 participants