Array API 2025.12 support - #943
Conversation
|
@prady0t |
dc2962f to
a8c0ba9
Compare
Merging this PR will improve performance by 11.63%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | test_index_fancy[side=100-rank=1-format='coo'] |
1.1 ms | 1.4 ms | -19.8% |
| ⚡ | test_index_slice[side=100-rank=2-format='gcxs'] |
3.5 ms | 2.2 ms | +55.37% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing hameerabbasi:array-api-2025.12 (1bd2d5a) with main (c4ed43f)
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
|
I think the hypothesis issue has now been resolved. After a lot of effort, I found out that the Also see this example: import numpy as np
from sparse.numba_backend import COO, asarray
x = COO.from_numpy(np.array(6.0))
y = asarray(x, copy=True)
a = asarray(x, copy=False)
z = np.asarray(x.todense(), copy=True)
print(id(x), id(y), id(z), id(a))
print(x is a)
print(x is y)
print(x is z)The output is: Which means After this commit, the output is: Which is the correct behaviour. |
|
Well done tracking that down! Can we add a test to ensure that |
Sure. In this PR itself? |
That'd be nice. |
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
|
|
for more information, see https://pre-commit.ci
|
Still need to remove some |
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
179bd0d to
97eb95a
Compare
a528ec8 to
5a32826
Compare
I wonder why we didn't catch this earlier (and more easily) via the array-api-tests suite? Is there something we should add over there? |
You probably do; but by default the arrays are also immutable (don't implement setitem) in PyData/Sparse; which is why the test probably got skipped. |
What type of PR is this? (check all applicable)
Related issues
broadcast_shapes#940Checklist