Skip to content

Downcast amg_core and simplify CSR#2

Merged
jarrodmillman merged 4 commits intojarrodmillman:sparse_arraysfrom
dschult:sparse_arrays
Oct 17, 2024
Merged

Downcast amg_core and simplify CSR#2
jarrodmillman merged 4 commits intojarrodmillman:sparse_arraysfrom
dschult:sparse_arrays

Conversation

@dschult
Copy link
Copy Markdown

@dschult dschult commented Oct 16, 2024

I added two lines to convert indptr and indices to int32 before calling the pyamg function. That got rid of one random_walker test failing. I got rid of another by adding a warning message to the list of acceptable warnings in a couple of places. Unfortunately, pyamg still uses isspmatrix_csr instead of issparse(A) and A.format in ('csr', 'csc'), so it currently coverts the csr_array we give it to a csr_matrix and raises a warning. I'm sure this is not as performant as it could be.

I also noticed a number of places where we create coo_array and then immediately convert to CSR format. I changed those to construct the csr_array because CSR can handle COO style input data. It actually does the conversion for you, so it's probably not much faster, but makes this code easier to read.

Once pyamg gets settled for sparray support, we should remove those warning message fragments from the tests.

Copy link
Copy Markdown
Owner

@jarrodmillman jarrodmillman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!

@jarrodmillman jarrodmillman changed the title ENH: Update to use Sparse arrays Updates to downcast for amg_core and simplify CSR Oct 17, 2024
@jarrodmillman jarrodmillman merged commit debb62e into jarrodmillman:sparse_arrays Oct 17, 2024
@jarrodmillman jarrodmillman changed the title Updates to downcast for amg_core and simplify CSR Downcast amg_core and simplify CSR Oct 17, 2024
jarrodmillman added a commit that referenced this pull request Oct 17, 2024
* CI: bump macos image pin from 12 to 13 (scikit-image#7582)

* Use scipy.sparse arrays

* updates to downcast for amg_core and simplify CSR

---------

Co-authored-by: Brigitta Sipőcz <bsipocz@gmail.com>
Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com>
@dschult dschult deleted the sparse_arrays branch October 17, 2024 00:48
jarrodmillman added a commit that referenced this pull request Oct 22, 2024
* CI: bump macos image pin from 12 to 13 (scikit-image#7582)

* Use scipy.sparse arrays

* updates to downcast for amg_core and simplify CSR

---------

Co-authored-by: Brigitta Sipőcz <bsipocz@gmail.com>
Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com>
jarrodmillman added a commit that referenced this pull request Oct 23, 2024
* CI: bump macos image pin from 12 to 13 (scikit-image#7582)

* Use scipy.sparse arrays

* updates to downcast for amg_core and simplify CSR

---------

Co-authored-by: Brigitta Sipőcz <bsipocz@gmail.com>
Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com>
jarrodmillman added a commit that referenced this pull request Oct 23, 2024
* CI: bump macos image pin from 12 to 13 (scikit-image#7582)

* Use scipy.sparse arrays

* updates to downcast for amg_core and simplify CSR

---------

Co-authored-by: Brigitta Sipőcz <bsipocz@gmail.com>
Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com>
jarrodmillman added a commit that referenced this pull request Nov 18, 2024
* CI: bump macos image pin from 12 to 13 (scikit-image#7582)

* Use scipy.sparse arrays

* updates to downcast for amg_core and simplify CSR

---------

Co-authored-by: Brigitta Sipőcz <bsipocz@gmail.com>
Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com>
jarrodmillman added a commit that referenced this pull request Nov 19, 2024
* CI: bump macos image pin from 12 to 13 (scikit-image#7582)

* Use scipy.sparse arrays

* updates to downcast for amg_core and simplify CSR

---------

Co-authored-by: Brigitta Sipőcz <bsipocz@gmail.com>
Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants