-
Notifications
You must be signed in to change notification settings - Fork 1
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
Benchmark OMEinsum against Finch #259
Comments
Finch also supports a macro It might be interesting to compare the calling overhead of the two libraries, as Finch also handles dynamic tensor expressions and compiles kernels for them. (i.e. how long does it take to compile a new einsum, and how long does it take to run an already-compiled one)? Finch is really only optimized for sparse tensors. In the dense case, Finch is only as good as writing "for i; for j; for k; ...". |
In our case, einsum expressions are chosen dynamically on run-time and can be big (like involving around 30 indices or more).
So this is the main reason: We found out that OMEinsum has a huuuuuge overhead on this dynamic case. We're not using the
Ah that's a pity for the dense case. My understanding was that it wasn't fully optimized but could do sth more. How about a sparse-dense pairwise contraction? And block-diagonal tensors? |
Sparse-dense runs well in Finch. We're currently considering approaches to offload the dense finch code to an optimized dense framework for added performance improvement |
Finch can do block matrices if you represent them as a 4-tensor. We're currently working on more streamlined approaches for block matrices, but the current format would be:
|
| In our case, einsum expressions are chosen dynamically on run-time and can be big (like involving around 30 indices or more). We're not using the @Einsum macro but the methods bellow and still the overhead is like 5-orders of magnitude bigger than calling Reactant.jl compiled function. If big kernels are the goal, I would try using the Galley scheduler. It was designed to break big einsums up into manageable pieces. I'll mention @kylebd99 as the lead author of that scheduler. |
and how about generalize n-order tensors?
do you mean this paper? https://arxiv.org/pdf/2408.14706v2 |
Yes, Finch supports general order-n tensors. For example,
Galley is included with Finch, and can be invoked as:
|
There is this nice package by @willow-ahrens https://github.com/finch-tensor/Finch.jl, which is a compiler for tensor algebra. In principle is optimized for sparse algebra, but I know that it also supports dense tensor algebra and would like to
OMEinsum.einsum
vsFinch.tensordot
.Although we have Reactant.jl for squeezing every drop of performance, I would like to have a better default contraction since OMEinsum is incredibly slow for dynamic einsum and TensorOperations.jl doesn't support all the einsum cases we use.
The text was updated successfully, but these errors were encountered: