Open
Description
-
Expected behavior: The attribute remains through the lowering of gradient and quantum dialect up until LLVM-IR (in which case we might wish to annotate it with some metadata).
-
Actual behavior: The gradient transforms generates helper functions which will strip the
qnode
attribute from qnodes. E.g.,
func.func private @f(%arg0: tensor<f64>) -> tensor<f64> attributes {diff_method = "parameter-shift", llvm.linkage = #llvm.linkage<internal>, qnode} {
}
Changes to:
func.func private @f.quantum(%arg0: memref<f64>, %arg1: memref<?xf64>) -> memref<f64> attributes {gradient.qgrad = @f.qgrad, passthrough = ["noinline"]} {
}
This causes async to not be triggered since async looks for the qnode
attribute.
- Reproduces how often: Always