IBM’s Qiskit Quantum Computing Software Ported to AMD’s ROCm Platform, Expanding GPU Compatibility

Ibm'S Qiskit Quantum Computing Software Ported To Amd'S Rocm Platform, Expanding Gpu Compatibility

Qiskit, an open-source quantum computing software package developed by IBM, is a widely used quantum algorithm development framework. It includes QiskitAer, a quantum simulator, and qiskitaqua, a quantum application algorithm. However, Qiskit and QiskitAer have difficulty working with AMD GPUs. This is where the ROCm platform, a heterogeneous computing framework proposed by AMD, comes in. The goal is to port QiskitAer to the ROCm HIP platform and test its performance on AMD GPUs. The porting process involves three stages: compilation environment, QiskitAer, and THRUST library. The results show that Qiskit QiskitAer can work well on AMD GPUs with the help of ROCm HIP.

What is Qiskit and its Role in Quantum Computing?

Qiskit is a widely used quantum algorithm development framework. It is an open-source quantum computing software package developed by IBM, which includes QiskitAer, a quantum simulator, and qiskitaqua, a quantum application algorithm. QiskitAer is one of the core modules in Qiskit, providing different types of quantum simulators for simulating quantum circuit computation processes on classical computers. Some simulators can accelerate the computation using NVIDIA GPUs based on CUDA and THRUST library.

Quantum computing is one of the most promising directions of scientific computing and has shown many potential applications in quantum chemistry, biomolecules, materials physics, drug development, and other fields. Digital quantum simulators, like Qiskit, using electronic computers to simulate processes of quantum computing, can verify the correctness of physical quantum computers to quickly develop and debug quantum algorithms.

While Qiskit and QiskitAer work well with NVIDIA GPUs, they have difficulty in cooperation with AMD GPUs. This is where the ROCm platform comes into play.

What is the ROCm Platform and its Role in Quantum Computing?

The ROCm platform is a heterogeneous computing framework proposed by AMD in 2016. It is similar to CUDA and provides tools like hipify to help developers port their CUDA software to the ROCm platform. The architecture of the ROCm platform includes driver runtimes, programming models like OpenMP and OpenCL, compilers, tools, and common libraries.

The ROCm platform supports both NVIDIA and AMD GPUs, providing the possibility to port Qiskit QiskitAer from the CUDA platform to its own. Many CUDA software or applications have been ported to the ROCm platform, such as Tensorflow, PyTorch, and QUDA. The goal is to port QiskitAer to the ROCm HIP platform and test its performance on AMD GPUs.

What are the Challenges and Process of Porting QiskitAer to the ROCm Platform?

One of the challenges of porting was the level of THRUST support on the ROCm platform. In addition, the ROCm platform uses Clang as its backend, and some programs that can be compiled under the CUDA platform may not necessarily be compiled under the ROCm platform.

The code porting of QiskitAer is mainly divided into three stages: compilation environment, QiskitAer, and THRUST library. QiskitAer uses CMake as its compiling toolkit, so ROCm HIP support was added in the cmake file. The GPU code of QiskitAer is relatively centralized and mainly thrust code, so it was relatively easy to port. Tools like hipifyperl and hipifycmakefile were used to find what needed to be altered.

To unify the CUDA and ROCm frameworks, some types and functions were redefined, such as cudaSuccess or hipSuccess redefined as aerSuccess, etc., and enabled the different definitions through the AERTHRUSTCUDA or AERTHRUSTROCm macros depending on the compiling platform and backend.

How is THRUST Involved in the Porting Process?

THRUST is used by QiskitAer for GPU-accelerated computation, which is also one of the difficulties in porting. THRUST relies heavily on OpenMP instructions to accelerate computation and provides a backend based on OpenMP. However, the ROCm platform has some problems in compiling a mix of OpenMP and GPU codes. In many cases, one can only use the OPENMP macro to let the compiler determine whether to enable or disable OpenMP.

What is the Compilation and Installation Process?

The compilation and installation process involves using GCC 7 and ROCm 5 to compile QiskitAer. There were some problems using conan to compile, so conan was disabled and Unix Makefiles for cmake generator was used. To run Qiskit on multiple nodes, MPI support was enabled while GDR function was disabled due to compatibility issues.

After compiling for about 3 hours, a package like qiskitaergpuxxxlinuxx8664whl will be generated under the dist directory if no errors occur. The GPU support was checked with the following commands after installing the package manually.

What are the Results and Future Implications?

The results show that Qiskit QiskitAer can work well on AMD GPUs with the help of ROCm HIP and has comparable performance on the AMD platform. The ROCm-compatible Qiskit of v0.11.1 has been used in the process. This porting progress and preliminary performance test on both NVIDIA and AMD GPUs is a significant step in the field of quantum computing, opening up more possibilities for the use of different GPUs in quantum computing frameworks.

Publication details: “Running Qiskit on ROCm Platform”
Publication Date: 2024-01-01
Authors: Y. J. Bi, Shuang Xu and Yunheng Ma
Source: EPJ web of conferences
DOI: https://doi.org/10.1051/epjconf/202429511022