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

CUDA-Q quantum transformer tutorial #2614

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

anthonysmaldone
Copy link

Description

This is a ipynb notebook and corresponding scripts that include a tutorial of a hybrid quantum-classical transformer model from the paper: A Hybrid Transformer Architecture with a Quantized Self-Attention Mechanism Applied to Molecular Generation - a collaborative effort between NVIDIA and Yale University.

Copy link

copy-pr-bot bot commented Feb 13, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@schweitzpgi schweitzpgi added the documentation Improvements or additions to documentation label Feb 14, 2025
@sacpis
Copy link
Collaborator

sacpis commented Feb 27, 2025

@anthonysmaldone Thanks for putting up this PR.

Would you please run the following commands to fix the CI build failures?

  1. yapf --style google --recursive -i docs/sphinx/applications/python/quantum_transformer_src/*.py
  2. bash scripts/run_all_spelling.sh (from cuda-quantum directory)

@sacpis
Copy link
Collaborator

sacpis commented Feb 27, 2025

/ok to test

Command Bot: Processing...

@sacpis
Copy link
Collaborator

sacpis commented Feb 27, 2025

When I run to run the notebook in local dev container, I see the following error

ERROR: Could not find a version that satisfies the requirement cudaq==0.9.1 (from versions: none)
ERROR: No matching distribution found for cudaq==0.9.1
Note: you may need to restart the kernel to use updated packages.

@anthonysmaldone
Copy link
Author

@sacpis I have fixed the installation issue and restyled the code. There are basic machine learning and chemistry terms that fail during spellcheck (such as 'logits', 'dataset', 'stereocenters', 'physicochemical', etc) should I add some of these to the spelling_allowlist.txt in the workflow config?

@sacpis
Copy link
Collaborator

sacpis commented Feb 27, 2025

@anthonysmaldone You can wrap those in ``. I think those are in the comments, right?

@anthonysmaldone
Copy link
Author

@sacpis Yes, they should all be in comments/docstrings

@anthonysmaldone
Copy link
Author

@sacpis I have made the requested changes, please let me know if there is anything else I can do.

@sacpis
Copy link
Collaborator

sacpis commented Feb 27, 2025

/ok to test

Command Bot: Processing...

@sacpis
Copy link
Collaborator

sacpis commented Feb 27, 2025

@anthonysmaldone We are getting the following doc error

https://github.com/NVIDIA/cuda-quantum/actions/runs/13570884770/job/37937243190?pr=2614#step:9:276

Would you please include the python notebook in docs/sphinx/using/applications.rst file?

@anthonysmaldone
Copy link
Author

@sacpis I've added the notebook to the application.rst file

@sacpis
Copy link
Collaborator

sacpis commented Feb 27, 2025

/ok to test

Command Bot: Processing...

@sacpis sacpis self-requested a review February 27, 2025 18:26
Copy link
Collaborator

@sacpis sacpis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @anthonysmaldone.

@sacpis sacpis enabled auto-merge (squash) February 27, 2025 19:35
@sacpis
Copy link
Collaborator

sacpis commented Feb 27, 2025

/ok to test

Command Bot: Processing...

Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Feb 27, 2025
@sacpis
Copy link
Collaborator

sacpis commented Feb 28, 2025

/ok to test

Command Bot: Processing...

Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Feb 28, 2025
@sacpis
Copy link
Collaborator

sacpis commented Feb 28, 2025

/ok to test

Command Bot: Processing...

github-actions bot pushed a commit that referenced this pull request Feb 28, 2025
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Feb 28, 2025
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

@sacpis
Copy link
Collaborator

sacpis commented Feb 28, 2025

/ok to test

Command Bot: Processing...

@sacpis
Copy link
Collaborator

sacpis commented Feb 28, 2025

@bmhowe23 Is it safe to skip the conversion of quantum_transformer notebook? It is taking long and failing.
https://github.com/NVIDIA/cuda-quantum/actions/runs/13591336814/job/37999481528?pr=2614

@bmhowe23
Copy link
Collaborator

bmhowe23 commented Feb 28, 2025

@bmhowe23 Is it safe to skip the conversion of quantum_transformer notebook? It is taking long and failing. https://github.com/NVIDIA/cuda-quantum/actions/runs/13591336814/job/37999481528?pr=2614

That should probably be answered by @bettinaheim. We normally like to be able to test our published examples on a regular basis to ensure they don't break with any new cuda-quantum code updates. Skipping testing of this notebook would expose us to the risk of it breaking and us not knowing about it.

Are you proposing skipping testing of this in just the per-PR CI (CPU only), all CI (even tests w/ GPUs), or all automated testing (even release-level QA testing)?

@sacpis
Copy link
Collaborator

sacpis commented Feb 28, 2025

Thank you @bmhowe23.

Are you proposing skipping testing of this in just the per-PR CI (CPU only), all CI (even tests w/ GPUs), or all automated testing (even release-level QA testing)?

I am proposing to skip this in just the per-PR CI (CPU only).

github-actions bot pushed a commit that referenced this pull request Feb 28, 2025
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

@anthonysmaldone
Copy link
Author

@sacpis After checking the docs preview, I noticed the sections of the transformer notebook are headings under "Applications", let if know if I should change the notebook

@sacpis
Copy link
Collaborator

sacpis commented Feb 28, 2025

@anthonysmaldone Sure. Would you please tell me where should it go?

@anthonysmaldone
Copy link
Author

@sacpis It should still be under 'Applications". However now I see that Applications has subheadings "Installation", "Algorithm and Examples" and "Usage" -which are the section titles in the notebook. Do they need to be one level smaller in the tutorial notebook?

@sacpis
Copy link
Collaborator

sacpis commented Feb 28, 2025

Ah, I see what you are referring to.

Please use # <title> to mention the title of your notebook. Then you can use ### <sub-headings> inside the notebook for Installations, Algorithm and Examples, Usages etc.

auto-merge was automatically disabled March 1, 2025 03:42

Head branch was pushed to by a user without write access

@anthonysmaldone
Copy link
Author

@sacpis Sounds good, ive made the updates

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

Successfully merging this pull request may close these issues.

4 participants