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

feat[dace][next]: Adjusted the handling of non standard GPU Memlets. #1913

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

philip-paul-mueller
Copy link
Contributor

@philip-paul-mueller philip-paul-mueller commented Mar 17, 2025

Once PR#1976 is merged in DaCe the code generator is able to handle more Memlets directly as Cuda memcpy() calls. This PR modifies the GPU transformation of GT4Py in such a way that these Memlets are no longer transformed into Maps.

However, it can only be merged if the DaCe dependency was bumped to a version that includes PR#1976!

Once [PR#1976](spcl/dace#1976) is merged in DaCe the code generator is able to handle more Memlets directly as Cuda `memcpy()` calls.
This PR modifies the GPU transformation of GT4Py in such a way that these Memlets are no longer transformed into Maps.

However, it can only be merged if the DaCe dependency was bumped to a version that includes PR#1976!
else:
is_fortran_order = src_strides[0] == 1 and dst_strides[0] == 1
is_c_order = src_strides[-1] == 1 and dst_strides[-1] == 1
if is_c_order or is_fortran_order:
continue
elif dims > 2:
if not (src_strides[-1] != 1 or dst_strides[-1] != 1):
Copy link
Contributor

Choose a reason for hiding this comment

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

I was wondering why we do not handle the case dims > 2. Is it because the generic cudaMemcpy() does not provide parameters wOffset and hOffset?

Copy link
Contributor

Choose a reason for hiding this comment

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

By handle, I mean why we do not consider the Fortran order.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has to do with the code generator that can only C order at the moment for more than 3 dimensions.
This is something I want to fix in DaCe but was not pressing enough yet.

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