NVIDIA / NVIDIA/cuda-quantum

Numpy types are allowed in kernel signatures but not created as such during return

Open
#3,524 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Even though we allow to use numpy integers and floating point types in kernel signatures, the returned value is always a standard type. Kernels respect the requested bitwidths passed for arguments, but return values are not handled properly to respect it.

Steps to reproduce the bug

There are some test cases in the code with a link to this issue posted.

Expected behavior

We should create the appropriate numpy values.

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

Not a regression

Environment
Suggestions

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the test cases in the code that reference issue 3524, then trace the kernel return-value path for NumPy integer and floating-point signatures. Compare it with argument handling and verify that returned values preserve the requested NumPy type and bitwidth; done means the relevant tests pass for the supported types.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, numpy, python
Domain
backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.