Skip to content

fix[next-dace]: Map stride of local dimension in nested SDFG#2593

Open
edopao wants to merge 10 commits intoGridTools:mainfrom
edopao:dace_fix_stride_if_region
Open

fix[next-dace]: Map stride of local dimension in nested SDFG#2593
edopao wants to merge 10 commits intoGridTools:mainfrom
edopao:dace_fix_stride_if_region

Conversation

@edopao
Copy link
Copy Markdown
Contributor

@edopao edopao commented May 6, 2026

This PR contains 3 kinds of changes:

  1. A bugfix in mapping the stride of local dimension into the nested SDFG of if expressions.
inner_desc = dace.data.Array(
    dtype=arg_desc.dtype,
    shape=(arg_desc.shape[local_dim_pos],),
    strides=(arg_desc.strides[local_dim_pos],),
)
  1. Addition of connectivities. This is needed to support the pattern with can_deref expressions (not part of this PR, see feat[next-dace]: Lowering mixed-GTIR to SDFG #2467). After GTIR transformations, which unroll the neighbors loops, a common pattern in grids with skip values is if(can_deref(a, V2E), deref(a(V2E)) + 2, 0).

  2. Renaming of function parameters.

TODO:

  • Check blueline performance regression

@edopao edopao requested a review from philip-paul-mueller May 7, 2026 11:44
Copy link
Copy Markdown
Contributor

@philip-paul-mueller philip-paul-mueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not fully happy with this change because it has potentially big implication for the IfMover and the condition fuser (which will stop working, since it can no longer identifying which If-Blocks can be moved together.
Because of these implication we must absolutely make sure to also run MuPhys, because, it will be very much impacted by these changes.

I am actually not sure if the data locality is actually improved, because in the almost everything has a restrict keyword, so the compiler should be smart enough tio figuring that out.
But this is just my concern or have you different opinions @iomaganaris

Comment thread src/gt4py/next/program_processors/runners/dace/lowering/gtir_dataflow.py Outdated
Comment thread src/gt4py/next/program_processors/runners/dace/lowering/gtir_dataflow.py Outdated
@edopao
Copy link
Copy Markdown
Contributor Author

edopao commented May 7, 2026

I am not fully happy with this change because it has potentially big implication for the IfMover and the condition fuser (which will stop working, since it can no longer identifying which If-Blocks can be moved together. Because of these implication we must absolutely make sure to also run MuPhys, because, it will be very much impacted by these changes.

I am actually not sure if the data locality is actually improved, because in the almost everything has a restrict keyword, so the compiler should be smart enough tio figuring that out. But this is just my concern or have you different opinions @iomaganaris

I see your point, makes sense. This change is not part of the bugfix, so I could revert it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants