Skip to content

Start on batched SVD support - #567

Draft
kshyatt wants to merge 3 commits into
mainfrom
ksh/batched_svd2
Draft

kshyatt wants to merge 3 commits into
mainfrom
ksh/batched_svd2

Conversation

@kshyatt

@kshyatt kshyatt commented Oct 5, 2026

Copy link
Copy Markdown
Member

No description provided.

@kshyatt
kshyatt requested review from Jutho and lkdvos October 5, 2026 11:47

@lkdvos lkdvos left a comment

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 haven't looked in too much detail at the actual implementation, but I think there's two more high-level comments/questions I have here:

I'm a bit surprised about actually trying to implement batched_f(::AbstractTensorMap), since that doesn't really feel like what is going on (it's a single tensor after all), and more importantly that is not super convenient to switch to from higher-level packages, since that doesn't involve switching algorithm and instead requires switching the function. I was somehow expecting that we would call f(::AbstractTensorMap), which would then automatically dispatch to batched_f on the blocks.

A second comment is that if I'm not mistaken there now is logic for deciding whether or not to batch in both MAK and also here, which is probably something to discuss: I would say we should either implement batched_f to handle how to decide grouping/padding/etc, or alternatively decide that here and pass on the 3D arrays, but in this latter case it seems like the batching logic shouldn't really be in MAK, (I'm also leaning slightly towards having that logic in MAK tbh).

@kshyatt

kshyatt commented Oct 5, 2026

Copy link
Copy Markdown
Member Author

Yeah I kind of did some necromancy on this after the MAK changes so I think this is helpful :). I was kind of torn about whether to "hide the ball" and just call batched_svd_compact! under the hood if the user specified svd_compact!, maybe that's ok to do though since it just falls back to the non batched version anyway...

@kshyatt

kshyatt commented Oct 5, 2026

Copy link
Copy Markdown
Member Author

Managed to offload nearly all the packing and decision making to MAK, the main thing is we need the PR over there to avoid trying to call something that doesn't (yet) exist for the LAPACK bindings.

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