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

Improve static output shape and numba implementations of some Ops #375

Merged
merged 6 commits into from
Sep 5, 2023

Conversation

aseyboldt
Copy link
Member

A collection of small fixes I have accumulated...

I thought it would be easier to just submit this as one PR instead of 5 small ones. The individual commits contain one fix each.

@ricardoV94
Copy link
Member

ricardoV94 commented Jul 11, 2023

Looks neat. Question is d5574c1 (fix: Fix shape of subtensors ) fixing a bug or just providing better static shape?

@ricardoV94 ricardoV94 added the bug Something isn't working label Jul 11, 2023
@aseyboldt
Copy link
Member Author

Usually I just got a None shape, but in the code it seemed to just return shape==1 sometimes: d5574c1#diff-f5839e5efccae3b80e368b3d43abd60c65d64a012eb92a231c682805d4ab1e62L747

Not sure what that was about...

@ricardoV94
Copy link
Member

ricardoV94 commented Jul 11, 2023

Not sure what that was about...

We needed to know whether the output is broadcastable for the grad. Every thing besides that is just a nice to have that was not implemented I guess.

The reason I ask is that it makes it easier for me to review :)

@ricardoV94 ricardoV94 added the enhancement New feature or request label Jul 11, 2023
@aseyboldt aseyboldt force-pushed the avoid-useless-cast branch 3 times, most recently from 1a14965 to d25e2a1 Compare July 11, 2023 20:31
ricardoV94
ricardoV94 previously approved these changes Jul 11, 2023
Copy link
Member

@ricardoV94 ricardoV94 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
Copy link
Member

Tests looked like they were passing before refreshing :)

@codecov-commenter
Copy link

Codecov Report

Merging #375 (7045b91) into main (5c87d74) will decrease coverage by 0.01%.
The diff coverage is 78.98%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #375      +/-   ##
==========================================
- Coverage   80.40%   80.40%   -0.01%     
==========================================
  Files         156      156              
  Lines       45401    45500      +99     
  Branches    11106    11141      +35     
==========================================
+ Hits        36505    36582      +77     
- Misses       6689     6702      +13     
- Partials     2207     2216       +9     
Impacted Files Coverage Δ
pytensor/link/numba/dispatch/extra_ops.py 89.53% <18.18%> (-2.71%) ⬇️
pytensor/link/numba/dispatch/basic.py 85.80% <36.84%> (-2.10%) ⬇️
pytensor/link/jax/dispatch/shape.py 91.93% <60.00%> (-2.90%) ⬇️
pytensor/scalar/basic.py 80.16% <66.66%> (-0.04%) ⬇️
pytensor/tensor/rewriting/shape.py 81.20% <83.33%> (+0.10%) ⬆️
pytensor/link/jax/dispatch/scalar.py 98.41% <100.00%> (+0.01%) ⬆️
pytensor/scan/rewriting.py 79.94% <100.00%> (ø)
pytensor/tensor/basic.py 90.77% <100.00%> (ø)
pytensor/tensor/rewriting/elemwise.py 88.99% <100.00%> (+0.49%) ⬆️
pytensor/tensor/rewriting/math.py 86.36% <100.00%> (+0.31%) ⬆️
... and 3 more

... and 1 file with indirect coverage changes

pytensor/link/numba/dispatch/basic.py Show resolved Hide resolved
pytensor/tensor/shape.py Outdated Show resolved Hide resolved
pytensor/tensor/subtensor.py Show resolved Hide resolved
@ricardoV94 ricardoV94 dismissed their stale review July 12, 2023 14:07

concern mentioned above

@fonnesbeck
Copy link
Member

Can this be merged? There's a fix in here for a nutpie bug I keep running into.

@ricardoV94
Copy link
Member

Can this be merged? There's a fix in here for a nutpie bug I keep running into.

There's a change that has to be reverted, I'll try to get on it Monday, thanks for pinging

@ricardoV94 ricardoV94 merged commit 49acbc5 into pymc-devs:main Sep 5, 2023
52 checks passed
@ricardoV94 ricardoV94 changed the title Various small fixes Improve static output shape and numba implementations of some Ops Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request numba performance shape inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants