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[next][dace]: Bugfix for neighbors reduction with lift expressions #1599

Merged
merged 2 commits into from
Aug 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,13 @@ def _visit_lift_in_neighbors_reduction(

if offset_provider.has_skip_values:
# check neighbor validity on if/else inter-state edge
start_state = lift_context.body.add_state("start", is_start_block=True)
# use one branch for connectivity case
start_state = lift_context.body.add_state_before(
lift_context.body.start_state,
"start",
condition=f"{lifted_index_connectors[0]} != {neighbor_skip_value}",
)
# use the other branch for skip value case
skip_neighbor_state = lift_context.body.add_state("skip_neighbor")
skip_neighbor_state.add_edge(
skip_neighbor_state.add_tasklet(
Expand All @@ -315,11 +321,6 @@ def _visit_lift_in_neighbors_reduction(
skip_neighbor_state,
dace.InterstateEdge(condition=f"{lifted_index_connectors[0]} == {neighbor_skip_value}"),
)
lift_context.body.add_edge(
start_state,
lift_context.state,
dace.InterstateEdge(condition=f"{lifted_index_connectors[0]} != {neighbor_skip_value}"),
)

return [ValueExpr(neighbor_value_node, inner_outputs[0].dtype)]

Expand Down
Loading