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

Set upper bound of NumPy version #1183

Merged
merged 1 commit into from
Jun 28, 2024
Merged

Set upper bound of NumPy version #1183

merged 1 commit into from
Jun 28, 2024

Conversation

fepegar
Copy link
Member

@fepegar fepegar commented Jun 28, 2024

Description

The CI tests are failing because NumPy 2 and PyTorch 2.2 don't seem to be compatible:

>>> import numpy
>>> import torch
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "<stdin>", line 1, in <module>
  File "/Users/fernando/miniforge3/envs/test/lib/python3.11/site-packages/torch/__init__.py", line 1477, in <module>
    from .functional import *  # noqa: F403
  File "/Users/fernando/miniforge3/envs/test/lib/python3.11/site-packages/torch/functional.py", line 9, in <module>
    import torch.nn.functional as F
  File "/Users/fernando/miniforge3/envs/test/lib/python3.11/site-packages/torch/nn/__init__.py", line 1, in <module>
    from .modules import *  # noqa: F403
  File "/Users/fernando/miniforge3/envs/test/lib/python3.11/site-packages/torch/nn/modules/__init__.py", line 35, in <module>
    from .transformer import TransformerEncoder, TransformerDecoder, \
  File "/Users/fernando/miniforge3/envs/test/lib/python3.11/site-packages/torch/nn/modules/transformer.py", line 20, in <module>
    device: torch.device = torch.device(torch._C._get_default_device()),  # torch.device('cpu'),
/Users/fernando/miniforge3/envs/test/lib/python3.11/site-packages/torch/nn/modules/transformer.py:20: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/torch/csrc/utils/tensor_numpy.cpp:84.)
  device: torch.device = torch.device(torch._C._get_default_device()),  # torch.device('cpu'),

@fepegar fepegar marked this pull request as ready for review June 28, 2024 19:36
@fepegar fepegar marked this pull request as draft June 28, 2024 19:37
@fepegar fepegar marked this pull request as ready for review June 28, 2024 19:49
@fepegar fepegar merged commit e010de1 into main Jun 28, 2024
15 of 16 checks passed
@fepegar fepegar deleted the fix-torch-numpy branch June 28, 2024 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant