-
Notifications
You must be signed in to change notification settings - Fork 125
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
[NDTensors] BlockSparseArrays
prototype
#1205
Conversation
Codecov ReportAll modified lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1205 +/- ##
===========================================
- Coverage 85.41% 67.22% -18.19%
===========================================
Files 88 87 -1
Lines 8426 8388 -38
===========================================
- Hits 7197 5639 -1558
- Misses 1229 2749 +1520 ☔ View full report in Codecov by Sentry. |
Nice that it's already up and running with so little code. |
@kmp5VT I'm going to merge this so we can start using it. You can already use it as an |
Description
This is a prototype for a
BlockSparseArray
type based on the BlockArrays.jl interface. It is based on wrapping an elementwise sparse array (SparseArray
, also introduced in this PR) which uses a dictionary-of-keys data storage, similar to the design of SparseArrayKit.jl.It is fairly functional with just this amount of code, for example you can get and set elements and blocks and some basic linear algebra works (but isn't optimized for sparsity).
An interesting next step would be to define some tensor operations (perhaps using the interface defined in TensorOperations.jl), remove the type restriction on
Tensor
constraining thestorage
toTensorStorage
, and see if we can get it working as anITensor
backend.@kmp5VT I think this could be a good starting point to build off of for reworking the block sparse code. It already allows blocks with general types. The current
BlockSparseArray
type defined here can have blocks that are slices of a contiguous piece of data but also can be totally generalAbstractArray
s. If we add aDiagArray
type and store them inside the blocks, it would cover our current use cases for theBlockSparse
andDiagBlockSparse
storage types. A more fully functional type that works with a contiguous data backend will probably require a slightly more sophisticated type, however, which stores an extradata
field separate from the block structure, and the block structure storesSubArray
s which are slices into that data.