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
Copy link
Member Author

Sparse constants don't currently work. Fails during lowering. I am not familiar on how to support this, but it wasn't working before anyway, so this PR is still a strict enhancement

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