NVIDIA / NVIDIA/cuda-quantum

[Python] Numba installed via conda-forge conflict with Pipy wheels

Open
#2,420 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build python-lang stale-notified
Dominant language
C++
Stars
1.1k
Forks
456
Avg merge
1d 22h
Merged PRs (30d)
165

Description

Required prerequisites
  • Consult the security policy. If reporting a security vulnerability, do not report the bug using this form. Use the process described in the policy to report the issue.
  • Make sure you've read the documentation. Your issue may be addressed there.
  • Search the issue tracker to verify that this hasn't already been reported. +1 or comment there if it has.
  • If possible, make a PR with a failing test to give us a starting point to work on!
Describe the bug

Cudaq conflicts with Numba installed via the conda-forge channel. Importing Cudaq with Numba in the same Python script or importing modules that use Numba returns an LLVM error.

Note that when Numba is installed via Pip, there are no problems.

Steps to reproduce the bug

Create an environment via conda, mamba or micromamba:

conda create -y -n cudaq-env python=3.11 pip
conda install -y -n cudaq-env -c conda-forge numba
conda activate cudaq-env                
pip install cudaq

The bug can be observed when importing the libraries together (the order does not matter).

>>> import numba
>>> import cudaq
python: /llvm-project/llvm/include/llvm/Support/CommandLine.h:864: void llvm::cl::parser<DataType>::addLiteralOption(llvm::StringRef, const DT&, llvm::StringRef) [with DT = llvm::FunctionPass* (*)(); DataType = llvm::FunctionPass* (*)()]: Assertion `findOption(Name) == Values.size() && "Option already exists!"' failed.
Aborted (core dumped)

Expected behavior

The imports should happen without issues, as observed when Numba is installed via Pip.

Is this a regression? If it is, put the last known working version (or commit) here.

Not a regression

Environment
  • CUDA-Q version: 0.9.0
  • Python version: 3.11
  • Operating system: Ubuntu 24.04.1 LTS

The environment packages are:

Package                  Version   Location                                                             Installer
------------------------ --------- -------------------------------------------------------------------- ---------
astpretty                3.0.0     /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
certifi                  2024.8.30 /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
charset-normalizer       3.4.0     /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
cuda-quantum-cu12        0.9.0     /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
cudaq                    0.9.0     /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
cudensitymat-cu12        0.0.5     /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
cupy-cuda12x             13.3.0    /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
cuquantum-python-cu12    24.11.0   /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
custatevec-cu12          1.7.0     /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
cutensor-cu12            2.0.2     /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
cutensornet-cu12         2.6.0     /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
fastrlock                0.8.2     /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
idna                     3.10      /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
llvmlite                 0.43.0    /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages
numba                    0.60.0    /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages conda
numpy                    2.0.2     /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages conda
nvidia-cublas-cu12       12.6.4.1  /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
nvidia-cuda-runtime-cu12 12.6.77   /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
nvidia-cusolver-cu12     11.7.1.2  /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
nvidia-cusparse-cu12     12.5.4.2  /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
nvidia-nvjitlink-cu12    12.6.85   /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
pip                      24.3.1    /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages conda
requests                 2.32.3    /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
scipy                    1.14.1    /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
setuptools               75.6.0    /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages
urllib3                  2.2.3     /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages pip
wheel                    0.45.1    /workspace/condenv/envs/cudaq-env/lib/python3.11/site-packages
Suggestions

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure from the issue's conda environment using the entry points import numba and import cudaq, including both import orders. Investigate the differing conda-forge and pip package combinations and LLVM error, then verify that both imports complete without the assertion failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.