-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pagerank
example
#673
base: main
Are you sure you want to change the base?
Add pagerank
example
#673
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might need Q[None, :]
to match the results, but otherwise this is equivalent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Hi @hameerabbasi,
Here I share initial pagerank implementation (following scipy_pagerank).
A few comments:
spdiag
is still missing infinch-tensor
, therefore I use SciPy diag to create it.