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

Ignore inner unused RNG inputs in collect_default_updates #7658

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Jan 25, 2025

It closes the PyMC-side of #7657.

The example there will still not work due to the OpFromGraph L_op actually re-introducing the random variable (but not the next rng update). That's a PyTensor question, that may be addressed by pymc-devs/pytensor#1174

These changes still make sense on their own.

Closes #7657


📚 Documentation preview 📚: https://pymc--7658.org.readthedocs.build/en/7658/

Copy link

codecov bot commented Jan 25, 2025

Codecov Report

Attention: Patch coverage is 95.23810% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.78%. Comparing base (fa43eba) to head (16d5f13).

Files with missing lines Patch % Lines
pymc/pytensorf.py 95.23% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7658      +/-   ##
==========================================
- Coverage   92.78%   92.78%   -0.01%     
==========================================
  Files         107      107              
  Lines       18196    18207      +11     
==========================================
+ Hits        16884    16893       +9     
- Misses       1312     1314       +2     
Files with missing lines Coverage Δ
pymc/pytensorf.py 90.67% <95.23%> (+<0.01%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Member

@jessegrabowski jessegrabowski left a comment

Choose a reason for hiding this comment

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

Small typo, otherwise looks great

return find_default_update(clients, next_rng)
nested_next_rng = find_default_update(clients, next_rng)
if nested_next_rng is None:
# There we no more uses of this next_rng
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# There we no more uses of this next_rng
# There were no more uses of this next_rng

@ricardoV94 ricardoV94 removed the bug label Jan 25, 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.

collect_default_updates should ignore unused rng inputs to OpFromGraph
2 participants