NVIDIA / NVIDIA/cuda-quantum

Consider using OpenBLAS across the board

Open
#452 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement stale-notified
Dominant language
C++
Stars
1.1k
Forks
455
Avg merge
1d 22h
Merged PRs (30d)
165

Description

Right now, we have both BLAS and OpenBLAS in the mix, built with and without OpenMP support. It would be nice to see if we can use the same installation across the board and preferably with OpenMP enabled.

What is currently preventing this is that we see sporadic failures (Illegal instructions) with the VQE H2 tests, caused by the LBFGS optimizer that comes from ensmallen. In principle, ensmallen says it supports OpenBLAS, but something seems to not quite work here when using OpenBLAS instead of BLAS. It might be worth giving 0.3.21 a shot - this is an older version that might be more compatible with ensmallen, but that's a shot in the dark.

The following OpenBLAS packages exist, and in principle meet our needs: libopenblas-dev (via apt-get), openblas-static (via dnf).
It would be nicer to build from source, since this can be done on all platforms:
Download location: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.23/OpenBLAS-0.3.23.tar.gz
Build with OpenMP support: make USE_OPENMP=0 && make install PREFIX=...

Note that gcc and clang work with different OpenMP libraries (libgomp vs libomp).
To enable OpenMP support we hence should build OpenBLAS with the same compiler toolchain as we build CUDA Quantum with to ensure we link against the OpenMP library supported by that compiler.

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

Start by reproducing the sporadic Illegal instructions failures in the VQE H2 tests with BLAS and OpenBLAS, then inspect the ensmallen LBFGS path and compiler-specific OpenMP linkage. Done means determining whether one OpenBLAS installation and toolchain can be used across supported platforms without those test failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.