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

Release 0.12.2 #1864

Merged
merged 10 commits into from
Jul 12, 2023
64 changes: 40 additions & 24 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.7'
python-version: '3.8'
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.11.2
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.7'
python-version: '3.8'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand Down Expand Up @@ -119,28 +119,35 @@ jobs:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_USERNAME: qiskit
run: twine upload dist/qiskit*
gpu-build:
name: Build qiskit-aer-gpu wheels
gpu-build-cuda11:
name: Build qiskit-aer-gpu-cu11 wheels
runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 40000
swap-size-mb: 1024
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.7'
- name: Add msbuild to PATH
uses: microsoft/[email protected]
if: runner.os == 'Windows'
python-version: '3.8'
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.11.2
- name: Build wheels
env:
CIBW_BEFORE_ALL: "yum install -y yum-utils wget && wget -q https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda-repo-rhel6-10-1-local-10.1.243-418.87.00-1.0-1.x86_64.rpm && rpm -i cuda-repo-rhel6-10-1-local-10.1.243-418.87.00-1.0-1.x86_64.rpm && yum clean all && yum -y install cuda-10-1 openblas-devel"
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2010_x86_64:latest
CIBW_SKIP: "*-manylinux_i686 cp310* pp* cp36* *musllinux*"
CIBW_TEST_SKIP: "cp*"
CIBW_ENVIRONMENT: QISKIT_AER_PACKAGE_NAME=qiskit-aer-gpu AER_THRUST_BACKEND=CUDA CUDACXX=/usr/local/cuda/bin/nvcc
CIBW_BEFORE_ALL: "yum install -y yum-utils wget && wget -q https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-rhel7-11-8-local-11.8.0_520.61.05-1.x86_64.rpm && rpm -i cuda-repo-rhel7-11-8-local-11.8.0_520.61.05-1.x86_64.rpm && yum clean all && yum -y install cuda && yum -y install openblas-devel && yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo && yum clean all"
CIBW_BEFORE_BUILD : "pip install --user nvidia-cuda-runtime-cu11 nvidia-cublas-cu11 nvidia-cusolver-cu11 nvidia-cusparse-cu11 cuquantum-cu11 && pip show nvidia-cuda-runtime-cu11 nvidia-cublas-cu11 nvidia-cusolver-cu11 nvidia-cusparse-cu11 cuquantum-cu11"
CIBW_SKIP: "*-manylinux_i686 pp* cp36* *musllinux*"
CIBW_ENVIRONMENT: QISKIT_AER_PACKAGE_NAME=qiskit-aer-gpu-cu11 QISKIT_AER_CUDA_MAJOR=11 CMAKE_VERBOSE_MAKEFILE=true AER_THRUST_BACKEND=CUDA CUDACXX=/usr/local/cuda/bin/nvcc AER_CUDA_ARCH="7.0 7.2 7.5 8.0 8.6 8.7" AER_PYTHON_CUDA_ROOT=/root/.local LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.local/lib/python3.7/site-packages/nvidia/cuda_runtime/lib:/root/.local/lib/python3.7/site-packages/cuquantum/lib:/root/.local/lib/python3.8/site-packages/nvidia/cuda_runtime/lib:/root/.local/lib/python3.8/site-packages/cuquantum/lib:/root/.local/lib/python3.9/site-packages/nvidia/cuda_runtime/lib:/root/.local/lib/python3.9/site-packages/cuquantum/lib:/root/.local/lib/python3.10/site-packages/nvidia/cuda_runtime/lib:/root/.local/lib/python3.10/site-packages/cuquantum/lib:/root/.local/lib/python3.11/site-packages/nvidia/cuda_runtime/lib:/root/.local/lib/python3.11/site-packages/cuquantum/lib
CIBW_REPAIR_WHEEL_COMMAND: 'auditwheel repair --exclude libcudart.so.11.0 --exclude libcustatevec.so.1 --exclude libcutensornet.so.2 --exclude libcutensor.so.1 --exclude libcutensorMg.so.1 --exclude libcusolver.so.11 --exclude libcusolverMg.so.11 --exclude libcusparse.so.11 --exclude libcublas.so.11 --exclude libcublasLt.so.11 -w {dest_dir} {wheel}'
run: |
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
Expand All @@ -153,26 +160,35 @@ jobs:
run : |
pip install -U twine
twine upload wheelhouse/*
gpu-build-310:
name: Build qiskit-aer-gpu wheels
gpu-build-cuda12:
name: Build qiskit-aer-gpu-cu12 wheels
runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 40000
swap-size-mb: 1024
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.7'
- name: Add msbuild to PATH
uses: microsoft/[email protected]
if: runner.os == 'Windows'
python-version: '3.8'
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.11.2
- name: Build wheels
env:
CIBW_BEFORE_ALL: "yum install -y yum-utils wget && wget -q https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda-repo-rhel7-10-1-local-10.1.105-418.39-1.0-1.x86_64.rpm && rpm -i cuda-repo-rhel7-10-1-local-10.1.105-418.39-1.0-1.x86_64.rpm && yum clean all && yum -y install cuda-10-1 openblas-devel"
CIBW_BUILD: "cp310-manylinux_x86_64"
CIBW_ENVIRONMENT: QISKIT_AER_PACKAGE_NAME=qiskit-aer-gpu AER_THRUST_BACKEND=CUDA CUDACXX=/usr/local/cuda/bin/nvcc
CIBW_BEFORE_ALL: "yum install -y yum-utils wget && wget -q https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && rpm -i cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && yum clean all && yum -y install cuda && yum -y install openblas-devel && yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo && yum clean all"
CIBW_BEFORE_BUILD : "pip install --user nvidia-cuda-runtime-cu12 nvidia-cublas-cu12 nvidia-cusolver-cu12 nvidia-cusparse-cu12 cuquantum-cu12"
CIBW_SKIP: "*-manylinux_i686 pp* cp36* *musllinux*"
CIBW_ENVIRONMENT: QISKIT_AER_PACKAGE_NAME=qiskit-aer-gpu QISKIT_AER_CUDA_MAJOR=12 CMAKE_VERBOSE_MAKEFILE=true AER_THRUST_BACKEND=CUDA CUDACXX=/usr/local/cuda/bin/nvcc AER_CUDA_ARCH="7.0 7.2 7.5 8.0 8.6 8.7 9.0" AER_PYTHON_CUDA_ROOT=/root/.local LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.local/lib/python3.7/site-packages/nvidia/cuda_runtime/lib:/root/.local/lib/python3.7/site-packages/cuquantum/lib:/root/.local/lib/python3.8/site-packages/nvidia/cuda_runtime/lib:/root/.local/lib/python3.8/site-packages/cuquantum/lib:/root/.local/lib/python3.9/site-packages/nvidia/cuda_runtime/lib:/root/.local/lib/python3.9/site-packages/cuquantum/lib:/root/.local/lib/python3.10/site-packages/nvidia/cuda_runtime/lib:/root/.local/lib/python3.10/site-packages/cuquantum/lib:/root/.local/lib/python3.11/site-packages/nvidia/cuda_runtime/lib:/root/.local/lib/python3.11/site-packages/cuquantum/lib
CIBW_REPAIR_WHEEL_COMMAND: 'auditwheel repair --exclude libcudart.so.12 --exclude libcustatevec.so.1 --exclude libcutensornet.so.2 --exclude libcutensor.so.1 --exclude libcutensorMg.so.1 --exclude libcusolver.so.11 --exclude libcusolverMg.so.11 --exclude libcusolver.so.12 --exclude libcusolverMg.so.12 --exclude libcusparse.so.12 --exclude libcublas.so.12 --exclude libcublasLt.so.12 --exclude libnvJitLink.so.12 -w {dest_dir} {wheel}'
run: |
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
Expand All @@ -197,7 +213,7 @@ jobs:
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.7'
python-version: '3.8'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand Down Expand Up @@ -233,7 +249,7 @@ jobs:
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.7'
python-version: '3.8'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand Down
105 changes: 68 additions & 37 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -259,49 +259,80 @@ if(AER_THRUST_SUPPORTED)
set(CMAKE_CUDA_ARCHITECTURES "${AER_CUDA_ARCHITECTURES}")
message(STATUS "CMAKE_CUDA_ARCHITECTURES = ${CMAKE_CUDA_ARCHITECTURES}")

set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} ${AER_CUDA_ARCH_FLAGS_EXPAND} -DAER_THRUST_CUDA -I${AER_SIMULATOR_CPP_SRC_DIR} -isystem ${AER_SIMULATOR_CPP_SRC_DIR}/third-party/headers -use_fast_math --expt-extended-lambda")

set(AER_COMPILER_DEFINITIONS ${AER_COMPILER_DEFINITIONS} THRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA)
set(THRUST_DEPENDANT_LIBS "-L${CUDA_TOOLKIT_ROOT_DIR}/lib64")
if(NOT DEFINED CUQUANTUM_ROOT)
if(DEFINED ENV{CUQUANTUM_ROOT})
set(CUQUANTUM_ROOT $ENV{CUQUANTUM_ROOT})
endif()
endif()
if(NOT DEFINED CUTENSOR_ROOT)
if(DEFINED ENV{CUTENSOR_ROOT})
set(CUTENSOR_ROOT $ENV{CUTENSOR_ROOT})
endif()
endif()
if(NOT DEFINED AER_ENABLE_CUQUANTUM)
if(DEFINED ENV{AER_ENABLE_CUQUANTUM})
set(AER_ENABLE_CUQUANTUM $ENV{AER_ENABLE_CUQUANTUM})
endif()
if(NOT DEFINED AER_PYTHON_CUDA_ROOT AND DEFINED ENV{AER_PYTHON_CUDA_ROOT})
set(AER_PYTHON_CUDA_ROOT $ENV{AER_PYTHON_CUDA_ROOT})
endif()
if(AER_PYTHON_CUDA_ROOT)
find_package(Python)
set(PYTHON_SITE_PATH ${AER_PYTHON_CUDA_ROOT}/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages)
# execute_process(COMMAND "${Python_EXECUTABLE}" -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())" OUTPUT_VARIABLE PYTHON_SITE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "PYTHON_SITE_PATH = ${PYTHON_SITE_PATH}")

if(AER_ENABLE_CUQUANTUM)
set(AER_COMPILER_DEFINITIONS ${AER_COMPILER_DEFINITIONS} THRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA)
set(AER_COMPILER_DEFINITIONS ${AER_COMPILER_DEFINITIONS} AER_CUSTATEVEC AER_CUTENSORNET)
if(DEFINED CUQUANTUM_ROOT)
set(AER_COMPILER_FLAGS "${AER_COMPILER_FLAGS} -I${CUQUANTUM_ROOT}/include")
set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -L${CUQUANTUM_ROOT}/lib/${CUDA_VERSION_MAJOR}")

set(CUDA_NVCC_FLAGS "${AER_CUDA_ARCH_FLAGS_EXPAND} -DAER_THRUST_CUDA -I${AER_SIMULATOR_CPP_SRC_DIR} -isystem ${AER_SIMULATOR_CPP_SRC_DIR}/third-party/headers -use_fast_math --expt-extended-lambda")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -I${PYTHON_SITE_PATH}/cuquantum/include")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -I${PYTHON_SITE_PATH}/cutensor/include")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Xlinker \"--disable-new-dtags\" ")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Xlinker \"--rpath=${PYTHON_SITE_PATH}/nvidia/cusolver/lib\" ")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Xlinker \"--rpath=${PYTHON_SITE_PATH}/nvidia/cusparse/lib\" ")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Xlinker \"--rpath=${PYTHON_SITE_PATH}/cutensor/lib\" ")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Xlinker \"--rpath=${PYTHON_SITE_PATH}/nvidia/cuda_runtime/lib\" ")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Xlinker \"--no-as-needed,-l:libcusolver.so.${CUDA_VERSION_MAJOR},-l:libcusparse.so.${CUDA_VERSION_MAJOR},--as-needed\" ")
set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -L${PYTHON_SITE_PATH}/cuquantum/lib -l:libcustatevec.so.1 -l:libcutensornet.so.2")
if(CUDA_VERSION_MAJOR STREQUAL "11")
set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -L${PYTHON_SITE_PATH}/nvidia/cuda_runtime/lib -l:libcudart.so.${CUDA_VERSION_MAJOR}.0")
else()
set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -L${PYTHON_SITE_PATH}/nvidia/cuda_runtime/lib -l:libcudart.so.${CUDA_VERSION_MAJOR}")
endif()
if(DEFINED CUTENSOR_ROOT)
set(AER_COMPILER_FLAGS "${AER_COMPILER_FLAGS} -I${CUTENSOR_ROOT}/include")
set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -L${CUTENSOR_ROOT}/lib/${CUDA_VERSION_MAJOR}")
string(STRIP ${CUDA_NVCC_FLAGS} CUDA_NVCC_FLAGS)
string(STRIP ${THRUST_DEPENDANT_LIBS} THRUST_DEPENDANT_LIBS)
else()
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} ${AER_CUDA_ARCH_FLAGS_EXPAND} -DAER_THRUST_CUDA -I${AER_SIMULATOR_CPP_SRC_DIR} -isystem ${AER_SIMULATOR_CPP_SRC_DIR}/third-party/headers -use_fast_math --expt-extended-lambda")

set(AER_COMPILER_DEFINITIONS ${AER_COMPILER_DEFINITIONS} THRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA)
set(THRUST_DEPENDANT_LIBS "-L${CUDA_TOOLKIT_ROOT_DIR}/lib64")
if(NOT DEFINED CUQUANTUM_ROOT)
if(DEFINED ENV{CUQUANTUM_ROOT})
set(CUQUANTUM_ROOT $ENV{CUQUANTUM_ROOT})
endif()
endif()
if(CUQUANTUM_STATIC)
set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -lcustatevec_static -lcutensornet_static -lcutensor_static -lmetis_static -lcusolver_static -lcusparse_static -lcusolver_lapack_static -lcublas_static -lcublasLt_static -lculibos")
else()
set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -lcustatevec -lcutensornet -lcutensor")
if(NOT DEFINED CUTENSOR_ROOT)
if(DEFINED ENV{CUTENSOR_ROOT})
set(CUTENSOR_ROOT $ENV{CUTENSOR_ROOT})
endif()
endif()
elseif(CUSTATEVEC_ROOT)
#TODO this is remained for backward compatibility, use CUQUANTUM_ROOT instead
set(AER_COMPILER_DEFINITIONS ${AER_COMPILER_DEFINITIONS} AER_CUSTATEVEC)
set(AER_COMPILER_FLAGS "${AER_COMPILER_FLAGS} -I${CUSTATEVEC_ROOT}/include")
if(CUSTATEVEC_STATIC)
set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -L${CUSTATEVEC_ROOT}/lib -L${CUSTATEVEC_ROOT}/lib/${CUDA_VERSION_MAJOR} -lcustatevec_static -lcusolver_static -lcusparse_static -lcusolver_lapack_static -lcublas_static -lcublasLt_static -lculibos")
else()
set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -L${CUSTATEVEC_ROOT}/lib -L${CUSTATEVEC_ROOT}/lib/${CUDA_VERSION_MAJOR} -lcustatevec")
if(NOT DEFINED AER_ENABLE_CUQUANTUM)
if(DEFINED ENV{AER_ENABLE_CUQUANTUM})
set(AER_ENABLE_CUQUANTUM $ENV{AER_ENABLE_CUQUANTUM})
endif()
endif()

if(AER_ENABLE_CUQUANTUM)
set(AER_COMPILER_DEFINITIONS ${AER_COMPILER_DEFINITIONS} AER_CUSTATEVEC AER_CUTENSORNET)
if(DEFINED CUQUANTUM_ROOT)
set(AER_COMPILER_FLAGS "${AER_COMPILER_FLAGS} -I${CUQUANTUM_ROOT}/include")
set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -L${CUQUANTUM_ROOT}/lib/${CUDA_VERSION_MAJOR}")
endif()
if(DEFINED CUTENSOR_ROOT)
set(AER_COMPILER_FLAGS "${AER_COMPILER_FLAGS} -I${CUTENSOR_ROOT}/include")
set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -L${CUTENSOR_ROOT}/lib/${CUDA_VERSION_MAJOR}")
endif()
if(CUQUANTUM_STATIC)
set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -lcustatevec_static -lcutensornet_static -lcutensor_static -lmetis_static -lcusolver_static -lcusparse_static -lcusolver_lapack_static -lcublas_static -lcublasLt_static -lculibos")
else()
set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -lcustatevec -lcutensornet -lcutensor")
endif()
elseif(CUSTATEVEC_ROOT)
#TODO this is remained for backward compatibility, use CUQUANTUM_ROOT instead
set(AER_COMPILER_DEFINITIONS ${AER_COMPILER_DEFINITIONS} AER_CUSTATEVEC)
set(AER_COMPILER_FLAGS "${AER_COMPILER_FLAGS} -I${CUSTATEVEC_ROOT}/include")
if(CUSTATEVEC_STATIC)
set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -L${CUSTATEVEC_ROOT}/lib -L${CUSTATEVEC_ROOT}/lib/${CUDA_VERSION_MAJOR} -lcustatevec_static -lcusolver_static -lcusparse_static -lcusolver_lapack_static -lcublas_static -lcublasLt_static -lculibos")
else()
set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -L${CUSTATEVEC_ROOT}/lib -L${CUSTATEVEC_ROOT}/lib/${CUDA_VERSION_MAJOR} -lcustatevec")
endif()
endif()
endif()
elseif(AER_THRUST_BACKEND STREQUAL "TBB")
Expand Down
Loading