Skip to content

Some basic svd forward rules and tests#247

Open
kshyatt wants to merge 9 commits into
mainfrom
ksh/svd_fwd
Open

Some basic svd forward rules and tests#247
kshyatt wants to merge 9 commits into
mainfrom
ksh/svd_fwd

Conversation

@kshyatt

@kshyatt kshyatt commented Jun 8, 2026

Copy link
Copy Markdown
Member

Definitely not optimized...

Comment thread src/pushforwards/svd.jl Outdated
@kshyatt

kshyatt commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

Took another look at this. The Enzyme tests seem to be failing because of finite differences, for svd_full for example when size(A) == (17, 19), the finite differences result for dU is all over the place compared to that from the rule for the section of U which is only present in the full case. I'll try to think of a nice way to handle this, I think it is not occurring for Mooncake because Mooncake uses a different technique for checking against FD.

Comment thread src/pushforwards/svd.jl Outdated
ΔU, ΔS, ΔVᴴ = ΔUSVᴴ
r = svd_rank(S; rank_atol)

vΔS = view(ΔS, 1:r, 1:r)

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 think in general we only need the diagonal, so it might make sense to go the other way around: view(diagview(ΔS), 1:r)

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Your PR no longer requires formatting changes. Thank you for your contribution!

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