Skip to content

Numba scan: fix invalid cross alias and inplace#2263

Draft
ricardoV94 wants to merge 1 commit into
pymc-devs:mainfrom
ricardoV94:scan_sitsot_alias_bug
Draft

Numba scan: fix invalid cross alias and inplace#2263
ricardoV94 wants to merge 1 commit into
pymc-devs:mainfrom
ricardoV94:scan_sitsot_alias_bug

Conversation

@ricardoV94

@ricardoV94 ricardoV94 commented Jun 27, 2026

Copy link
Copy Markdown
Member

Who knew memory optimization correctness is so hard?

This PR fixes #2252. I went on a rabbit hole of reassessing the whole memory optimization strategy in the numba dispatcher. I tried to have everything documented without going too close into an essay.

Comment thread pytensor/graph/features.py
Comment thread pytensor/link/numba/dispatch/scan.py Outdated
Comment thread tests/link/numba/test_scan.py Outdated
Comment thread tests/link/numba/test_scan.py Outdated
Comment thread tests/link/numba/test_scan.py Outdated
@ricardoV94 ricardoV94 force-pushed the scan_sitsot_alias_bug branch 2 times, most recently from e8add5b to 22842bd Compare June 27, 2026 14:03
Comment thread pytensor/link/numba/dispatch/scan.py
Comment thread pytensor/link/numba/dispatch/scan.py
Comment thread tests/link/numba/test_scan.py
@ricardoV94 ricardoV94 added bug Something isn't working scan labels Jun 27, 2026
@ricardoV94 ricardoV94 force-pushed the scan_sitsot_alias_bug branch from 22842bd to dac65b3 Compare June 27, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working scan

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scan-merge optimizer incorrectly aliases sit_sot outputs when a carry has a trivially-echo update

2 participants