cuda-quantum icon indicating copy to clipboard operation
cuda-quantum copied to clipboard

Compiler fails to synthesize nested vector parameters

Open bmhowe23 opened this issue 7 months ago • 1 comments

Required prerequisites

  • [X] Consult the security policy. If reporting a security vulnerability, do not report the bug using this form. Use the process described in the policy to report the issue.
  • [X] Make sure you've read the documentation. Your issue may be addressed there.
  • [X] Search the issue tracker to verify that this hasn't already been reported. +1 or comment there if it has.
  • [ ] If possible, make a PR with a failing test to give us a starting point to work on!

Describe the bug

https://nvidia.github.io/cuda-quantum/latest/using/backends/platform.html#supported-kernel-arguments says that nested vectors (at least singly nested vectors like vector<vector<int>>) should be supported, but that only works in Remote MQPU library mode. Compiling with --enable-mlir causes the run to fail with an error message: error: 'func.func' op synthesis: unsupported argument type.

Note that running on NVQC implicitly enables MLIR mode, so this bug means that nested vector parameters do not work with NVQC.

Steps to reproduce the bug

This can already be seen with an example in the repo:

$ nvq++ --enable-mlir --target remote-mqpu --remote-mqpu-url localhost:3030 targettests/Remote-Sim/nested_vectors.cpp
$ ./a.out
loc("nested_vectors.cpp":17:3): error: 'func.func' op synthesis: unsupported argument type
terminate called after throwing an instance of 'std::runtime_error'
  what():  Could not successfully apply quake-synth.
Aborted

Expected behavior

The above example should run without issues, similar to when running without --enable-mlir.

Is this a regression? If it is, put the last known working version (or commit) here.

Not a regression

Environment

  • CUDA Quantum version: 14db4d548 (just prior to 0.8.0 release)
  • Python version: N/A
  • C++ compiler: N/A
  • Operating system: N/A

Suggestions

No response

bmhowe23 avatar Jul 24 '24 16:07 bmhowe23