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

pin quimb and numba versions to fix CI #6438

Merged
merged 5 commits into from
Feb 2, 2024
Merged

pin quimb and numba versions to fix CI #6438

merged 5 commits into from
Feb 2, 2024

Conversation

NoureldinYosri
Copy link
Collaborator

@NoureldinYosri NoureldinYosri commented Feb 1, 2024

fixes #6437

older versions of quimb use a numbda decorator that no longer exists. the recent release of quimb fixes that https://github.com/jcmgray/quimb/blob/0f9db3f7b81e50375b5001296bfc2b767a7e557d/docs/changelog.md however it breaks tests in /contrib/quimb so will pin the versions for now.

@CirqBot CirqBot added the Size: XS <10 lines changed label Feb 1, 2024
@NoureldinYosri NoureldinYosri marked this pull request as ready for review February 1, 2024 22:54
@NoureldinYosri NoureldinYosri requested review from vtomole, cduck and a team as code owners February 1, 2024 22:54
@NoureldinYosri NoureldinYosri requested a review from maffoo February 1, 2024 22:54
@NoureldinYosri NoureldinYosri enabled auto-merge (squash) February 1, 2024 22:54
Copy link
Collaborator

@vtomole vtomole left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

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

Thanks!

@pavoljuhas
Copy link
Collaborator

I am getting a reproducible decimal.DivisionByZero exception after the quimb update -

check/pytest -n0 cirq-core/cirq/contrib/quimb/grid_circuits_test.py::test_tensor_expectation_value -x --tb=native
output

