Conversation
Test Results5 923 tests ±0 5 891 ✅ ±0 9m 24s ⏱️ -7s Results for commit b2e63af. ± Comparison against base commit c12b29e. This pull request skips 2 and un-skips 2 tests.♻️ This comment has been updated with latest results. |
| Q = sparse.asarray(sp.csc_array(sp.spdiags(S.todense(), 0, *A.shape))) | ||
| A = Q @ A |
There was a problem hiding this comment.
IIUC This is equivalent to https://data-apis.org/array-api/latest/extensions/generated/array_api.linalg.diagonal.html#diagonal, which is supported by the Numba backend. Let's use that instead.
| Q = sparse.asarray(sp.csc_array(sp.spdiags(S.todense(), 0, *A.shape))) | |
| A = Q @ A | |
| Q = sparse.diagonal(S) | |
| A *= Q |
There was a problem hiding this comment.
For Finch, we can add support for it later, as the example only needs to work on Numba for now.
There was a problem hiding this comment.
You might need Q[None, :] to match the results, but otherwise this is equivalent.
There was a problem hiding this comment.
But the pagerank example is run either with Finch or Numba backend. when we run with Finch backend (and I think it should be runnable with Finch) then we can't execute one line with Numba.
There was a problem hiding this comment.
I would prefer to keep these examples Finch and Numba ready, and update implementation once both backends support something new.
There was a problem hiding this comment.
I would prefer to keep these examples Finch and Numba ready, and update implementation once both backends support something new.
According to the deliverable, we just need a script that will demonstrate a speedup against the "old" code. If you would prefer, we can always keep this PR open until xp.diagonal is supported by Finch, but I wouldn't densify.
63cb30a to
1a22a38
Compare
|
@mtsokol Is this still relevant? |
Let's leave it open for now. For power iteration we have HITS example, but once we have |
Hi @hameerabbasi,
Here I share initial pagerank implementation (following scipy_pagerank).
A few comments:
spdiagis still missing infinch-tensor, therefore I use SciPy diag to create it.