uwsampl / SparseTIR

SparseTIR: Sparse Tensor Compiler for Deep Learning
https://sampl.cs.washington.edu/SparseTIR/
Apache License 2.0
131 stars 14 forks source link

[Tracking Issue] SpMM hybrid decomposing in C++ #31

Closed yzh119 closed 2 years ago

yzh119 commented 2 years ago

Description

Implement the format decomposing algorithm described in Figure 11 of sparsetir paper in C++. To make the preprocessing faster.

Input

  1. bucket sizes
  2. number of column partitions
  3. CSR representation of the sparse matrix (ignore values), only use indptr/indices.

Function signatures be like (std::vector<int> bucket_sizes, int num_col_partitions, std::vector<int> indptr, std::vector<int> indices).

Output

  1. CSR representation of each of the submatrices (in ELL format): indices array for each sub-matrices.

Return type: std::vector<std::vector<int32_t>>.

Order be like:

  1. column partition 1, bucket 1
  2. column partition 1, bucket 2
  3. ...
  4. column partition c, bucket b.

Padding behavior

  1. Just pad 0.
yzh119 commented 2 years ago

Done