Open jccalvojackson opened 1 year ago
My guess would be there is something going on with the interface here: https://github.com/tensorflow/quantum/blob/v0.7.2/tensorflow_quantum/core/ops/cirq_ops.py#L125, might be a good place to investigate more. Although I am interested in seeing why you want to use qsim as the backend when TFQ already uses qsim by default.
My guess would be there is something going on with the interface here: https://github.com/tensorflow/quantum/blob/v0.7.2/tensorflow_quantum/core/ops/cirq_ops.py#L125, might be a good place to investigate more.
thank you, ill look into it.
Although I am interested in seeing why you want to use qsim as the backend when TFQ already uses qsim by default.
It was a sanity check. I actually want to benchmark QRL using different backends, including cuQuantum
. So for example I want run QRL using different QSimSimulator
options like:
ops = qsimcirq.QSimOptions(gpu_mode=0, use_gpu=True, max_fused_gate_size=nfused)
ops = qsimcirq.QSimOptions(gpu_mode=0, disable_gpu=False, use_sampler=False, max_fused_gate_size=nfused)
ops = qsimcirq.QSimOptions(gpu_mode=1, use_gpu=True, max_fused_gate_size=nfused)
ops = qsimcirq.QSimOptions(gpu_mode=1, disable_gpu=False, use_sampler=False, max_fused_gate_size=nfused)
ops = qsimcirq.QSimOptions(use_gpu=False, cpu_threads=ncpu_threads, max_fused_gate_size=nfused)
ops = qsimcirq.QSimOptions(disable_gpu=True, use_sampler=False, cpu_threads=ncpu_threads, max_fused_gate_size=nfused, gpu_mode=0)
Im now trying on a gpu using these images but now I face other problems that possibly require to compile tensor flow from source.
Another question. Any particular reason TFQ has pinned dependencies (as opposed to a range), could it be used with cirq>0.13?
thank you
GPU support for ops is super nascent (see: https://github.com/tensorflow/quantum/pull/759), I'm not 100% what state it is in so if you encounter errors, be sure to share them. Regarding pinned dependencies, there is a PR to update that (https://github.com/tensorflow/quantum/pull/697) but idk if it will happen.
thank you very much!
I've added the error I get on gpu
regarding the original issue about getting stuck on cpu mode. I've run these tests tensorflow_quantum/python/layers/high_level/controlled_pqc_test.py
using the qsimcirq.QSimSimulator()
and they all go through with no problem. This means it is able to construct the corresponding operator. But somehow, for the inputs of the qrl model it gets stuck whereas for the inputs of the tests it does not
I've ran this notebook with no problem. However, if I try to use
qsim
as a backend by passing the backendbackend = qsimcirq.QSimSimulator()
explicitly toReUploadingPQC
, then I get the following messageand it gets stuck there indefinitely.
Any idea of what might be going on?
To reproduce:
replace
with
and then replace
versions: