-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add pytest filtering markers for GPU to improve workflows #72
base: main
Are you sure you want to change the base?
Conversation
95a57e7
to
597ae84
Compare
39dc209
to
cf8f1e9
Compare
a43d54f
to
0bbb7c3
Compare
efe21eb
to
e1e9b91
Compare
45b0e34
to
e8dee44
Compare
27b70bc
to
490f0ec
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #72 +/- ##
==========================================
- Coverage 33.13% 9.92% -23.22%
==========================================
Files 3 10 +7
Lines 172 393 +221
==========================================
- Hits 57 39 -18
- Misses 115 354 +239
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
9cb70fc
to
3a6d6e0
Compare
207ce6a
to
2694731
Compare
for more information, see https://pre-commit.ci
The pytest mark filtering can work and pass now. But the CI encountered a permission issue when running the following
|
@liweintu I have reset the codecov token and now tests are working. |
Thanks @scarrazza! Now all checks can pass, we'll proceed to review and merge this PR. |
pyproject.toml
Outdated
@@ -26,6 +26,7 @@ quimb = { version = "^1.6.0", extras = ["tensor"] } | |||
cupy-cuda11x = { version = "^11.6.0", optional = true } | |||
cuquantum-python-cu11 = { version = "^23.3.0", optional = true } | |||
mpi4py = { version = "^3.1.5", optional = true } | |||
qibojit = { git = "https://github.com/qiboteam/qibojit.git" } |
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.
Why is Qibotn now depending on Qibojit?
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.
Qibotn had qibojit dependency earlier in the tests. So far we were installing qibojit seperately. Since, the previous version of workflow was skipping tests it was not an issue in github actions. But, now in the absence of qibojit tests will fail.
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.
But you should not run tests on Qibojit, since you're explicitly testing another backend (i.e. Qibotn).
Could you point me to the logs where tests are failing?
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.
I guess the question here is "Does Qibotn need to depend on Qibojit?". My quick answer is "No, it doesn't."
So I removed qibojit
package, ran pytest
, and encountered an error below.
# Test qibo
> qibo.set_backend(backend=config.qibo.backend, platform=config.qibo.platform)
tests/test_quimb_backend.py:45:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../miniforge3/envs/py311/lib/python3.11/site-packages/qibo/backends/__init__.py:150: in set_backend
GlobalBackend.set_backend(backend, **kwargs)
../../miniforge3/envs/py311/lib/python3.11/site-packages/qibo/backends/__init__.py:108: in set_backend
cls._instance = construct_backend(backend, **kwargs)
../../miniforge3/envs/py311/lib/python3.11/site-packages/qibo/backends/__init__.py:230: in construct_backend
raise_error(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
exception = <class 'ValueError'>
message = "The 'qibojit' backends' provider is not available. Check that a Python package named 'qibojit' is installed, and it is exposing valid Qibo backends."
I guess it's due to qibojit
being the first and default choice during backend construction. If my guess is correct, maybe we specify the backend to be numpy
for test cases of quimb
instead of using the default backend?
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.
I guess it's due to
qibojit
being the first and default choice during backend construction. If my guess is correct, maybe we specify the backend to benumpy
for test cases ofquimb
instead of using the default backend?
This is a known problem, already solved recently qiboteam/qibo#1430
The point is that you should not encounter that problem, since you should set Qibotn as the backend, and not relying on the default one.
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.
Okay, will modify the tests to remove the dependency
@@ -42,7 +42,7 @@ def test_eval(nqubits: int, tolerance: float, is_mps: bool): | |||
init_state_tn = copy.deepcopy(init_state) | |||
|
|||
# Test qibo | |||
qibo.set_backend(backend=config.qibo.backend, platform=config.qibo.platform) | |||
qibo.set_backend("numpy") |
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
Line 11 in f571fc5
qibo = Executor(backend="qibojit", platform="numpy") |
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
.
To address issue #28 , we add pytest filtering markers for GPU based on its availability.