-
Notifications
You must be signed in to change notification settings - Fork 130
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 cpp.reshape_strides()
, which currently cannot handle inputs that tries to increase the number of dimensions after the reshape.
#1692
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
acalotoiu
reviewed
Oct 23, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM -please add the test as discussed
pratyai
force-pushed
the
fix-codegen
branch
2 times, most recently
from
October 23, 2024 21:59
669abe2
to
8022221
Compare
def original_graph_with_redundant_array():
g = SDFG('prog')
g.add_array('A', (5, 5), dace.float32)
g.add_array('b', (1,), dace.float32, transient=True)
g.add_array('c', (5, 5), dace.float32, transient=True)
st0 = g.add_state('st0', is_start_block=True)
st = st0
# Make a single map that copies A[i, j] to a transient "scalar" b, then copies that out to a transient array
# c[i, j], then finally back to A[i, j] again.
A = st.add_access('A')
en, ex = st.add_map('m0', {'i': '0:1', 'j': '0:1'})
st.add_memlet_path(A, en, dst_conn='IN_A', memlet=Memlet(expr='A[0:1, 0:1]'))
b = st.add_access('b')
st.add_memlet_path(en, b, src_conn='OUT_A', memlet=Memlet(expr='A[i, j] -> b[0]'))
c = st.add_access('c')
st.add_memlet_path(b, c, memlet=Memlet(expr='b[0] -> c[i, j]'))
st.add_memlet_path(c, ex, dst_conn='IN_A', memlet=Memlet(expr='c[i, j] -> A[i, j]'))
A = st.add_access('A')
st.add_memlet_path(ex, A, src_conn='OUT_A', memlet=Memlet(expr='A[0:1, 0:1]'))
st0.fill_scope_connectors()
g.validate()
g.compile()
return g |
tbennun
requested changes
Oct 24, 2024
like: ```c++ cpp.reshape_strides(Range([(0, 4, 1), (0, 5, 1)]), None, None, [2, 3, 5]) ``` and crashes with an index error.
pratyai
added
no-ci
Do not run any CI or actions for this PR
and removed
no-ci
Do not run any CI or actions for this PR
labels
Oct 24, 2024
pratyai
changed the title
Fix the issue with cpp codegen, where it currently cannot handle certain valid graphs.
Fix Oct 29, 2024
cpp.reshape_strides()
, which currently cannot handle inputs that tries to increase the number of dimensions after the reshape.
tbennun
approved these changes
Nov 8, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix the issue with cpp codegen, where it currently cannot handle inputs:
and crashes with an index error.
Also fixes #1690 where
RedundantArray
was producing a (valid) graph that triggered this.