pymc-devs / pymc-devs/pytensor
Rethink Scan special behavior when n_steps < pre-allocated output buffer
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 644
- Forks
- 208
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 16
Description
Description
We had a subtle bug in the Numba implementation of Scan found out in #811
Scan is supposed to zero-out unwritten buffers when n_steps doesn't cover it all. This adds yet another nugget of complexity to Scan, as if it weren't already a mess.
Things to investigate:
- Do we need to zero out? Can we slice away like while Scans do?
- If not, can this be handled outside the Scan by the code that creates such a Scan?
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/scan/op.py around lines 2179-2203 and review the Numba Scan behavior described in #811. Investigate whether unwritten buffers must be zeroed when n_steps is smaller than the pre-allocated output, or whether they can be sliced like while Scans or handled by the code creating the Scan. Done means the required behavior and its implementation location are resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100