Skip to content

Commit

Permalink
Upgrade finch-tensor to 0.2.1
Browse files Browse the repository at this point in the history
mtsokol committed Dec 6, 2024
1 parent f530bd9 commit 19a26af
Showing 14 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion benchmarks_original/matmul_example.py
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
a = sparse.asarray(a_sps)
b = sparse.asarray(b_sps)

@sparse.compiled
@sparse.compiled()
def sddmm_finch(a, b):
return a @ b

2 changes: 1 addition & 1 deletion benchmarks_original/mttkrp_example.py
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
D = sparse.asarray(np.array(D_sps, order="F"))
C = sparse.asarray(np.array(C_sps, order="F"))

@sparse.compiled
@sparse.compiled()
def mttkrp_finch(B, D, C):
return sparse.sum(B[:, :, :, None] * D[None, None, :, :] * C[None, :, None, :], axis=(1, 2))

2 changes: 1 addition & 1 deletion benchmarks_original/sddmm_example.py
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
a = sparse.asarray(np.array(a_sps, order="F"))
b = sparse.asarray(np.array(b_sps, order="C"))

@sparse.compiled
@sparse.compiled()
def sddmm_finch(s, a, b):
return sparse.sum(
s[:, :, None] * (a[:, None, :] * sparse.permute_dims(b, (1, 0))[None, :, :]),
2 changes: 1 addition & 1 deletion benchmarks_original/spmv_add_example.py
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
x = sparse.asarray(np.array(x_sps, order="C"))
y = sparse.asarray(np.array(y_sps, order="C"))

@sparse.compiled
@sparse.compiled()
def spmv_finch(A, x, y):
return sparse.sum(A[:, None, :] * sparse.permute_dims(x, (1, 0))[None, :, :], axis=-1) + y

2 changes: 1 addition & 1 deletion ci/environment.yml
Original file line number Diff line number Diff line change
@@ -13,6 +13,6 @@ dependencies:
- pytest-cov
- pytest-xdist
- pip:
- finch-tensor>=0.1.31
- finch-tensor>=0.2.1
- finch-mlir>=0.0.2
- pytest-codspeed
2 changes: 1 addition & 1 deletion examples/matmul_example.py
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
a = sparse.asarray(a_sps)
b = sparse.asarray(b_sps)

@sparse.compiled
@sparse.compiled()
def sddmm_finch(a, b):
return a @ b

2 changes: 1 addition & 1 deletion examples/mttkrp_example.py
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
D = sparse.asarray(np.array(D_sps, order="F"))
C = sparse.asarray(np.array(C_sps, order="F"))

@sparse.compiled
@sparse.compiled()
def mttkrp_finch(B, D, C):
return sparse.sum(B[:, :, :, None] * D[None, None, :, :] * C[None, :, None, :], axis=(1, 2))

2 changes: 1 addition & 1 deletion examples/sddmm_example.py
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
a = sparse.asarray(np.array(a_sps, order="F"))
b = sparse.asarray(np.array(b_sps, order="C"))

@sparse.compiled
@sparse.compiled()
def sddmm_finch(s, a, b):
return sparse.sum(
s[:, :, None] * (a[:, None, :] * sparse.permute_dims(b, (1, 0))[None, :, :]),
4 changes: 0 additions & 4 deletions examples/sparse_finch.ipynb
Original file line number Diff line number Diff line change
@@ -397,8 +397,6 @@
"ax.set_xlabel(\"size N\")\n",
"ax.set_ylabel(\"time (sec)\")\n",
"ax.set_title(\"SDDMM\")\n",
"# ax.set_xscale(\"log\")\n",
"# ax.set_yscale(\"log\")\n",
"ax.legend(loc=\"best\", numpoints=1)\n",
"\n",
"plt.show()"
@@ -517,8 +515,6 @@
"ax.set_xlabel(\"size N\")\n",
"ax.set_ylabel(\"time (sec)\")\n",
"ax.set_title(\"Counting Triangles\")\n",
"# ax.set_xscale(\"log\")\n",
"# ax.set_yscale(\"log\")\n",
"ax.legend(loc=\"best\", numpoints=1)\n",
"\n",
"plt.show()"
2 changes: 1 addition & 1 deletion examples/spmv_add_example.py
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
x = sparse.asarray(np.array(x_sps, order="C"))
y = sparse.asarray(np.array(y_sps, order="C"))

@sparse.compiled
@sparse.compiled()
def spmv_finch(A, x, y):
return sparse.sum(A[:, None, :] * sparse.permute_dims(x, (1, 0))[None, :, :], axis=-1) + y

2 changes: 1 addition & 1 deletion examples/triangles_example.py
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
a_sps = nx.to_scipy_sparse_array(G)
a = sparse.asarray(a_sps)

# @sparse.compiled NOTE: blocked by https://github.com/willow-ahrens/Finch.jl/issues/615
@sparse.compiled()
def count_triangles_finch(a):
return sparse.sum(a @ a * a) / 6

2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ precompile = "python -c 'import finch'"

[feature.finch.pypi-dependencies]
scipy = ">=0.19"
finch-tensor = ">=0.1.31"
finch-tensor = ">=0.2.1"

[feature.finch.activation.env]
SPARSE_BACKEND = "Finch"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ tests = [
tox = ["sparse[tests]", "tox"]
notebooks = ["sparse[tests]", "nbmake", "matplotlib"]
all = ["sparse[docs,tox,notebooks]", "matrepr"]
finch = ["finch-tensor>=0.1.35"]
finch = ["finch-tensor>=0.2.1"]

[project.urls]
Documentation = "https://sparse.pydata.org/"
2 changes: 1 addition & 1 deletion sparse/tests/test_backends.py
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ def test_finch_lazy_backend(backend):

assert_equal(transposed.todense(), np_eye.T)

@sparse.compiled
@sparse.compiled()
def my_fun(tns1, tns2):
tmp = sparse.add(tns1, tns2)
return sparse.sum(tmp, axis=0)

0 comments on commit 19a26af

Please sign in to comment.