Skip to content

Add back CuPy as an optional test dependency + Fix an example bug #334

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

Merged
merged 6 commits into from
Dec 30, 2024

Conversation

leofang
Copy link
Member

@leofang leofang commented Dec 30, 2024

This is the second attempt of adding CuPy as an optional test dependency (4494a27). Previously we could not do it because cupy.random.random() APIs (used in code samples) require cuRAND to exist and I did not want to inflate the cached CTK sizes. This PR switches to use the new random number generator, which does not require cuRAND (host library). It also has an additional benefit that we teach users to not use the legacy random APIs.

An example bug on CUDA 11 is exposed as a result of this PR, which is also fixed (#334 (comment)).

Copy link
Contributor

copy-pr-bot bot commented Dec 30, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@leofang
Copy link
Member Author

leofang commented Dec 30, 2024

/ok to test

@leofang
Copy link
Member Author

leofang commented Dec 30, 2024

/ok to test

@leofang leofang changed the title WIP Dec 30, 2024
@leofang
Copy link
Member Author

leofang commented Dec 30, 2024

/ok to test

@leofang leofang added P1 Medium priority - Should do CI/CD CI/CD infrastructure test Improvements or additions to tests cuda.core Everything related to the cuda.core module labels Dec 30, 2024
@leofang leofang added this to the cuda.core beta 3 milestone Dec 30, 2024
@leofang
Copy link
Member Author

leofang commented Dec 30, 2024

/ok to test

@leofang leofang self-assigned this Dec 30, 2024
@leofang leofang changed the title WIP: Add back CuPy as an optional test dependency Dec 30, 2024
@leofang leofang marked this pull request as ready for review December 30, 2024 04:50
Copy link
Contributor

@ksimpson-work ksimpson-work left a comment

Choose a reason for hiding this comment

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

I like everything you've done. I would perhaps change the title of the review or the commit message to make it more general like "CI requirements change and associated bugfixes"

@leofang leofang changed the title Add back CuPy as an optional test dependency Dec 30, 2024
@leofang
Copy link
Member Author

leofang commented Dec 30, 2024

I like everything you've done. I would perhaps change the title of the review or the commit message to make it more general like "CI requirements change and associated bugfixes"

Thanks, Keenan! Adding CuPy back is the main purpose of this PR. Everything else (updating/fixing the examples, adding test requirements, etc) are all done to serve this purpose, so as to make the CI green. I updated the PR description and title.

@leofang leofang merged commit 856662f into NVIDIA:main Dec 30, 2024
46 checks passed
@leofang leofang deleted the cupy branch December 30, 2024 05:11
@@ -300,9 +300,9 @@ jobs:
- name: Run cuda.core tests
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
if [[ $SKIP_CUDA_BINDINGS_TEST == 1 ]]; then
if [[ ${{ matrix.python-version }} == "3.13" ]]; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious, what was the motivation for switching the order of ifs around here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because I wrote this check and I got myself confused about what it meant. In a few weeks this part will be nuked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD CI/CD infrastructure cuda.core Everything related to the cuda.core module P1 Medium priority - Should do test Improvements or additions to tests
3 participants