Does tensorflow-quantum support GPU, and if so how do I make it use mine?

303 Views Asked by At

I am getting started on using tensorflow-quantum for some QML circuit simulations. I have everything configured correctly for TensorFlow with GPU, and when I run print(tf.config.list_physical_devices('GPU')), it reports the presence of my GPU.

However, I've done some Googling, and I've come across a few things suggesting that tensorflow-quantum doesn't actually support GPU acceleration for simulations (e.g. MichaelBroughton's first reply here, and this issue which is still open). However, it's unclear to me how up-to-date this state of affairs is. I can't find anything about adding GPU support in the version notes.

Does tensorflow-quantum currently support GPU? If so, how do I (a) make it use my GPU for simulations and (b) verify that it is doing so?

2

There are 2 best solutions below

2
On

I couldn't find specific GPU support on TF Quantum, but Pennylane works with both Keras and Nvidia CuQuantum. It might be worth a look

0
On

Tensorflow-quantum is built upon tensorflow==2.7.0 which does not support CUDA device (see this issue link)