Skip to content

Editable builds of cuda-bench are broken #312

@NaderAlAwar

Description

@NaderAlAwar

Following the installation instructions in our readme to build cuda-bench from source is broken

pip install -e .[cu12]

and running the python auto_throughput.py results in

Traceback (most recent call last):
  File "/home/nawar/projects/nvbench/python/cuda/bench/__init__.py", line 55, in <module>
    _nvbench_module = importlib.import_module(_module_fullname)
  File "/home/nawar/anaconda3/envs/python-nvbench/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'cuda.bench.cu12'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/nawar/projects/nvbench/python/examples/auto_throughput.py", line 19, in <module>
    import cuda.bench as bench
  File "/home/nawar/projects/nvbench/python/cuda/bench/__init__.py", line 57, in <module>
    raise ImportError(
    ...<4 lines>...
    )
ImportError: No cuda-bench extension found for CUDA 12.x. This wheel may not include support for your CUDA version. Supported CUDA versions: 12, 13. Original error: No module named 'cuda.bench.cu12'

This is due to #289, which added support for multiple CUDA versions, and moved the Python extension into versioned subpackages (e.g., cuda.bench.cu12._nvbench), so editable installs that don’t build/install that versioned layout fail to import the module.

(side note our README needs to be updated to specify [cu12] in the pip installation command)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions