question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

numpy version conflicts

See original GitHub issue

install from setup.py (numpy version 1.21.6)

~/alpa$ python3 tests/test_install.py
RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe

after install numpy=1.22.0

python3 tests/test_install.py
Traceback (most recent call last):
  File "tests/test_install.py", line 13, in <module>
    from alpa import (init, parallelize, grad, ShardParallel, automatic_layer_construction,
  File "/home/ubuntu/alpa/alpa/__init__.py", line 1, in <module>
    from alpa.api import (init, shutdown, parallelize, grad, value_and_grad,
  File "/home/ubuntu/alpa/alpa/api.py", line 15, in <module>
    from alpa.parallel_method import ParallelMethod, ShardParallel
  File "/home/ubuntu/alpa/alpa/parallel_method.py", line 26, in <module>
    from alpa.pipeline_parallel.compile_executable import compile_pipeshard_executable
  File "/home/ubuntu/alpa/alpa/pipeline_parallel/compile_executable.py", line 27, in <module>
    from alpa.pipeline_parallel.stage_construction import (
  File "/home/ubuntu/alpa/alpa/pipeline_parallel/stage_construction.py", line 10, in <module>
    import numba
  File "/home/ubuntu/.local/lib/python3.8/site-packages/numba/__init__.py", line 200, in <module>
    _ensure_critical_deps()
  File "/home/ubuntu/.local/lib/python3.8/site-packages/numba/__init__.py", line 140, in _ensure_critical_deps
    raise ImportError("Numba needs NumPy 1.21 or less")
ImportError: Numba needs NumPy 1.21 or less

I disable numba importerror in the end and passed this test, was wondering what would be the potential problems.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
marwagecommented, Jun 8, 2022

Hi, I had the same issue and I fixed it by removing the version requirement from numpy in setup.py https://github.com/alpa-projects/alpa/blob/3995d72359f78edaf54de7bc8fe9bdd2c2d8d680/setup.py#L88 My current version is numpy==1.22.4. I hope that helps others too.

0reactions
zhisbugcommented, Jun 10, 2022

@huangjundashuaige Hello, has your issue been addressed?

It is because, during the compilation of jaxlib, a higher version of numpy is used, but when running Alpa, a lower version of numpy is used.

This is possible to happen because when running pip install cupy-cuda11x, pip will resolve the dependency and install a newer version of numpy (>1.22)

But alpa’s setup.py declares numpy<1.22.

We have addressed this issue via PR #492 and PR #499

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gotcha: numpy version conflict if installing in existing ... - GitHub
Problem: When installing kglab using pip in an existing (activated) environment, the latest version of numpy is installed (because ...
Read more >
python 2.7 - Import sklearn fails - conflict with numpy version?
I figured it out. I had multiple versions of python installed (2.3, 2.5, 2.6, 2.7) and multiple version of Numpy.
Read more >
ctypes version conflict with numpy - OSGeo4W - OSGeo Trac
When I try to import numpy, I get the below error. It appears that it looks for ctypeslib.py in the right spot, but...
Read more >
Dependency Resolution - pip documentation v22.3.1
The process of determining which version of a dependency to install is known as dependency resolution. This behaviour can be disabled by passing...
Read more >
The Nine Circles of Python Dependency Hell - Medium
You may see a version conflict if your dependencies are demanding a specific version of a library that you don't currently use in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found