Skip to content

Conversation

@ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Oct 18, 2025

We had support for boxing/unboxing Sparse objects in numba, but we couldn't do anything with them.

This PR implements the basic functionality:

  1. CSMProperties (Op that retrieves the attributes from a CSM Matrix)
  2. CSM (Op that rebuilds a Sparse variable from the attributes)
  3. astype()
  4. csr_matrix, csc_matrix sicpy constructor overloads
  5. MULSD (as a POC)

TODO


📚 Documentation preview 📚: https://pytensor--1676.org.readthedocs.build/en/1676/

@codecov
Copy link

codecov bot commented Nov 18, 2025

Codecov Report

❌ Patch coverage is 83.20000% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.67%. Comparing base (8617558) to head (1de9697).
⚠️ Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
pytensor/link/numba/dispatch/sparse/basic.py 82.38% 24 Missing and 7 partials ⚠️
pytensor/link/numba/dispatch/sparse/math.py 90.76% 3 Missing and 3 partials ⚠️
pytensor/link/numba/dispatch/basic.py 0.00% 3 Missing ⚠️
pytensor/tensor/type.py 33.33% 1 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (83.20%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1676      +/-   ##
==========================================
- Coverage   81.70%   81.67%   -0.04%     
==========================================
  Files         246      251       +5     
  Lines       53632    52549    -1083     
  Branches     9438     9271     -167     
==========================================
- Hits        43822    42919     -903     
+ Misses       7329     7258      -71     
+ Partials     2481     2372     -109     
Files with missing lines Coverage Δ
pytensor/link/numba/dispatch/compile_ops.py 92.64% <ø> (ø)
pytensor/link/numba/dispatch/sparse/__init__.py 100.00% <100.00%> (ø)
pytensor/sparse/variable.py 76.79% <100.00%> (ø)
pytensor/tensor/type.py 94.20% <33.33%> (-0.41%) ⬇️
pytensor/link/numba/dispatch/basic.py 81.77% <0.00%> (-3.25%) ⬇️
pytensor/link/numba/dispatch/sparse/math.py 90.76% <90.76%> (ø)
pytensor/link/numba/dispatch/sparse/basic.py 82.38% <82.38%> (ø)

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ricardoV94 ricardoV94 force-pushed the numba_sparse_ops branch 2 times, most recently from 14a11e2 to 285d7ca Compare November 19, 2025 12:12
@ricardoV94 ricardoV94 force-pushed the numba_sparse_ops branch 3 times, most recently from b0057c4 to 7c2edbc Compare January 15, 2026 17:40
@ricardoV94 ricardoV94 marked this pull request as ready for review January 15, 2026 17:40
@ricardoV94 ricardoV94 changed the title Implement Sparse Ops in Numba Basic Sparse functionality in Numba Jan 15, 2026
@ricardoV94 ricardoV94 force-pushed the numba_sparse_ops branch 4 times, most recently from e9c1320 to dc3e431 Compare January 16, 2026 16:18
ricardoV94 and others added 4 commits January 16, 2026 17:53
Co-authored-by: Adrian Seyboldt <aseyboldt@users.noreply.github.com>
Co-authored-by: Jesse Grabowski <48652735+jessegrabowski@users.noreply.github.com>
Co-authored-by: Jesse Grabowski <48652735+jessegrabowski@users.noreply.github.com>
Co-authored-by: Jesse Grabowski <48652735+jessegrabowski@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant