Skip to content

Memory Efficiency Benchmarking

Anirudh Subramanian edited this page Sep 7, 2017 · 28 revisions

CSR vs Dense Storage Comparison

Dimensions: 128 * 1M

  • Allocated a uniformly distributed ndarray for sparse and dense of shape (128, 1M) and compared peak memory consumption
Density(%) Peak Memory Consumption (Sparse) Peak Memory Consumption (Dense) Ratio of Memory Consumption
0.01 29 1456 50.20689655
0.02 32 1456 45.5
0.04 34 1456 42.82352941
0.08 40 1456 36.4
0.16 53 1456 27.47169811
0.32 78 1456 18.66666667
0.64 130 1456 11.2
1.28 232 1456 6.275862069
2.56 437 1456 3.33180778
5.12 846 1456 1.721040189
10.24 1626 1456 0.895448954

RSP vs Dense Storage Comparison

  • Allocated a uniformly distributed ndarray for rsp and dense of shape (128, 1M) and compared peak memory consumption
  • NOTE: for rsp density doesn't mean number of nnzs / total elements in the matrix.
Density(%) Peak Memory Consumption (Sparse) Peak Memory Consumption (Dense) Ratio of Memory Consumption
0.01 52 1456 28
0.02 52 1456 28
0.04 52 1456 28
0.08 54 1456 26.96296296
0.16 56 1456 26
0.32 61 1456 23.86885246
0.64 70 1456 20.8
1.28 88 1456 16.54545455
2.56 126 1456 11.55555556
5.12 202 1456 7.207920792
10.24 351 1456 4.148148148
20.48 654 1456 2.226299694
40.96 1222 1456 1.191489362
81.92 2399 1456 0.60691955

dot(csr, rsp) vs dot(csr, dense) Peak Memory consumption Comparison

  • rhs_density is the same as lhs_density
Density(%) Peak Memory Consumption (Sparse) Peak Memory Consumption (Dense) Ratio of Memory Consumption
0.01 52 1575 30.28846154
0.02 52 1575 30.28846154
0.04 54 1575 29.16666667
0.08 57 1575 27.63157895
0.16 65 1575 24.23076923
0.32 87 1575 18.10344828
0.64 132 1575 11.93181818
1.28 221 1575 7.126696833
2.56 400 1575 3.9375
5.12 758 1575 2.077836412
10.24 1480 1575 1.064189189

dot(csr, rsp) vs dot(dense, dense) Peak Memory consumption Comparison

  • rhs_density is the same as lhs_density
Density(%) Peak Memory Consumption (Sparse) Peak Memory Consumption (Dense) Ratio of Memory Consumption
0.01 52 3380 65
0.02 52 3380 65
0.04 54 3380 62.59259259
0.08 57 3380 59.29824561
0.16 65 3380 52
0.32 87 3380 38.85057471
0.64 132 3380 25.60606061
1.28 221 3380 15.29411765
2.56 400 3380 8.45
5.12 758 3380 4.459102902
10.24 1480 3380 2.283783784
Clone this wiki locally