Skip to content

Support CUDA.jl v6 in CuYao - #601

Open
lana-phasecraft wants to merge 2 commits into
QuantumBFS:masterfrom
PhaseCraft:cuda6
Open

lana-phasecraft wants to merge 2 commits into
QuantumBFS:masterfrom
PhaseCraft:cuda6

Conversation

@lana-phasecraft

Copy link
Copy Markdown
Collaborator

CUDA.jl 6 splits into CUDACore + library packages, and the CUDA module now only forwards CUDACore's public names. CuYao relied on two non-public ones.

Changes

  • Bump CUDA compat to "4, 5, 6" in Project.toml and ext/CuYao/test/Project.toml
  • Reach GPUArrays and adapt via CUDA.CUDACore when it exists, falling back to CUDA on 4.x/5.x (so behaviour there is unchanged)
  • cu(::TensorNetwork) now passes through label_to_qubit, required since YaoToEinsum 0.2.8 added the third field. This was failing on every CUDA version and is an unrelated fix.

Testing

CuYao test suite (ext/CuYao/test/runtests.jl) run on a GPU with CUDA 6.5.0 and 5.11.3. Happy to provide evidence of this if needed.

@lana-phasecraft

Copy link
Copy Markdown
Collaborator Author

@Roger-luo or @GiggleLiu, could I ask either of you for a review on this please? Thanks!

@codecov

codecov Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.21%. Comparing base (d1a9a3e) to head (b143669).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #601   +/-   ##
=======================================
  Coverage   89.21%   89.21%           
=======================================
  Files          90       90           
  Lines        5861     5861           
=======================================
  Hits         5229     5229           
  Misses        632      632           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lana-phasecraft

Copy link
Copy Markdown
Collaborator Author

I've figured out why the YaoToEinsum tests failed, Julia 1.13 has changed the way it hashes Vector{Int} e.g. collect(keys(Dict([k]=>0 for k in 1:3))) gives [[3], [1], [2]] on 1.12 and [[1], [3], [2]] on 1.13 which changes the order of the vector returned (in test line 70 test/LuxorExt.jl). I think there are a few options:

  1. Change the src code to return the sorted vector so we get the same values on all julia versions.
  2. Change only the test to compare the sorted vectors
  3. Leave any of this out of this PR

Let me know what you think, thanks!

@Roger-luo

Copy link
Copy Markdown
Member

It would be nice to have a separate PR fixing the tests then we can merge that PR back to this branch to get CI passing.

@Roger-luo

Copy link
Copy Markdown
Member

I think we should just change the test, iut was a bit strange that the test relys on the assumptions of how dict is ordered.

This branch has not been deployed

No deployments
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