I was running the following code on a cuQuantum Appliance 23.03 Docker instance, on an a2-highgpu-1g, with a RAM of 85 GB:
Traceback (most recent call last):
File "oom.py", line 15, in <module>
sim.simulate(qc_cirq)
File "/home/cuquantum/conda/envs/cuquantum-23.03/lib/python3.8/site-packages/cirq/sim/simulator.py", line 495, in simulate
return self.simulate_sweep(
File "/home/cuquantum/conda/envs/cuquantum-23.03/lib/python3.8/site-packages/cirq/sim/simulator.py", line 510, in simulate_sweep
return list(self.simulate_sweep_iter(program, params, qubit_order, initial_state))
File "/home/cuquantum/conda/envs/cuquantum-23.03/lib/python3.8/site-packages/qsimcirq/qsim_simulator.py", line 529, in simulate_sweep_iter
final_state = cirq.StateVectorSimulationState(
File "/home/cuquantum/conda/envs/cuquantum-23.03/lib/python3.8/site-packages/cirq/sim/state_vector_simulation_state.py", line 350, in __init__
state = _BufferedStateVector.create(
File "/home/cuquantum/conda/envs/cuquantum-23.03/lib/python3.8/site-packages/cirq/sim/state_vector_simulation_state.py", line 85, in create
return cls(state_vector, buffer)
File "/home/cuquantum/conda/envs/cuquantum-23.03/lib/python3.8/site-packages/cirq/sim/state_vector_simulation_state.py", line 44, in __init__
buffer = np.empty_like(state_vector)
File "<__array_function__ internals>", line 180, in empty_like
numpy.core._exceptions.MemoryError: Unable to allocate 32.0 GiB for an array with shape (2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) and data type complex64
The most I can bisect is between releases, and so it is due to change(s) between 0.13 and 0.14. Any idea what could be the cause?
I was running the following code on a cuQuantum Appliance 23.03 Docker instance, on an a2-highgpu-1g, with a RAM of 85 GB:
The code ran just fine with
cirq.Simulator(), taking 2 s in total. It ran fine withqsimcirq.QSimSimulator()for qsimcirq 0.12, taking ~19 s in total (probably could be optimized to ~2 s), and ran fine for qsimcirq 0.13, taking ~1 min 8 s. But for qsimcirq 0.14 and 0.16, I gotThe line where the error happens, is for construction of the final state vector after the simulation has finished.
The most I can bisect is between releases, and so it is due to change(s) between 0.13 and 0.14. Any idea what could be the cause?