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

Use more conservative fastmath flags in numba backend #1147

Merged
merged 2 commits into from
Jan 5, 2025

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Jan 2, 2025

Closes #1145


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

Copy link

codecov bot commented Jan 2, 2025

Codecov Report

Attention: Patch coverage is 83.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 82.15%. Comparing base (8cc489b) to head (769d134).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pytensor/link/numba/dispatch/basic.py 57.14% 1 Missing and 2 partials ⚠️
pytensor/link/numba/dispatch/elemwise.py 80.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1147      +/-   ##
==========================================
+ Coverage   82.14%   82.15%   +0.01%     
==========================================
  Files         186      186              
  Lines       48207    48193      -14     
  Branches     8677     8677              
==========================================
- Hits        39598    39593       -5     
+ Misses       6441     6430      -11     
- Partials     2168     2170       +2     
Files with missing lines Coverage Δ
pytensor/link/numba/dispatch/blockwise.py 90.00% <ø> (ø)
pytensor/link/numba/dispatch/extra_ops.py 95.49% <100.00%> (-0.03%) ⬇️
pytensor/link/numba/dispatch/scalar.py 94.40% <100.00%> (-0.04%) ⬇️
pytensor/link/numba/dispatch/elemwise.py 94.79% <80.00%> (+2.80%) ⬆️
pytensor/link/numba/dispatch/basic.py 81.62% <57.14%> (-0.61%) ⬇️

... and 1 file with indirect coverage changes

@aseyboldt
Copy link
Member

Maybe we should only use these (or some other subset) by default?


All fastmath flags is really aggressive, and leads to some undefined behavior like in the nan case...

@ricardoV94 ricardoV94 changed the title Override NUMBA fastmath flag in IsNan dispatch Use more conservative fastmath flags in numba backend Jan 3, 2025
@ricardoV94
Copy link
Member Author

@aseyboldt I moved the fastmath subflag definition to the numba_njit wrapper

Copy link
Member

@aseyboldt aseyboldt left a comment

Choose a reason for hiding this comment

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

Looks good :-)

@ricardoV94 ricardoV94 merged commit 1fc678c into pymc-devs:main Jan 5, 2025
60 of 62 checks passed
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.

pt.isnan does not work in NUMBA mode
2 participants