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[next]: GT4Py programs as DaCe SDFGConvertibles #1527

Merged
merged 91 commits into from
Jul 26, 2024

Conversation

kotsaloscv
Copy link
Contributor

@kotsaloscv kotsaloscv commented Apr 12, 2024

With this fieature, a GT4Py.next Program can be placed inside a DaCe.program region, where its SDFG is automatically extracted and placed as a nested SDFG. This allows fusing multiple stencils under one SDFG -compilation unit-.

This feature is needed for implementing DaCe orchestration, e.g. in ICON4Py.

@kotsaloscv kotsaloscv self-assigned this Apr 12, 2024
@havogt
Copy link
Contributor

havogt commented Apr 12, 2024

Just a general comment, I am wondering if DaCe offers alternatively the option to register the conversion functions, instead of having to make them part of the object. (E.g. like jax pytrees work) If only the current option is available I am wondering if we should go with a monkey patching approach to remove the dace import from unrelated modules. But this is for @egparedes to answer. (And we could think of the other option as a contribution to productice DaCe.)

Copy link
Contributor

@egparedes egparedes left a comment

Choose a reason for hiding this comment

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

It looks good, although I have a couple of style suggestion and some questions, mostly related to my poor understanding of the SDFG convertible API.

src/gt4py/next/embedded/nd_array_field.py Outdated Show resolved Hide resolved
src/gt4py/next/ffront/decorator.py Show resolved Hide resolved
src/gt4py/next/iterator/embedded.py Outdated Show resolved Hide resolved
src/gt4py/next/iterator/embedded.py Outdated Show resolved Hide resolved
Copy link
Contributor

@egparedes egparedes left a comment

Choose a reason for hiding this comment

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

Ok, here are my last very small comments related to the Python style and it should be ready to be merged. I have some questions about the tests, but I think it would be easier to set a quick meeting to talk about it.

src/gt4py/next/ffront/decorator.py Outdated Show resolved Hide resolved
src/gt4py/next/embedded/nd_array_field.py Outdated Show resolved Hide resolved
src/gt4py/next/iterator/embedded.py Outdated Show resolved Hide resolved
src/gt4py/next/iterator/embedded.py Show resolved Hide resolved
src/gt4py/next/iterator/embedded.py Show resolved Hide resolved
Copy link
Contributor

@egparedes egparedes left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the hard work to make this work in a clean way.

@egparedes
Copy link
Contributor

cscs-ci run

@egparedes
Copy link
Contributor

cscs-ci run default

@kotsaloscv
Copy link
Contributor Author

cscs-ci run

@kotsaloscv
Copy link
Contributor Author

cscs-ci run default

@kotsaloscv kotsaloscv merged commit 20fae77 into GridTools:main Jul 26, 2024
35 checks passed
@kotsaloscv kotsaloscv deleted the sdfgConvertible branch July 30, 2024 09:40
@kotsaloscv kotsaloscv restored the sdfgConvertible branch August 8, 2024 08:43
@kotsaloscv kotsaloscv deleted the sdfgConvertible branch August 8, 2024 08:45
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.

5 participants