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

CheckParameterValues not replaced in inner graphs #6697

Open
Tracked by #7053
ricardoV94 opened this issue Apr 28, 2023 · 3 comments
Open
Tracked by #7053

CheckParameterValues not replaced in inner graphs #6697

ricardoV94 opened this issue Apr 28, 2023 · 3 comments

Comments

@ricardoV94
Copy link
Member

We include these rewrites when compiling logp graphs, but this won't replace inner logp graphs (e.g, inside Scan or not-inlined OpFromGraph)

pymc/pymc/pytensorf.py

Lines 1142 to 1144 in 371472d

check_parameter_opt = (
"local_check_parameter_to_ninf_switch" if check_bounds else "local_remove_check_parameter"
)

The example in #6696 suffers from this. Sampling is quite faster when the rewrite is manually added

@aerubanov
Copy link
Contributor

@ricardoV94 Looks like we can check inner graph for nodes that we need to replace, and if any found - create new Scan or OpFromGraph node with changed fgraph and replace old one. In you opinion will this approach work?

@ricardoV94
Copy link
Member Author

Actually for Scan there might be a shortcut, as Scan has it's own mode object. We can simple replace the old scan by a clone whose mode includes the rewrite we want to apply.

Eventually we want to get rid of this inner mode thing, but hopefully by that time we will have made Scan simpler so that's easier to manipulate anyway.

@ricardoV94
Copy link
Member Author

But we can do either way. The priority is more with Scan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants