Skip to content

Commit

Permalink
Upgrade finch-tensor to 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsokol committed Dec 6, 2024
1 parent 128a567 commit aa3b2c8
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion benchmarks_original/matmul_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion benchmarks_original/mttkrp_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
2 changes: 1 addition & 1 deletion benchmarks_original/sddmm_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, :, :]),
Expand Down
2 changes: 1 addition & 1 deletion benchmarks_original/spmv_add_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ dependencies:
- pytest-cov
- pytest-xdist
- pip:
- finch-tensor>=0.1.31
- finch-tensor>=0.2.0
- 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
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion examples/mttkrp_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
2 changes: 1 addition & 1 deletion examples/sddmm_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, :, :]),
Expand Down
4 changes: 2 additions & 2 deletions examples/sparse_finch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
" D = sparse.asarray(np.array(D_sps, order=\"F\"))\n",
" C = sparse.asarray(np.array(C_sps, order=\"F\"))\n",
"\n",
" @sparse.compiled\n",
" @sparse.compiled()\n",
" def mttkrp_finch(B, D, C):\n",
" return sparse.sum(B[:, :, :, None] * D[None, None, :, :] * C[None, :, None, :], axis=(1, 2))\n",
"\n",
Expand Down Expand Up @@ -270,7 +270,7 @@
" a = sparse.asarray(np.array(a_sps, order=\"F\"))\n",
" b = sparse.asarray(np.array(b_sps, order=\"C\"))\n",
"\n",
" @sparse.compiled\n",
" @sparse.compiled()\n",
" def sddmm_finch(s, a, b):\n",
" return sparse.sum(\n",
" s[:, :, None] * (a[:, None, :] * sparse.permute_dims(b, (1, 0))[None, :, :]),\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/spmv_add_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion examples/triangles_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.0"

[feature.finch.activation.env]
SPARSE_BACKEND = "Finch"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.0"]

[project.urls]
Documentation = "https://sparse.pydata.org/"
Expand Down
2 changes: 1 addition & 1 deletion sparse/tests/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit aa3b2c8

Please sign in to comment.