diff --git a/benchmarks_original/matmul_example.py b/benchmarks_original/matmul_example.py index fc0e0d90..0066b464 100644 --- a/benchmarks_original/matmul_example.py +++ b/benchmarks_original/matmul_example.py @@ -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 diff --git a/benchmarks_original/mttkrp_example.py b/benchmarks_original/mttkrp_example.py index ed910bf3..a9eb4c5f 100644 --- a/benchmarks_original/mttkrp_example.py +++ b/benchmarks_original/mttkrp_example.py @@ -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)) diff --git a/benchmarks_original/sddmm_example.py b/benchmarks_original/sddmm_example.py index 62bd7502..3984817a 100644 --- a/benchmarks_original/sddmm_example.py +++ b/benchmarks_original/sddmm_example.py @@ -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, :, :]), diff --git a/benchmarks_original/spmv_add_example.py b/benchmarks_original/spmv_add_example.py index 9e453306..0662019c 100644 --- a/benchmarks_original/spmv_add_example.py +++ b/benchmarks_original/spmv_add_example.py @@ -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 diff --git a/ci/environment.yml b/ci/environment.yml index e86b34b7..5754cd20 100644 --- a/ci/environment.yml +++ b/ci/environment.yml @@ -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 diff --git a/examples/matmul_example.py b/examples/matmul_example.py index fc0e0d90..0066b464 100644 --- a/examples/matmul_example.py +++ b/examples/matmul_example.py @@ -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 diff --git a/examples/mttkrp_example.py b/examples/mttkrp_example.py index ed910bf3..a9eb4c5f 100644 --- a/examples/mttkrp_example.py +++ b/examples/mttkrp_example.py @@ -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)) diff --git a/examples/sddmm_example.py b/examples/sddmm_example.py index 62bd7502..3984817a 100644 --- a/examples/sddmm_example.py +++ b/examples/sddmm_example.py @@ -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, :, :]), diff --git a/examples/sparse_finch.ipynb b/examples/sparse_finch.ipynb index d1790288..0f70a513 100644 --- a/examples/sparse_finch.ipynb +++ b/examples/sparse_finch.ipynb @@ -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()" diff --git a/examples/spmv_add_example.py b/examples/spmv_add_example.py index 9e453306..0662019c 100644 --- a/examples/spmv_add_example.py +++ b/examples/spmv_add_example.py @@ -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 diff --git a/examples/triangles_example.py b/examples/triangles_example.py index 97ee3f24..5fbbc7a0 100644 --- a/examples/triangles_example.py +++ b/examples/triangles_example.py @@ -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 diff --git a/pixi.toml b/pixi.toml index 2420a4ac..5f209a55 100644 --- a/pixi.toml +++ b/pixi.toml @@ -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" diff --git a/pyproject.toml b/pyproject.toml index 1716ae13..db53169e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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/" diff --git a/sparse/tests/test_backends.py b/sparse/tests/test_backends.py index c448362b..a87a834d 100644 --- a/sparse/tests/test_backends.py +++ b/sparse/tests/test_backends.py @@ -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)