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

Matrix batches #158

Merged
merged 7 commits into from
Nov 25, 2023
Merged

Matrix batches #158

merged 7 commits into from
Nov 25, 2023

Conversation

tgymnich
Copy link
Member

This PR would enable lu factorization in batches. However the MPSKernel only ever runs once for LU decomposition, trying the same for MatMul works just fine.

@maleadt maleadt added enhancement libraries Things about libraries and how we use them. arrays Things about the array abstraction. labels May 22, 2023
@tgymnich
Copy link
Member Author

tgymnich commented Sep 4, 2023

Would be nice to direct something like:
eachslice(X; dims=3) .* eachslice(Y; dims=3) or @einsum C[i,j,b] := A[i,k,b] * B[k,j,b] to the batched MPS matmul kernel. Does not seem like any GPU backend is doing so currently...

@maleadt
Copy link
Member

maleadt commented Sep 5, 2023

eachslice(X; dims=3) .* eachslice(Y; dims=3) or @einsum C[i,j,b] := A[i,k,b] * B[k,j,b] to the batch MPS matmul kernel

Yeah, I'm surprised we haven't come up with anything convenient yet. There's https://github.com/FluxML/NNlib.jl/blob/1b30040fabadd41efa0d9dde5841b90f9f85cf2d/src/batched/batchedmul.jl#L4-L54, but that would require an NNlib.jl dependency.

@tgymnich tgymnich force-pushed the matrix-batches branch 3 times, most recently from 190c7dc to a462b95 Compare September 5, 2023 14:07
@tgymnich tgymnich marked this pull request as ready for review November 21, 2023 12:46
lib/mps/matrix.jl Outdated Show resolved Hide resolved
@maleadt maleadt merged commit 9f1d53e into JuliaGPU:main Nov 25, 2023
1 check passed
@tgymnich tgymnich deleted the matrix-batches branch November 25, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays Things about the array abstraction. libraries Things about libraries and how we use them.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants