-
Notifications
You must be signed in to change notification settings - Fork 5
Add pytest filtering markers for GPU to improve workflows #72
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
Draft
liweintu
wants to merge
16
commits into
main
Choose a base branch
from
pytest-mark-for-cuda-availability
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
6dee5c5
Add conftest.py as a placeholder. TODO: add filtering markers for GPU
abafa6d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 3be3038
Adding conftest.py
597ae84
Updaing cutensornet.py
cf8f1e9
Updating workflow files for cuda aware pytest
0bbb7c3
Updating workflow files
e1e9b91
Updating workflow files
e8dee44
Updating workflow files
490f0ec
adding codecov.yml
3a6d6e0
updaing yml files
2694731
updaing yml files
b2bea9f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] f571fc5
Avoid dependency on qibojit by explicitly specifying numpy as the bac…
liweintu f5702dd
Removing qibojit dependency
095961c
Removing config file
434932a
Removing qibojit
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Reference docs at https://docs.codecov.com/docs/codecovyml-reference | ||
|
|
||
| codecov: | ||
| require_ci_to_pass: yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| """To skip the pytests marked with gpu.""" | ||
|
|
||
| import os | ||
|
|
||
| import pytest | ||
|
|
||
| tt = os.system("nvidia-smi") | ||
|
|
||
|
|
||
| def pytest_runtest_setup(item): | ||
| if tt != 0: | ||
| for marker in item.iter_markers(name="gpu"): | ||
| pytest.skip(f"test requires gpu") | ||
|
|
||
|
|
||
| """Pytest fixtures. | ||
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that's even fine by me, but maybe you wanted to change
qibotn/tests/config.py
Line 11 in f571fc5
Otherwise, you can decide to drop that file, and inline the values in the tests (that is a pretty good option).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can drop that file as it is doing nothing. Need to modify cuquantum side also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I like the latter option because it explicitly avoids the dependency on
qibojit.