-
Notifications
You must be signed in to change notification settings - Fork 16
Sparse matrices #631
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
base: main
Are you sure you want to change the base?
Sparse matrices #631
Conversation
|
@inducer I started looking through the loopy codegen code to try to figure out how to generate temporaries for the reduction bounds to avoid islpy errors (as is done in the loopy example), but I'm having some trouble figuring out how best to do that. Seems like I need to create the temporaries inside |
|
Yes, working inside of |
de98230 to
2e1c083
Compare
|
@inducer I think this is ready for a look. I'm not sure how to fix the lingering doc build errors. Here's what the results are looking like. Code: Kernel: |
pytato/target/loopy/codegen.py
Outdated
|
|
||
| redn_bounds = ReductionBoundsCollector()(idx_expr) | ||
|
|
||
| store_redn_bound_temps = any( |
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.
Technically, this could be a per-bound decision.
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 do the actual temporary generation per bound, but I need to know ahead of time if any temporaries will be created so I can define the inames up front.
5159091 to
f7f8699
Compare
|
FWIW, while experimenting with containers in inducer/arraycontext#349, I tried seeing what this PR would look like if sparse matrix objects were treated as arrays. The changes are here. (Basically, matrices are treated as any other array except in codegen-related mappers, which refuse to process matrices that aren't reached through matmul arrays.) |
…e other checks over from constructor
Adds
CSRMatmularray type for multiplication by sparse matrices in compressed sparse row format.cc @lukeolson