Skip to content

ci: modified test suite to run on cupy#660

Merged
mrava87 merged 4 commits into
PyLops:devfrom
mrava87:test-cupy2
May 27, 2025
Merged

ci: modified test suite to run on cupy#660
mrava87 merged 4 commits into
PyLops:devfrom
mrava87:test-cupy2

Conversation

@mrava87
Copy link
Copy Markdown
Collaborator

@mrava87 mrava87 commented Apr 27, 2025

This PR modifies the entire test suite to run tests both using the numpy and cupy backends.

An environment variable called TEST_CUPY_PYLOPS is used to select whether to run the tests with the numpy (0) or the cupy (1) backends.

Basically one can run tests with the following commands:

# numpy
export CUPY_PYLOPS=0; export TEST_CUPY_PYLOPS=0; pytest
# cupy
export CUPY_PYLOPS=1; export TEST_CUPY_PYLOPS=1; pytest

where the first two exports aren't really needed if cupy isn't installed.

Additional requirements and environment files are provided to create cupy-enable Python environments for the CI.

@mrava87 mrava87 requested a review from cako April 28, 2025 07:31
@mrava87
Copy link
Copy Markdown
Collaborator Author

mrava87 commented Apr 28, 2025

@cako as I previously mentioned, with the help of @hongyx11 we are trying to create a self-hosted CI to test our cupy backend for the operators and solvers. Since this CI would require access to a GPU, Yuxi has kindly offered to host in on Perlmutter using a similar setup that he has in place for another project.

Would you have time to have a quick look at this PR; it is pretty boring as most code changes are as explained above to allow switching between numpy and cupy via an environment variable. However, whilst going through this refractoring of the tests, I also found a few small bugs #657 #658 #659 (always good to fix things...)

@hongyx11, I guess we need this merged before we can try together to set up the self-hosted runner, right?

@mrava87 mrava87 added the CI Test suite and CI label May 27, 2025
@mrava87
Copy link
Copy Markdown
Collaborator Author

mrava87 commented May 27, 2025

@hongyx11, this has been quite for a while... I guess I can merge it and we make a new PR once we have the Github action working for the self-hosted runner 😄

@mrava87 mrava87 merged commit f94d550 into PyLops:dev May 27, 2025
15 checks passed
@mrava87 mrava87 deleted the test-cupy2 branch May 27, 2025 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Test suite and CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant