Skip to content

Commit

Permalink
[mpact][sparse] run pre-sparsification-rewrite before elementwise fus… (
Browse files Browse the repository at this point in the history
#57)

* [mpact][sparse] run pre-sparsification-rewrite before elementwise fusion.

* address comments.
  • Loading branch information
Peiming Liu authored Jun 28, 2024
1 parent e56115a commit e7bd7ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions python/mpact/mpactbackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ def invoke(*args):
+ ",".join(
[
"func.func(linalg-generalize-named-ops)",
# Run pre-sparsification pass to fuse convert/cast op into
# producer as they might hinder kernel fusions.
"pre-sparsification-rewrite",
"func.func(linalg-fuse-elementwise-ops)",
"convert-shape-to-std",
# Propagate sparse encodings before sparsifier mini-pipeline.
Expand Down
6 changes: 4 additions & 2 deletions test/python/sqsum.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@

# Run it with MPACT.
print("mpact")
# TODO: make this work, expose `sparse-emit-strategy=sparse-iterator` to
# mini-pipeline.
# Try sparsification with sparse iterator
# TODO: will work after explicit value is specified in the encoding.
# res = mpact_jit(net, adj_mat, use_sp_it=True)
# print(res)
# Try sparsification directly with scf.for/while
res = mpact_jit(net, adj_mat)
print(res)

0 comments on commit e7bd7ec

Please sign in to comment.