-
Notifications
You must be signed in to change notification settings - Fork 135
Speedup truncated_graph_inputs
#394
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
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #394 +/- ##
==========================================
- Coverage 80.47% 80.47% -0.01%
==========================================
Files 156 156
Lines 45516 45520 +4
Branches 11149 11150 +1
==========================================
+ Hits 36629 36631 +2
- Misses 6685 6686 +1
- Partials 2202 2203 +1
|
ec878f7
to
81638c3
Compare
Do you have a reproducible example for the original bug? Does this PR fix the bug/hide it/ do nothing about it? |
I'd also feel better if we had a proper reproducing example.
|
So... question is. Do we want these changes even if they don't fix any bug / the original bug? Was there actually a bug, or perhaps an invalid cyclic graph or something? |
There is indeed a bug somewhere, yet the hotfix still optimizes the function by dropping repeated search paths. |
The proper thing to do is to locate the infinite loop issue and fix it, if it is possible to do before this function is called, I'll try it on the model. |
@ricardoV94 would you be open to sitting down with @ferrine and @Armavica to look through this problem live? I think it may be helpful to just "see" the thing. 👀 |
I am suspecting exponential growth for deep graphs with many branches and not an actual infinite loop. In the example that Max shared with me, it took 15 minutes to derive the graph inputs for one of the variables alone:
~ 1hour total |
truncated_graph_inputs
Motivation for these changes
Compilation in some cases goes off for some reason and enters infinite loops. This fix resolves the issue, while the infinite loop in this check indicates that the real cause is some other bug.
As proposed by @aseyboldt I implemented the same logic with small refactoring
This is similar to the closed PR, which aims to optimize the check. Caching seems to be more involved to implement, I think we can go with this fix.
https://github.com/pymc-devs/pytensor/pull/30/files
Implementation details
Continue on duplicate checks for dependency
Checklist
Bugfixes
truncated_graph_inputs