Skip to content
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

Speedup scalar Op python implementations #1169

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Jan 23, 2025

Some cleanup of unused code in scalar/math.py.

Also speedup a bit the perform method by avoiding allocating intermediate variables and attribute acces for a helper function


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

@ricardoV94 ricardoV94 force-pushed the scalar_op_cleanup branch 2 times, most recently from f8abadb to 866f488 Compare January 24, 2025 08:21
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 47.61905% with 22 lines in your changes missing coverage. Please review.

Project coverage is 82.27%. Comparing base (a0fe30d) to head (866f488).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
pytensor/scalar/math.py 36.36% 21 Missing ⚠️
pytensor/scalar/basic.py 88.88% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (47.61%) 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    #1169      +/-   ##
==========================================
+ Coverage   82.11%   82.27%   +0.16%     
==========================================
  Files         186      186              
  Lines       48201    47927     -274     
  Branches     8679     8623      -56     
==========================================
- Hits        39579    39434     -145     
+ Misses       6447     6334     -113     
+ Partials     2175     2159      -16     
Files with missing lines Coverage Δ
pytensor/scalar/basic.py 80.63% <88.88%> (+0.08%) ⬆️
pytensor/scalar/math.py 87.74% <36.36%> (+0.63%) ⬆️

... and 13 files with indirect coverage changes

@ricardoV94 ricardoV94 requested a review from Armavica January 24, 2025 08:56
@ricardoV94 ricardoV94 marked this pull request as ready for review January 24, 2025 08:56
pytensor/scalar/math.py Outdated Show resolved Hide resolved
@Armavica
Copy link
Member

Looks good, but there are two more st_impl in pytensor/tensor/xlogx.py: worth removing them too in this PR?

@ricardoV94
Copy link
Member Author

definitely, missed those

@ricardoV94 ricardoV94 marked this pull request as draft January 24, 2025 16:36
@ricardoV94 ricardoV94 requested a review from Armavica January 30, 2025 09:04
@ricardoV94 ricardoV94 marked this pull request as ready for review January 30, 2025 09:04
@ricardoV94 ricardoV94 changed the title Scalar op cleanup Speedup scalar Op python implementations Jan 30, 2025
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