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

[Core] numpy > 2 not supported #48559

Open
paaragon opened this issue Nov 5, 2024 · 7 comments
Open

[Core] numpy > 2 not supported #48559

paaragon opened this issue Nov 5, 2024 · 7 comments
Labels
bug Something that is supposed to be working; but isn't core Issues that should be addressed in Ray Core @external-author-action-required Alternate tag for PRs where the author doesn't have labeling permission. P2 Important issue, but not time-critical

Comments

@paaragon
Copy link

paaragon commented Nov 5, 2024

What happened + What you expected to happen

Working on the Qiskit Serverless project, we discover an issue in the client ray using numpy>2:

Failed to start supervisor actor raysubmit_er8zgdCRKuMwP2mL: 'numpy.core.multiarray failed to import'. Full traceback:
Traceback (most recent call last):
  File "/usr/local/lib64/python3.11/site-packages/ray/dashboard/modules/job/job_manager.py", line 544, in submit_job
    ).remote(submission_id, entrypoint, metadata or {}, self._gcs_address)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib64/python3.11/site-packages/ray/actor.py", line 833, in remote
    return actor_cls._remote(args=args, kwargs=kwargs, **updated_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib64/python3.11/site-packages/ray/_private/auto_init_hook.py", line 21, in auto_init_wrapper
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib64/python3.11/site-packages/ray/util/tracing/tracing_helper.py", line 388, in _invocation_actor_class_remote_span
    return method(self, args, kwargs, *_args, **_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib64/python3.11/site-packages/ray/actor.py", line 1161, in _remote
    actor_id = worker.core_worker.create_actor(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "python/ray/_raylet.pyx", line 4114, in ray._raylet.CoreWorker.create_actor
  File "python/ray/_raylet.pyx", line 4119, in ray._raylet.CoreWorker.create_actor
  File "python/ray/_raylet.pyx", line 835, in ray._raylet.prepare_args_and_increment_put_refs
  File "python/ray/_raylet.pyx", line 826, in ray._raylet.prepare_args_and_increment_put_refs
  File "python/ray/_raylet.pyx", line 875, in ray._raylet.prepare_args_internal
  File "/usr/local/lib64/python3.11/site-packages/ray/_private/worker.py", line 679, in get_serialization_context
    context_map[job_id] = serialization.SerializationContext(self)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib64/python3.11/site-packages/ray/_private/serialization.py", line 163, in __init__
    serialization_addons.apply(self)
  File "/usr/local/lib64/python3.11/site-packages/ray/util/serialization_addons.py", line 39, in apply
    _register_custom_datasets_serializers(serialization_context)
  File "/usr/local/lib64/python3.11/site-packages/ray/_private/arrow_serialization.py", line 46, in _register_custom_datasets_serializers
    import pyarrow as pa  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib64/python3.11/site-packages/pyarrow/__init__.py", line 65, in <module>
    import pyarrow.lib as _lib
  File "pyarrow/lib.pyx", line 36, in init pyarrow.lib
ImportError: numpy.core.multiarray failed to import

Versions / Dependencies

ray[default,data]>=2.30.0, <2.35.0
Python=3.11
numpy>2

Reproduction script

[wip]

Issue Severity

Medium: It is a significant difficulty but I can work around it.

@paaragon paaragon added bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Nov 5, 2024
@jcotant1 jcotant1 added core Issues that should be addressed in Ray Core and removed core Issues that should be addressed in Ray Core labels Nov 5, 2024
@rynewang
Copy link
Contributor

Hi can you print your pyarrow version? from the stack trace it seems pyarrow imports numpy.core.multiarray which seems to be gone in numpy>2.

Also curious why you set ray < 2.35.0?

@rynewang rynewang added P2 Important issue, but not time-critical @external-author-action-required Alternate tag for PRs where the author doesn't have labeling permission. and removed triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Nov 12, 2024
@Tansito
Copy link

Tansito commented Nov 15, 2024

Hi, sorry for the delay in the answer @rynewang

can you print your pyarrow version? from the stack trace it seems pyarrow imports numpy.core.multiarray which seems to be gone in numpy>2.

Yes, let us try to collect that info for you 👍

Also curious why you set ray < 2.35.0?

Some weeks ago we tried to update from 2.34.0 to 2.35.0 our ray dependency but something was not working from our tests. If I remember correctly the problem was that we were not being able to connect with the dashboard but we will try to collect the stacktrace for this one an open another issue in case we continue seeing the problem.

Thank you @rynewang ! 🙏

@Tansito
Copy link

Tansito commented Nov 15, 2024

The pyarrow version that we are using is the next one: pyarrow==14.0.1. So probably this version doesn't support the new numpy? Maybe if we are able to update the ray version that we are using we could solve the problem, does it make sense, @rynewang ?

@paul-twelvelabs
Copy link

paul-twelvelabs commented Nov 15, 2024

We ran into the same pyarrow/numpy > 2 issue on ray==2.38.0. It'd be great if we could bump pyarrow (note that pyarrow==14.0.1 is 1 year old).

@rynewang
Copy link
Contributor

Per numpy/numpy#26191 it seems you need to upgrade pyarrow to >= 16.0 if you want to use numpy 2. See apache/arrow#39532

@Tansito
Copy link

Tansito commented Nov 18, 2024

Thanks @rynewang , I'm going to give a try today and let you know if this simple change works. Thanks for your support.

@Tansito
Copy link

Tansito commented Nov 18, 2024

From Qiskit/qiskit-serverless#1538 we applied the change to update pyarrow and everything worked like a charm with the new numpy major version. Thanks for your support @rynewang 👍

EDIT: feel free to close this issue as solved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to be working; but isn't core Issues that should be addressed in Ray Core @external-author-action-required Alternate tag for PRs where the author doesn't have labeling permission. P2 Important issue, but not time-critical
Projects
None yet
Development

No branches or pull requests

5 participants