willow-ahrens / Finch.jl

Sparse tensors in Julia and more! Datastructure-driven array programing language.
http://willowahrens.io/Finch.jl/
MIT License
159 stars 15 forks source link

updates to SparseDictLevel #601

Closed willow-ahrens closed 3 months ago

willow-ahrens commented 3 months ago

uses a more unified style for SparseDict, in keeping with the rest of Finch.

also, fixes #579 and fixes #540. We also remove SparseHashLevel, because it's too much work to keep that from bitrotting.

Benchmarks (note permutedims(Dense(Sparse)))

|                                                      | dirty              | main               |
|:-----------------------------------------------------|:------------------:|:------------------:|
| compile/compile_SpGeMM                               | 0.0369 ± 0.00067 s | 0.037 ± 0.0011 s   |
| compile/compile_pretty_triangle                      | 2.28 s             | 2.3 s              |
| compile/time_to_first_SpGeMM                         | 4.96 s             | 4.95 s             |
| graphs/bellmanford/Newman/netscience                 | 0.0811 ± 0.0057 ms | 0.0792 ± 0.0048 ms |
| graphs/bellmanford/SNAP/roadNet-CA                   | 0.137 s            | 0.145 s            |
| graphs/bfs/SNAP/soc-Epinions1                        | 3.11 ± 0.12 ms     | 3.09 ± 0.11 ms     |
| graphs/bfs/SNAP/soc-LiveJournal1                     | 0.4 ± 0.007 s      | 0.399 ± 0.018 s    |
| graphs/pagerank/SNAP/soc-Epinions1                   | 17.7 ± 0.37 ms     | 17.7 ± 0.43 ms     |
| graphs/pagerank/SNAP/soc-LiveJournal1                | 3.4 s              | 3.5 s              |
| high-level/einsum_spmv_baremetal                     | 4.46 ± 0.083 ns    | 4.42 ± 0.041 ns    |
| high-level/einsum_spmv_call_overhead                 | 25.2 ± 2 μs        | 23.8 ± 1.5 μs      |
| high-level/einsum_spmv_compile_overhead              | 0.256 ± 0.035 s    | 0.272 ± 0.045 s    |
| high-level/permutedims(Dense(Dense()))               | 0.276 ± 0.01 s     | 0.286 ± 0.015 s    |
| high-level/permutedims(Dense(Sparse()))              | 0.0846 ± 0.064 s   | 0.0937 ± 0.0033 s  |
| indices/SpMV_32/SNAP/soc-Epinions1                   | 1.6 ± 0.044 ms     | 1.56 ± 0.093 ms    |
| indices/SpMV_64/SNAP/soc-Epinions1                   | 0.797 ± 0.016 ms   | 0.797 ± 0.017 ms   |
| indices/SpMV_p1/SNAP/soc-Epinions1                   | 0.831 ± 0.014 ms   | 0.833 ± 0.02 ms    |
| matrices/ATA_spgemm_gustavson/SNAP/soc-Epinions1     | 0.819 ± 0.17 s     | 0.802 ± 0.2 s      |
| matrices/ATA_spgemm_outer/SNAP/soc-Epinions1         | 3.97 s             | 4.06 s             |
| parallel/SpMV_serial/SNAP/soc-Epinions1              | 0.798 ± 0.02 ms    | 0.804 ± 0.025 ms   |
| parallel/SpMV_serial/fsprand(10_000, 10_000, 0.01)   | 0.724 ± 0.022 ms   | 0.715 ± 0.018 ms   |
| parallel/SpMV_threaded/SNAP/soc-Epinions1            | 0.844 ± 0.036 ms   | 0.837 ± 0.027 ms   |
| parallel/SpMV_threaded/fsprand(10_000, 10_000, 0.01) | 0.744 ± 0.026 ms   | 0.737 ± 0.02 ms    |
| time_to_load                                         | 0.605 ± 0.014 s    | 0.609 ± 0.024 s    |