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

Allow for device agnostic testing #8223

Merged
merged 9 commits into from
Oct 31, 2023

Conversation

joao-alex-cunha
Copy link
Contributor

This PR changes the test suite to allow running the tests on any hardware.

The change is rather small and targets the tests that run both on the cpu and gpu. For these tests the decorator is changed to also read from a couple of environment variables that can specify the device and optionally the backend.
Using environment variables has the benefit of avoiding further changes to the code while also providing some degree of future proofing. If in the future new hardware vendors want to run the PyG test suite on their hardware they simply can use the environment variables.

Usage:
TORCH_DEVICE=some_new_hw TORCH_BACKEND=torch_new_hw pytest test

@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Merging #8223 (1445186) into master (1fb68b8) will decrease coverage by 0.70%.
Report is 1 commits behind head on master.
The diff coverage is 28.57%.

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

@@            Coverage Diff             @@
##           master    #8223      +/-   ##
==========================================
- Coverage   88.10%   87.41%   -0.70%     
==========================================
  Files         473      473              
  Lines       28644    28647       +3     
==========================================
- Hits        25238    25042     -196     
- Misses       3406     3605     +199     
Files Coverage Δ
torch_geometric/testing/decorators.py 84.88% <28.57%> (-4.99%) ⬇️

... and 35 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@rusty1s rusty1s changed the title Device agnostic testing Allow for device agnostic testing Oct 30, 2023
torch_geometric/testing/decorators.py Outdated Show resolved Hide resolved
@rusty1s rusty1s enabled auto-merge (squash) October 30, 2023 15:25
@rusty1s rusty1s merged commit 3eafd5d into pyg-team:master Oct 31, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants