Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bad initial values shape assumptions in save_mem_new_scan rewrite #1501

Merged

Conversation

brandonwillard
Copy link
Member

@brandonwillard brandonwillard commented Jun 3, 2023

This PR closes #1499. The underlying issue was that save_mem_new_scan always assumed that the output storage array graphs, which take the form at.set_subtensor(at.empty[:tap_spread], initial_tap_values), would have non-scalar initial_tap_values; however, this isn't always the case.

In general, the logic in save_mem_new_scan is a bit convoluted and unclear about the assumptions it makes. These changes don't completely fix that, but they do provide some refactoring that improves the situation a little.

@brandonwillard brandonwillard self-assigned this Jun 3, 2023
@brandonwillard brandonwillard added bug Something isn't working graph rewriting Scan Involves the `Scan` `Op` labels Jun 3, 2023
@codecov
Copy link

codecov bot commented Jun 3, 2023

Codecov Report

Merging #1501 (cfe2af7) into main (4b26667) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1501   +/-   ##
=======================================
  Coverage   74.96%   74.96%           
=======================================
  Files         176      176           
  Lines       49502    49500    -2     
  Branches    11987    11986    -1     
=======================================
+ Hits        37108    37110    +2     
+ Misses      10092    10089    -3     
+ Partials     2302     2301    -1     
Impacted Files Coverage Δ
aesara/scan/rewriting.py 79.37% <100.00%> (+0.14%) ⬆️

... and 1 file with indirect coverage changes

@brandonwillard brandonwillard merged commit 2368ed3 into aesara-devs:main Jun 3, 2023
23 checks passed
@brandonwillard brandonwillard deleted the fix-scan-save-mem-bcast-bug branch June 4, 2023 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working graph rewriting Scan Involves the `Scan` `Op`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aesara.scan IndexError
1 participant