[Python] Remote execution speed up doesn't support custom operations
Open
Nobody has claimed this yet.
bug
python-lang
stale-notified
- Dominant language
- C++
- Stars
- 1.1k
- Forks
- 456
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 165
Description
Required prerequisites
- 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.
- Make sure you've read the documentation. Your issue may be addressed there.
- 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
E RuntimeError: Failed to launch kernel. Error: Failed to execute the kernel on the remote server: "Failed to process incoming request"
E Error message: "test_remote_code_exec.py:364: error: unhandled function call - custom_h, known kernels are dict_keys([])\n\t (offending source -> custom_h(qubits[0]))"
Steps to reproduce the bug
def test_arbitrary_unitary_synthesis():
cudaq.register_operation("custom_h",
1. / np.sqrt(2.) * np.array([1, 1, 1, -1]))
cudaq.register_operation("custom_x", np.array([0, 1, 1, 0]))
@cudaq.kernel
def bell(angles: list[float]):
qubits = cudaq.qvector(2)
custom_h(qubits[0])
custom_x.ctrl(qubits[0], qubits[1])
ry(angles[0], qubits[1])
hamiltonian = 5.907 - 2.1433 * spin.x(0) * spin.x(1) - 2.1433 * spin.y(
0) * spin.y(1) + .21829 * spin.z(0) - 6.125 * spin.z(1)
optimizer = cudaq.optimizers.Adam()
energy, parameter = cudaq.vqe(kernel=bell,
spin_operator=hamiltonian,
optimizer=optimizer,
parameter_count=1)
print(f"\nminimized <H> = {round(energy,16)}")
print(f"optimal theta = {round(parameter[0],16)}")
Expected behavior
Application program runs successfully.
Is this a regression? If it is, put the last known working version (or commit) here.
Not a regression
Environment
- CUDA Quantum version:
main(or PR#1794 if not yet merged) - Python version: any
- C++ compiler: N/A
- Operating system:
Suggestions
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the failing reproduction in test_remote_code_exec.py at line 364, especially test_arbitrary_unitary_synthesis and its cudaq.register_operation calls. Run the remote execution case and trace how custom_h and custom_x are handled by the remote server. Done means the application runs successfully with custom operations, without the reported kernel-launch error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100