Skip to content

Fix sizes of allocated U, V for Jacobi on CUDA - #314

Merged
kshyatt merged 1 commit into
mainfrom
ksh/cujacobi
Oct 28, 2026
Merged

kshyatt merged 1 commit into
mainfrom
ksh/cujacobi

Conversation

@kshyatt

@kshyatt kshyatt commented Oct 27, 2026

Copy link
Copy Markdown
Member

I think this is causing some silent overrun errors for the jobz = 'N' case which are showing up in PEPSKit.

@kshyatt
kshyatt requested a review from lkdvos October 27, 2026 17:33
@kshyatt
kshyatt enabled auto-merge (squash) October 27, 2026 18:05
@kshyatt
kshyatt merged commit e254166 into main Oct 28, 2026
47 checks passed
@kshyatt
kshyatt deleted the ksh/cujacobi branch October 28, 2026 08:03
@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
ext/MatrixAlgebraKitCUDAExt/yacusolver.jl 96.38% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Ṽ = (jobz == 'V') ? similar(Vᴴ') : similar(Vᴴ, (n, minmn))
Ũ = (jobz == 'V') ? U : similar(U, (m, minmn))
Ṽ = (jobz == 'V') ? similar(Vᴴ') : similar(Vᴴ, (n, n))
Ũ = (jobz == 'V') ? U : similar(U, (m, m))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If I read the CUDA gesvdj documentation correctly, this could have been solved by setting econ = 1 also in the jobz = 'N' case, i.e. change line 217 above. It would be strange to need larger U and V matrices when not computing singular vectors at all, then in the case where we do compute them in economic mode.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's really not clear from their documentation which also states that "U is an mxm unitary matrix, and V is an nxn unitary matrix". Should I try a followup PR setting econ = 1?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tend to trust the argument / API description, i.e. https://docs.nvidia.com/cuda/cusolver/index.html#id156 , though I think there have been cases where this trust was violated in the past 😄 .

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.

3 participants