-
Notifications
You must be signed in to change notification settings - Fork 49
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
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
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
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.
In general it looks good but I have some suggestions.
src/gt4py/next/program_processors/runners/dace_common/dace_backend.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_common/workflow.py
Outdated
Show resolved
Hide resolved
tests/next_tests/unit_tests/program_processor_tests/runners_tests/dace_tests/test_dace.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_common/workflow.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_common/workflow.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_common/workflow.py
Outdated
Show resolved
Hide resolved
tests/next_tests/unit_tests/program_processor_tests/runners_tests/dace_tests/test_dace.py
Outdated
Show resolved
Hide resolved
philip-paul-mueller
approved these changes
Sep 27, 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
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.
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.