QuEST-Kit/QuEST

GPU measurement bug when env.numRanks > 1

Closed this issue · 1 comments

I have created a QuESTEnv env and set env.numRanks to pow(2, numQubits-30) if numQubits >= 32 to solve the memory allocation issue on GPU. The simulator measures normally with circuits under 30 qubits. However, when numQubits >= 32, the simulator measures 1 for every qubit in every circuit. Does larger numRanks change or degrade the result of simulation?

Circuit source: .qasm files transformed from .txt files generated by https://github.com/sboixo/GRCS
Number of qubits: 4x4, 4x5, 5x6, 6x6, 6x7, 7x7, 7x8
Circuit depth: 6
QuEST precision: PRECISION=2
Simulator source: https://github.com/ChienKaiMa/QuEST/tree/master/qasmSim

Hi there,

You cannot manually modify env.numRanks, this won't actually change your distribution (and may instead break many internal functions). createQuESTEnv() will automatically use as many ranks as there are nodes in your MPI process.
For example,

mpirun -np 4 myProgram

will cause createQuESTEnv() (in myProgram) to identify 4 ranks, and subsequent createQureg() calls will split the state-vectors uniformly between those 4 nodes.

Furthermore, QuEST presently supports only a single GPU. You cannot use both distribution and GPU acceleration at the same time (both the CMake and make builds will alert you about it, and stop compilation).

Hope this makes sense!
Tyson