pymc-devs / pymc-devs/pytensor
Reconsider `local_sum_prod_all_to_none`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 644
- Forks
- 208
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 16
Description
First, why is this restricted to Sum/Prod instead of all CAReduce?
Second not sure about using None as canonical. If we don't allow None at the Op level we never risk duplication, since there's only one way to create such an Op (i.e., list all axes). If code can be made more efficient later on, it should also be done for all axis, and therefore the distinction is never needed. str representation can still choose to omit axis if all are reduced for readability
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 in pytensor/tensor/rewriting/math.py around lines 1813-1827 and inspect local_sum_prod_all_to_none alongside CAReduce. Compare the Sum/Prod restriction with the broader CAReduce behavior, and evaluate whether None should remain canonical or only be used for display. The work is done when the canonical axis policy and its scope are decided and reflected consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100