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

Allow debug evaling IR logp graphs #7666

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

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Jan 30, 2025

A user on discourse recently raised the question of why we can't eval logp graphs during their construction. We have some tagging Ops that raise on the perform method, that prevent this.

https://discourse.pymc.io/t/how-to-implement-bivariate-poisson-logbp/16400/7?u=ricardov94

This PR allows evaluating them, but issues a warning.


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

@ricardoV94 ricardoV94 force-pushed the allow_debugging_logp_graphs branch from 2fed5fd to 0fba15c Compare January 30, 2025 08:27
@@ -236,13 +236,16 @@ class ValuedRV(Op):
and breaking the dependency of `b` on `a`. The new nodes isolate the graphs between conditioning points.
"""

view_map = {0: [0]}
Copy link
Member Author

Choose a reason for hiding this comment

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

Needs view_map so PyTensor knows not to do inplace operations on this. The other Op already had the view_map defined

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.70%. Comparing base (268e13b) to head (0fba15c).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #7666   +/-   ##
=======================================
  Coverage   92.70%   92.70%           
=======================================
  Files         107      107           
  Lines       18391    18397    +6     
=======================================
+ Hits        17049    17055    +6     
  Misses       1342     1342           
Files with missing lines Coverage Δ
pymc/logprob/abstract.py 94.52% <100.00%> (+0.23%) ⬆️
pymc/logprob/transform_value.py 98.19% <100.00%> (+0.05%) ⬆️

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.

1 participant