when running circuit_benchmarks that use more than half of the GPU memory, the dry_run runs fine but then the next run fails with, for instance (for a 32 qubit double precision circuit, 64GB, on a GPU with 96GB of memory)
cupy.cuda.memory.OutOfMemoryError: Out of memory allocating 68,719,476,736 bytes (allocated so far: 68,719,476,736 bytes)
these changes work around the issue for me by always destroying the circuit, which frees the GPU memory, and always recreating it (but I suppose an alternative would be to avoid recreating the circuits by e.g. adding a method to the circuit class that clears the state, or making its constructor overwrite any existing state?)
when running
circuit_benchmarks
that use more than half of the GPU memory, thedry_run
runs fine but then the next run fails with, for instance (for a 32 qubit double precision circuit, 64GB, on a GPU with 96GB of memory)cupy.cuda.memory.OutOfMemoryError: Out of memory allocating 68,719,476,736 bytes (allocated so far: 68,719,476,736 bytes)
these changes work around the issue for me by always destroying the circuit, which frees the GPU memory, and always recreating it (but I suppose an alternative would be to avoid recreating the circuits by e.g. adding a method to the circuit class that clears the state, or making its constructor overwrite any existing state?)
cc @scarrazza