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

Make CuYao an extension #494

Merged
merged 6 commits into from
Feb 29, 2024
Merged

Make CuYao an extension #494

merged 6 commits into from
Feb 29, 2024

Conversation

GiggleLiu
Copy link
Member

@GiggleLiu GiggleLiu commented Feb 24, 2024

Instead of installing CuYao, the CUDA extension can be access by typing

julia> using Yao, CUDA

julia> reg = rand_state(5) |> cu
ArrayReg{2, ComplexF64, CuArray...}
    active qubits: 5/5
    nlevel: 2

To test the CUDA extension, please run

$ make test-CuYao

Some extra make targets are added:

  • make init and make init-docs to initialize Yao and docs environment.

  • make update and make update-docs to update the above environments.

  • make test-<package name> to test a component package.

  • make test to test all component packages.

  • make coverage to test all component packages and generate the coverage files.

  • make is a combinaton of make init and make test

  • make-servedocs to serve documents.

  • make clean to clean up document build and .cov files.

Maybe we can remove .ci in the future.

Copy link

codecov bot commented Feb 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.75%. Comparing base (e17a32b) to head (ac15ea8).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #494      +/-   ##
==========================================
- Coverage   89.03%   88.75%   -0.29%     
==========================================
  Files          83       87       +4     
  Lines        4835     5264     +429     
==========================================
+ Hits         4305     4672     +367     
- Misses        530      592      +62     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@GiggleLiu
Copy link
Member Author

@Roger-luo all tests pass except the nightly.

Copy link
Member

@Roger-luo Roger-luo left a comment

Choose a reason for hiding this comment

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

how is CUDA current being tested in CI? I don't see any test being setup in the CI?

[compat]
BitBasis = "0.8, 0.9"
CUDA = "4, 5"
Copy link
Member

Choose a reason for hiding this comment

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

do we actually support both versions?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think so? We can remove it later if its not compatible anymore.

ext/CuYao/README.md Outdated Show resolved Hide resolved
@GiggleLiu
Copy link
Member Author

how is CUDA current being tested in CI? I don't see any test being setup in the CI?

I haven't setup the CI yet, we need to test locally. We do not have tests for CuYao for long time.

@@ -7,6 +7,7 @@ FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
Copy link
Member

Choose a reason for hiding this comment

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

do we actually need this to build the doc?

Copy link
Member Author

@GiggleLiu GiggleLiu Feb 28, 2024

Choose a reason for hiding this comment

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

No, it is just convenient, otherwise you will have to start a temp environment and install LiveServer. Do you have a better option? Now the workflow is

make init-docs   # initialize the docs environment
make servedocs    # live serve

Copy link
Member

Choose a reason for hiding this comment

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

I'd just use a separate Project.toml file for dev only within .ci directory. So you can keep the main environment clean. This is where I hate the stack env design... but LiveServer is not that big to download so prob fine if you insist.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh I see. We can fix this issue in the future when this workflow causes any trouble.

@GiggleLiu GiggleLiu merged commit 888280c into master Feb 29, 2024
21 of 24 checks passed
@GiggleLiu GiggleLiu deleted the jg/move-CuYao branch February 29, 2024 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants