Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradients example doesn't make progress on the GPU runners #622

Closed
2 of 3 tasks
bettinaheim opened this issue Sep 8, 2023 · 3 comments
Closed
2 of 3 tasks

Gradients example doesn't make progress on the GPU runners #622

bettinaheim opened this issue Sep 8, 2023 · 3 comments
Assignees

Comments

@bettinaheim
Copy link
Collaborator

bettinaheim commented Sep 8, 2023

Required prerequisites

  • 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

Enabling a basic validation that runs all examples on the GPU backends, the gradients example fails to make progress. Locally, everything works fine, but on the runners the values are odd:
Locally:

Optimize with no gradients.
<H>(0.000000, 0.000000) = -0.436286
<H>(1.570796, 0.000000) = 12.250291
<H>(0.000000, 1.570796) = 9.407001
<H>(-1.241051, -0.962909) = 8.691541
<H>(-0.620525, -0.481455) = 6.446059
...

On the GH runner:

Optimize with no gradients.
<H>(0.000000, 0.000000) = 15.532000
<H>(1.570796, 0.000000) = 15.532000
<H>(0.000000, 1.570796) = 15.532000
<H>(0.107242, 0.000000) = 15.532000
<H>(0.000000, 0.082867) = 15.532000
...
<H>(0.000000, 0.000000) = 15.532000
<H>(0.000000, 0.000000) = 15.532000 (keeps being this)

I haven't had a chance to look further.

May be related:
#583
#623
#399

Steps to reproduce the bug

In .github/workflows/publishing.yml enable the /home/cudaq/examples/cpp/other/gradients.cpp example in the validation job, then manually run the workflow for a recent deployment. It would be good to find a local repro, but I don't have one right now.

Expected behavior

The example should succeed.

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

Not a regression

Environment

  • CUDA Quantum version: latest main
  • Python version: N/A
  • C++ compiler: any
  • Operating system: N/A

Suggestions

No response

@zaikunzhang
Copy link

zaikunzhang commented Sep 20, 2023

Hi, I guess the optimization is done by Powell's COBYLA here. If yes, this is a known issue of the old version of COBYLA based on the original Fortran 77 implementation, which may get stuck in infinite loops. It is advised to switch to the PRIMA implementation of COBYLA. See #399 (comment). Thanks.

@schweitzpgi
Copy link
Collaborator

Claims to be fixed.

@1tnguyen
Copy link
Collaborator

Gradients example has been readded to the GPU validation test suite. Closing.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants