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

Cutting with quantum serverless notebook fails with aiohttp == 3.9.0 #453

Closed
garrison opened this issue Nov 20, 2023 · 2 comments · Fixed by #456
Closed

Cutting with quantum serverless notebook fails with aiohttp == 3.9.0 #453

garrison opened this issue Nov 20, 2023 · 2 comments · Fixed by #456
Labels
cicd Related to the CICD pipeline dependencies Pull requests that update a dependency file

Comments

@garrison
Copy link
Member

aiohttp 3.9.0 was released a few days ago, and since then CI has been failing because the "notebook" tests fail. I haven't gotten to the bottom of why they fail, but I have confirmed that a pin fixes things:

diff --git a/pyproject.toml b/pyproject.toml
index d5bedab..9d1d3a8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -92,6 +92,7 @@ docs = [
 notebook-dependencies = [
     "circuit-knitting-toolbox[cplex,pyscf]",
     "quantum-serverless>=0.0.7",
+    "aiohttp!=3.9.0",
     "matplotlib",
     "ipywidgets",
     "pylatexenc",

Here's the "full" error:

=================================== FAILURES ===================================
_ /home/runner/work/circuit-knitting-toolbox/circuit-knitting-toolbox/docs/circuit_cutting/cutqc/tutorials/tutorial_3_cutting_with_quantum_serverless.ipynb _
---------------------------------------------------------------------------
with serverless.context():
    cuts_future = cut_circuit_wires_remote(
        circuit=circuit,
        method="automatic",
        max_subcircuit_width=5,
        max_cuts=2,
        num_subcircuits=[2],
    )
    cuts = get(cuts_future)
---------------------------------------------------------------------------
LocalRayletDiedError                      Traceback (most recent call last)
Cell In[4], line 9
      1 with serverless.context():
      2     cuts_future = cut_circuit_wires_remote(
      3         circuit=circuit,
      4         method="automatic",
   (...)
      7         num_subcircuits=[2],
      8     )
----> 9     cuts = get(cuts_future)

File ~/work/circuit-knitting-toolbox/circuit-knitting-toolbox/.tox/py311-notebook/lib/python3.11/site-packages/quantum_serverless/core/decorators.py:104, in get(object_refs, timeout)
     88 def get(
     89     object_refs: Union[ray.ObjectRef, Sequence[ray.ObjectRef]],
     90     *,
     91     timeout: Optional[float] = None,
     92 ) -> Any:
     93     """Get results from distributed tasks.
     94 
     95     Args:
   (...)
    102         A object or a list of objects.
    103     """
--> 104     return ray.get(object_refs=object_refs,timeout=timeout)

File ~/work/circuit-knitting-toolbox/circuit-knitting-toolbox/.tox/py311-notebook/lib/python3.11/site-packages/ray/_private/auto_init_hook.py:24, in wrap_auto_init.<locals>.auto_init_wrapper(*args, **kwargs)
     21 @wraps(fn)
     22 def auto_init_wrapper(*args, **kwargs):
     23     auto_init_ray()
---> 24     return fn(*args,**kwargs)

File ~/work/circuit-knitting-toolbox/circuit-knitting-toolbox/.tox/py311-notebook/lib/python3.11/site-packages/ray/_private/client_mode_hook.py:103, in client_mode_hook.<locals>.wrapper(*args, **kwargs)
    101     if func.__name__ != "init" or is_client_mode_enabled_by_default:
    102         return getattr(ray, func.__name__)(*args, **kwargs)
--> 103 return func(*args,**kwargs)

File ~/work/circuit-knitting-toolbox/circuit-knitting-toolbox/.tox/py311-notebook/lib/python3.11/site-packages/ray/_private/worker.py:[256](https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/actions/runs/6917536253/job/18818830181#step:6:257)5, in get(object_refs, timeout)
   2563             raise value.as_instanceof_cause()
   2564         else:
-> 2565             raise value
   2567 if is_individual_id:
   2568     values = values[0]

LocalRayletDiedError: The task's local raylet died. Check raylet.out for more information.
----------------------------- Captured stderr call -----------------------------

If we can't get to the bottom of this very soon, we should merge the pin for the time being.

@garrison garrison added dependencies Pull requests that update a dependency file cicd Related to the CICD pipeline labels Nov 20, 2023
garrison added a commit that referenced this issue Nov 20, 2023
This fixes the notebook tests (and CI).  See discussion at #453.
garrison added a commit that referenced this issue Nov 20, 2023
This fixes the notebook tests (and CI).  See discussion at #453.
@garrison
Copy link
Member Author

garrison commented Nov 20, 2023

This seems like an issue with an upstream dependency. Once this is resolved upstream, let's be sure to unpin aiohttp (i.e., revert #453) EDIT: remove async-timeout from the dependencies (see below).

@garrison
Copy link
Member Author

garrison commented Nov 20, 2023

Actually, I think I figured out that the "real" problem here. It's that ray requires async-timeout, but ray does not mention async-timeout in its dependencies; instead it has relied on it being installed as a transitive dependency of aiohttp, but aiohttp no longer requires it as of aio-libs/aiohttp#7502.

I made a comment at ray-project/ray#41267 (comment).

garrison added a commit that referenced this issue Nov 20, 2023
In #454, I pinned `aiohttp`, but the failure was actually due to
`async-timeout` not being installed
(#453 (comment)).

This PR updates `pyproject.toml` in accordance with this root cause.

We can remove this line once a version of ray is released that fixes
ray-project/ray#41267.
garrison added a commit that referenced this issue Nov 20, 2023
In #454, I pinned `aiohttp`, but the failure was actually due to
`async-timeout` not being installed
(#453 (comment)).

This PR updates `pyproject.toml` in accordance with this root cause.

We can remove this line once a version of ray is released that fixes
ray-project/ray#41267.
garrison added a commit that referenced this issue Nov 21, 2023
This will need to wait until Ray 2.9.0 is released, following
ray-project/ray#41267 (comment).

Fixes #453.
garrison added a commit that referenced this issue Dec 21, 2023
This will need to wait until Ray 2.9.0 is released, following
ray-project/ray#41267 (comment).

Fixes #453.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cicd Related to the CICD pipeline dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant