pymc-devs / pymc-devs/pytensor
Add graph transformation to propagate new static shape info
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 644
- Forks
- 208
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 16
Description
Description
A considerable limitation of graph_replace vs clone_replace is that it does not rebuild the graph downstream when static types are different (yet compatible). Also our rewrites may benefit from this, if we have a pass now and then that just refreshes all static types by recalling Op.make_node() when input types haves changed. As it is now, types are only propagated during rewrites, accidentally when new nodes are created.
Back to graph_replace, this could then be combined with such a rewrite, to obtain the missing functionality relative to clone_replace, with still the benefits of not cloning stuff that is not needed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing graph_replace and clone_replace, then inspect how rewrites create nodes through Op.make_node(). Determine how downstream nodes could be rebuilt when compatible static types change and how a pass could refresh static types. Done means graph_replace gains the missing propagation behavior without cloning unaffected parts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100