======================================================= FAILURES =======================================================
____________________________________________ test_tensor_expectation_value _____________________________________________
Traceback (most recent call last):
File "/tmp/t39/lib/python3.9/site-packages/_pytest/runner.py", line 341, in from_call
result: Optional[TResult] = func()
File "/tmp/t39/lib/python3.9/site-packages/_pytest/runner.py", line 262, in
lambda: ihook(item=item, **kwds), when=when, reraise=reraise
File "/tmp/t39/lib/python3.9/site-packages/pluggy/_hooks.py", line 501, in call
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "/tmp/t39/lib/python3.9/site-packages/pluggy/_manager.py", line 119, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/tmp/t39/lib/python3.9/site-packages/pluggy/_callers.py", line 181, in _multicall
return outcome.get_result()
File "/tmp/t39/lib/python3.9/site-packages/pluggy/_result.py", line 99, in get_result
raise exc.with_traceback(exc.traceback)
File "/tmp/t39/lib/python3.9/site-packages/pluggy/_callers.py", line 102, in _multicall
res = hook_impl.function(*args)
File "/tmp/t39/lib/python3.9/site-packages/_pytest/runner.py", line 177, in pytest_runtest_call
raise e
File "/tmp/t39/lib/python3.9/site-packages/_pytest/runner.py", line 169, in pytest_runtest_call
item.runtest()
File "/tmp/t39/lib/python3.9/site-packages/_pytest/python.py", line 1792, in runtest
self.ihook.pytest_pyfunc_call(pyfuncitem=self)
File "/tmp/t39/lib/python3.9/site-packages/pluggy/_hooks.py", line 501, in call
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "/tmp/t39/lib/python3.9/site-packages/pluggy/_manager.py", line 119, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/tmp/t39/lib/python3.9/site-packages/pluggy/_callers.py", line 181, in _multicall
return outcome.get_result()
File "/tmp/t39/lib/python3.9/site-packages/pluggy/_result.py", line 99, in get_result
raise exc.with_traceback(exc.traceback)
File "/tmp/t39/lib/python3.9/site-packages/pluggy/_callers.py", line 102, in _multicall
res = hook_impl.function(*args)
File "/tmp/t39/lib/python3.9/site-packages/_pytest/python.py", line 194, in pytest_pyfunc_call
result = testfunction(**testargs)
File "/usr/local/google/home/juhas/Code/gh/quantumlib/Cirq2/cirq-core/cirq/contrib/quimb/grid_circuits_test.py", line 74, in test_tensor_expectation_value
eval_tn = ccq.tensor_expectation_value(circuit, operator)
File "/usr/local/google/home/juhas/Code/gh/quantumlib/Cirq2/cirq-core/cirq/contrib/quimb/state_vector.py", line 173, in tensor_expectation_value
path_info = tn.contract(get='path-info')
File "/tmp/t39/lib/python3.9/site-packages/quimb/tensor/tensor_core.py", line 8448, in contract
return tensor_contract(*self.tensor_map.values(), **opts)
File "/tmp/t39/lib/python3.9/site-packages/quimb/tensor/tensor_core.py", line 262, in tensor_contract
return _tensor_contract_get_other(
File "/tmp/t39/lib/python3.9/site-packages/quimb/tensor/tensor_core.py", line 167, in _tensor_contract_get_other
pathinfo = array_contract_pathinfo(
File "/tmp/t39/lib/python3.9/site-packages/quimb/tensor/contraction.py", line 329, in array_contract_pathinfo
return oe.contract_path(eq, *shapes, shapes=True, optimize=path)[1]
File "/tmp/t39/lib/python3.9/site-packages/opt_einsum/contract.py", line 327, in contract_path
path_print = PathInfo(contraction_list, input_subscripts, output_subscript, indices, path, scale_list, naive_cost,
File "/tmp/t39/lib/python3.9/site-packages/opt_einsum/contract.py", line 38, in init
self.speedup = self.naive_cost / self.opt_cost
decimal.DivisionByZero: [<class 'decimal.DivisionByZero'>]
=================================================== warnings summary ===================================================
cirq-core/cirq/_compat.py:31
/usr/local/google/home/juhas/Code/gh/quantumlib/Cirq2/cirq-core/cirq/_compat.py:31: DeprecationWarning:
Pyarrow will become a required dependency of pandas in the next major release of pandas (pandas 3.0),
(to allow more performant data types, such as the Arrow string type, and better interoperability with other libraries)
but was not found to be installed on your system.
If this would cause problems for you,
please provide us feedback at pandas-dev/pandas#54466

import pandas as pd

../../../../../../../../../tmp/t39/lib/python3.9/site-packages/cotengra/hyperoptimizers/hyper.py:34
/tmp/t39/lib/python3.9/site-packages/cotengra/hyperoptimizers/hyper.py:34: UserWarning: Couldn't import kahypar - skipping from default hyper optimizer and using basic labels method instead.
warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=============================================== short test summary info ================================================
FAILED cirq-core/cirq/contrib/quimb/grid_circuits_test.py::test_tensor_expectation_value - decimal.DivisionByZero: [<class 'decimal.DivisionByZero'>]
============================================ 1 failed, 2 warnings in 2.38s =============================================

@NoureldinYosri
Copy link
Collaborator Author

@pavoljuhas yea same. looks like the latest quimb breaks the tests in contrib/quimb. I changed the approch to pinning both quimb and numba to older versions

@NoureldinYosri NoureldinYosri changed the title update quimb version to fix CI pin quimb and numba versions to fix CI Feb 2, 2024
Copy link

codecov bot commented Feb 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2ef1909) 97.81% compared to head (e3fedf5) 97.81%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6438      +/-   ##
==========================================
- Coverage   97.81%   97.81%   -0.01%     
==========================================
  Files        1111     1111              
  Lines       97143    97143              
==========================================
- Hits        95022    95017       -5     
- Misses       2121     2126       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@NoureldinYosri NoureldinYosri merged commit 5ed8f16 into main Feb 2, 2024
37 checks passed
@NoureldinYosri NoureldinYosri deleted the quimb_version branch February 2, 2024 01:19
pavoljuhas added a commit that referenced this pull request Feb 14, 2024
* Enable Contract-a-Grid-Circuit.ipynb in notebook tests,
  but test it only with the pre-release Cirq.

The notebook requires a pinned version of quimb from #6438 otherwise the
tensor_expectation_value() call in the last-cell causes out-of-memory error.

Fixes #6088
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
* Enable Contract-a-Grid-Circuit.ipynb in notebook tests,
  but test it only with the pre-release Cirq.

The notebook requires a pinned version of quimb from quantumlib#6438 otherwise the
tensor_expectation_value() call in the last-cell causes out-of-memory error.

Fixes quantumlib#6088
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: XS <10 lines changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

doc test CI failing at head
4 participants