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

DaCe Orchestration for the Diffusion Granule #514

Merged
merged 189 commits into from
Oct 15, 2024
Merged

Conversation

kotsaloscv
Copy link
Collaborator

@kotsaloscv kotsaloscv commented Jul 30, 2024

This PR concerns only the DaCe backend.

Currently, the Diffusion granule calls the various stencils one after the other (in _do_diffusion_step ). This means that for every stencil, there is a separate SDFG, and consequently one stencil is not aware of the others (this behavior limits the analyzability of the full granule). This PR introduces a decorator that fuses all these SDFGs under one compilation unit, allowing DaCe for further analysis and optimizations. Placing a GT4Py program inside a DaCe program region, and extracting the underlying SDFG, is possible due to this GT4Py PR.

The halo exchanges are also taken care from the DaCe orchestrator. A follow-up PR will introduce automated halo exchanges. Currently, the halo exchange class implements the SDFGConvertible interface like GT4Py Program.

The orchestrator is activated either through an env var ICON4PY_DACE_ORCHESTRATION=AnyValue or through this pytest option --dace-orchestration=AnyValue.

The orchestrator suppports ahead of time compilation, however given that DaCe does not support nested Structures -like self in the Diffusion class-, some of the arguments need to be provided at compile time, through dace.compiletime. This annotation means that the correspoding argument will be considered from the closure of the function.

The orchestrator provides full caching support and takes into consideration when a dace.compiletime argument changes, with a subsequent re-compilation of the fused SDFG.

@kotsaloscv
Copy link
Collaborator Author

cscs-ci run dace

@kotsaloscv
Copy link
Collaborator Author

cscs-ci run default

@kotsaloscv
Copy link
Collaborator Author

launch jenkins spack

@kotsaloscv
Copy link
Collaborator Author

cscs-ci run dace

@kotsaloscv
Copy link
Collaborator Author

cscs-ci run default

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.

I only looked at the decorator.py module and tried to provide as much information and suggestions as possible to make your life easier and try to get this done and merged ASAP.

@kotsaloscv
Copy link
Collaborator Author

cscs-ci run dace

@kotsaloscv
Copy link
Collaborator Author

cscs-ci run default

@kotsaloscv
Copy link
Collaborator Author

launch jenkins spack

@kotsaloscv
Copy link
Collaborator Author

cscs-ci run dace

@kotsaloscv
Copy link
Collaborator Author

cscs-ci run default

@kotsaloscv
Copy link
Collaborator Author

launch jenkins spack

@kotsaloscv
Copy link
Collaborator Author

cscs-ci run dace

Copy link

Mandatory Tests

Please make sure you run these tests via comment before you merge!

  • cscs-ci run default
  • launch jenkins spack

Optional Tests

To run benchmarks you can use:

  • cscs-ci run benchmark

To run tests and benchmarks with the DaCe backend you can use:

  • cscs-ci run dace

In case your change might affect downstream icon-exclaim, please consider running

  • launch jenkins icon

For more detailed information please look at CI in the EXCLAIM universe.

@kotsaloscv
Copy link
Collaborator Author

cscs-ci run default

@kotsaloscv
Copy link
Collaborator Author

launch jenkins spack

@kotsaloscv
Copy link
Collaborator Author

cscs-ci run 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.

LGTM

@kotsaloscv kotsaloscv merged commit 8836483 into main Oct 15, 2024
6 checks passed
@kotsaloscv kotsaloscv deleted the dace_driving_code branch October 15, 2024 13:48
OngChia pushed a commit that referenced this pull request Jan 14, 2025
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