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]: Fix usage of DaCe fast-call to SDFG #1656

Merged
merged 37 commits into from
Sep 27, 2024

Conversation

edopao
Copy link
Contributor

@edopao edopao commented Sep 20, 2024

This PR addresses some flaky test failures observed in GT4Py CI. The root cause was that the dace backend did not check the connectivity arrays, which are passed as keyword-arguments to the SDFG. It did only check the positional arguments. The connectivity arrays do not have to be allocated on the device memory: for gpu execution, the backend ensures that the connectivity arrays are copied to device memory just before passing them to the SDFG call. Previous implementation worked sometimes, when by chance cupy was reusing the same array on gpu memory, hence the flaky behavior of the tests.
New test is added for the connectivity case. The previous test case is cleaned up and improved, by invalidating all scalar positional arguments at each SDFG call: this allows to test that they are overridden before fast_call.

Additionally, this PR reduces the overhead of regular SDFG call: previous implementation was copying all the connectivity arrays to gpu memory, with this PR we only allocate cupy arrays for the connectivities used in the SDFG.

@edopao edopao closed this Sep 23, 2024
@edopao edopao reopened this Sep 23, 2024
@edopao edopao closed this Sep 23, 2024
@edopao edopao reopened this Sep 23, 2024
@edopao edopao changed the title fix[next]: Fix for DaCe fast_call API fix[next]: Fix usage of DaCe fast-call to SDFG Sep 25, 2024
@edopao edopao marked this pull request as ready for review September 25, 2024 14:13
Copy link
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.

In general it looks good but I have some suggestions.

Copy link
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.

LGTM

@edopao edopao merged commit 6d011ea into GridTools:main Sep 27, 2024
31 checks passed
@edopao edopao deleted the dace-fix-fast_call branch September 27, 2024 06:41
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