Skip to content

Convert unit buffer sit sot to untraced sit sot#2005

Open
ricardoV94 wants to merge 3 commits intopymc-devs:v3from
ricardoV94:untraced_sit_sot
Open

Convert unit buffer sit sot to untraced sit sot#2005
ricardoV94 wants to merge 3 commits intopymc-devs:v3from
ricardoV94:untraced_sit_sot

Conversation

@ricardoV94
Copy link
Copy Markdown
Member

@ricardoV94 ricardoV94 commented Mar 28, 2026

The scan implementations won't bother with reading/writing in the outer loop.

Also tweaked #2003 to always try to inplace untraced_sit_sot in the inner scan function. If not allowed by the Scan destroy_map (meaning the outer input is protected), we do a copy once at the start, and then let it run free.

Also extended rewrite for slice canonicalization to all subtensor-related Ops, which allows simplifying more easily some useless cases like x[:b].set(y), when x is size b (as scan_save_mem can easily do)

Motivated by ongoing work on pymc-devs/pymc#7380

Also make local_useless_inc_subtensor a bit more powerful. It's not
really useless because it may still need to broadcast or reverse arrays
@ricardoV94 ricardoV94 marked this pull request as ready for review March 28, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant