Skip to content

Commit 38d1a67

Browse files
authored
Upgrade finch-tensor (#694)
* Upgrade finch-tensor * Change to_device to to_storage * Change to_device to to_storage
1 parent 3e1616b commit 38d1a67

File tree

4 files changed

+9
-41
lines changed

4 files changed

+9
-41
lines changed

benchmarks/benchmark_backends.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ def setup(self):
2424
if sparse.BackendType.Finch == BACKEND:
2525
import finch
2626

27-
self.s1 = self.s1.to_device(
27+
self.s1 = self.s1.to_storage(
2828
finch.Storage(finch.Dense(finch.SparseList(finch.Element(0.0))), order=self.s1.get_order())
2929
)
30-
self.s2 = self.s2.to_device(
30+
self.s2 = self.s2.to_storage(
3131
finch.Storage(
3232
finch.Dense(finch.SparseList(finch.SparseList(finch.Element(0.0)))),
3333
order=self.s2.get_order(),
@@ -60,7 +60,7 @@ def setup(self, lazy_mode, size_and_density):
6060
if sparse.BackendType.Finch == BACKEND:
6161
import finch
6262

63-
self.M = self.M.to_device(
63+
self.M = self.M.to_storage(
6464
finch.Storage(finch.Dense(finch.SparseList(finch.Element(0.0))), order=self.M.get_order())
6565
)
6666
self.v1 = finch.Tensor(self.v1)
@@ -108,10 +108,10 @@ def setup(self):
108108
if sparse.BackendType.Finch == BACKEND:
109109
import finch
110110

111-
self.s1 = self.s1.to_device(
111+
self.s1 = self.s1.to_storage(
112112
finch.Storage(finch.Dense(finch.SparseList(finch.Element(0.0))), order=self.s1.get_order())
113113
)
114-
self.s2 = self.s2.to_device(
114+
self.s2 = self.s2.to_storage(
115115
finch.Storage(
116116
finch.Dense(finch.SparseList(finch.SparseList(finch.Element(0.0)))), order=self.s2.get_order()
117117
)

ci/Finch-array-api-xfails.txt

+1-33
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ array_api_tests/test_signatures.py::test_func_signature[linspace]
1818
array_api_tests/test_signatures.py::test_func_signature[meshgrid]
1919
array_api_tests/test_signatures.py::test_func_signature[tril]
2020
array_api_tests/test_signatures.py::test_func_signature[triu]
21-
# missing 'copy' keyword
22-
array_api_tests/test_signatures.py::test_func_signature[asarray]
2321
# inspection functions
2422
array_api_tests/test_signatures.py::test_func_signature[isdtype]
2523
array_api_tests/test_signatures.py::test_func_signature[result_type]
@@ -70,8 +68,6 @@ array_api_tests/test_signatures.py::test_extension_func_signature[linalg.vector_
7068
array_api_tests/test_signatures.py::test_array_method_signature[__dlpack__]
7169
array_api_tests/test_signatures.py::test_array_method_signature[__dlpack_device__]
7270
array_api_tests/test_signatures.py::test_array_method_signature[__setitem__]
73-
# missing 'stream' from signature
74-
array_api_tests/test_signatures.py::test_array_method_signature[to_device]
7571

7672
# test_creation_functions
7773

@@ -91,37 +87,10 @@ array_api_tests/test_array_object.py::test_setitem_masking
9187

9288
# test_operators_and_elementwise_functions
9389

94-
# inplace operators not supported
95-
array_api_tests/test_operators_and_elementwise_functions.py::test_add[__iadd__(x1, x2)]
96-
array_api_tests/test_operators_and_elementwise_functions.py::test_add[__iadd__(x, s)]
97-
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_and[__iand__(x1, x2)]
98-
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_and[__iand__(x, s)]
99-
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_left_shift[__ilshift__(x1, x2)]
100-
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_left_shift[__ilshift__(x, s)]
101-
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_or[__ior__(x1, x2)]
102-
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_or[__ior__(x, s)]
103-
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_right_shift[__irshift__(x1, x2)]
104-
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_right_shift[__irshift__(x, s)]
105-
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_xor[__ixor__(x1, x2)]
106-
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_xor[__ixor__(x, s)]
107-
array_api_tests/test_operators_and_elementwise_functions.py::test_divide[__itruediv__(x1, x2)]
108-
array_api_tests/test_operators_and_elementwise_functions.py::test_divide[__itruediv__(x, s)]
109-
array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[__ifloordiv__(x1, x2)]
110-
array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[__ifloordiv__(x, s)]
111-
array_api_tests/test_operators_and_elementwise_functions.py::test_multiply[__imul__(x1, x2)]
112-
array_api_tests/test_operators_and_elementwise_functions.py::test_multiply[__imul__(x, s)]
113-
array_api_tests/test_operators_and_elementwise_functions.py::test_pow[__ipow__(x1, x2)]
114-
array_api_tests/test_operators_and_elementwise_functions.py::test_pow[__ipow__(x, s)]
115-
array_api_tests/test_operators_and_elementwise_functions.py::test_subtract[__isub__(x1, x2)]
116-
array_api_tests/test_operators_and_elementwise_functions.py::test_subtract[__isub__(x, s)]
117-
# type promotion differences
118-
array_api_tests/test_operators_and_elementwise_functions.py::test_add[__add__(x, s)]
119-
array_api_tests/test_operators_and_elementwise_functions.py::test_divide[__truediv__(x, s)]
120-
array_api_tests/test_operators_and_elementwise_functions.py::test_multiply[__mul__(x, s)]
121-
array_api_tests/test_operators_and_elementwise_functions.py::test_subtract[__sub__(x, s)]
12290
# ArgumentError: invalid rational: zero(...)//zero(...)
12391
array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[floor_divide(x1, x2)]
12492
array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[__floordiv__(x1, x2)]
93+
array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[__ifloordiv__(x1, x2)]
12594
# throws for x < 1 instead of NaN
12695
array_api_tests/test_operators_and_elementwise_functions.py::test_acosh
12796
# not implemented
@@ -211,7 +180,6 @@ array_api_tests/test_has_names.py::test_has_names[array_method-__dlpack__]
211180
array_api_tests/test_has_names.py::test_has_names[array_method-__dlpack_device__]
212181
array_api_tests/test_has_names.py::test_has_names[array_method-__setitem__]
213182
array_api_tests/test_has_names.py::test_has_names[array_attribute-T]
214-
array_api_tests/test_has_names.py::test_has_names[array_attribute-device]
215183
array_api_tests/test_has_names.py::test_has_names[array_attribute-mT]
216184

217185
# test_indexing_functions

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ tests = [
3838
]
3939
tox = ["sparse[tests]", "tox"]
4040
all = ["sparse[docs,tox]", "matrepr"]
41-
finch = ["finch-tensor>=0.1.25"]
41+
finch = ["finch-tensor>=0.1.26"]
4242

4343
[project.urls]
4444
Documentation = "https://sparse.pydata.org/"

sparse/tests/test_backends.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def test_backend_contex_manager(backend):
2121
def storage():
2222
return finch.Storage(finch.Dense(finch.SparseList(finch.SparseList(finch.Element(0.0)))), order="C")
2323

24-
x = x.to_device(storage())
25-
y = y.to_device(storage())
24+
x = x.to_storage(storage())
25+
y = y.to_storage(storage())
2626
else:
2727
x.asformat("gcxs")
2828
y.asformat("gcxs")

0 commit comments

Comments
 (0)