Skip to content

Conversation

mtsokol
Copy link
Collaborator

@mtsokol mtsokol commented Jun 7, 2024

Hi @hameerabbasi,

This PR refactors sparse importing mechanism. It enforces backend selection at the import time and allows from sparse import COO etc. imports.

@mtsokol mtsokol requested a review from hameerabbasi June 7, 2024 13:04
@mtsokol mtsokol self-assigned this Jun 7, 2024
Copy link

github-actions bot commented Jun 7, 2024

Test Results

44 tests   - 6 063   31 ✅  - 5 954   37s ⏱️ - 10m 3s
 1 suites ±    0   13 💤  -   109 
 1 files   ±    0    0 ❌ ±    0 

Results for commit 2dab3d2. ± Comparison against base commit 38d1a67.

This pull request removes 6107 and adds 44 tests. Note that renamed tests count towards both.
sparse.numba_backend.tests.test_array_function ‑ test_binary[dot-arg_order0]
sparse.numba_backend.tests.test_array_function ‑ test_binary[dot-arg_order1]
sparse.numba_backend.tests.test_array_function ‑ test_binary[dot-arg_order2]
sparse.numba_backend.tests.test_array_function ‑ test_binary[matmul-arg_order0]
sparse.numba_backend.tests.test_array_function ‑ test_binary[matmul-arg_order1]
sparse.numba_backend.tests.test_array_function ‑ test_binary[matmul-arg_order2]
sparse.numba_backend.tests.test_array_function ‑ test_binary[result_type-arg_order0]
sparse.numba_backend.tests.test_array_function ‑ test_binary[result_type-arg_order1]
sparse.numba_backend.tests.test_array_function ‑ test_binary[result_type-arg_order2]
sparse.numba_backend.tests.test_array_function ‑ test_binary[tensordot-arg_order0]
…
sparse.tests.test_backends ‑ test_asarray[coo-C]
sparse.tests.test_backends ‑ test_asarray[coo-F]
sparse.tests.test_backends ‑ test_asarray[csc-F]
sparse.tests.test_backends ‑ test_asarray[csr-C]
sparse.tests.test_backends ‑ test_backends
sparse.tests.test_backends ‑ test_finch_lazy_backend
sparse.tests.test_backends ‑ test_scikit_learn_dispatch[csc_matrix-csc-F]
sparse.tests.test_backends ‑ test_scipy_breadth_first_tree[coo_matrix-coo-F]
sparse.tests.test_backends ‑ test_scipy_breadth_first_tree[csc_matrix-csc-F]
sparse.tests.test_backends ‑ test_scipy_breadth_first_tree[csr_matrix-csr-C]
…
This pull request removes 122 skipped tests and adds 13 skipped tests. Note that renamed tests count towards both.
sparse.numba_backend.tests.test_compressed ‑ test_reductions_float16[f4-axis4-sum-kwargs0]
sparse.numba_backend.tests.test_compressed ‑ test_reductions_float16[f8-axis4-sum-kwargs0]
sparse.numba_backend.tests.test_compressed ‑ test_reductions_float16[i4-0-mean-kwargs1]
sparse.numba_backend.tests.test_compressed ‑ test_reductions_float16[i4-0-sum-kwargs0]
sparse.numba_backend.tests.test_compressed ‑ test_reductions_float16[i4-1-mean-kwargs1]
sparse.numba_backend.tests.test_compressed ‑ test_reductions_float16[i4-1-sum-kwargs0]
sparse.numba_backend.tests.test_compressed ‑ test_reductions_float16[i4-axis4-mean-kwargs1]
sparse.numba_backend.tests.test_compressed ‑ test_reductions_float16[i4-axis4-sum-kwargs0]
sparse.numba_backend.tests.test_compressed ‑ test_reductions_float16[i8-0-mean-kwargs1]
sparse.numba_backend.tests.test_compressed ‑ test_reductions_float16[i8-0-sum-kwargs0]
…
sparse.tests.test_backends ‑ test_scikit_learn_dispatch[csc_matrix-csc-F]
sparse.tests.test_backends ‑ test_scipy_eigs[coo-C]
sparse.tests.test_backends ‑ test_scipy_eigs[coo-F]
sparse.tests.test_backends ‑ test_scipy_eigs[csc-F]
sparse.tests.test_backends ‑ test_scipy_eigs[csr-C]
sparse.tests.test_backends ‑ test_scipy_lsqr[coo-C]
sparse.tests.test_backends ‑ test_scipy_lsqr[coo-F]
sparse.tests.test_backends ‑ test_scipy_lsqr[csc-F]
sparse.tests.test_backends ‑ test_scipy_lsqr[csr-C]
sparse.tests.test_backends ‑ test_scipy_norm[coo-C]
…

♻️ This comment has been updated with latest results.

@mtsokol mtsokol force-pushed the import-refactor branch 7 times, most recently from 4aec17f to 491af3a Compare June 10, 2024 10:56
Copy link
Collaborator

@hameerabbasi hameerabbasi left a comment

Choose a reason for hiding this comment

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

Maybe we can run the test suite twice, once for Finch and once for Numba in CI, without doing the importlib.reload(...) magic? And provide a ./test.sh script?

@mtsokol
Copy link
Collaborator Author

mtsokol commented Jun 10, 2024

Maybe we can run the test suite twice, once for Finch and once for Numba in CI, without doing the importlib.reload(...) magic? And provide a ./test.sh script?

Done! I run tests twice in the CI with different backends:

- name: Run tests
  run: |
    SPARSE_BACKEND=Numba pytest --pyargs sparse
    SPARSE_BACKEND=Finch pytest --pyargs sparse/tests

For Numba we run all tests. For Finch only the common ones.

Copy link
Collaborator

@hameerabbasi hameerabbasi left a comment

Choose a reason for hiding this comment

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

This LGTM! Thanks so much for working on this, @mtsokol!

@hameerabbasi hameerabbasi merged commit 20e693a into main Jun 10, 2024
@hameerabbasi hameerabbasi deleted the import-refactor branch June 10, 2024 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants