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

Recover default backend handling #42

Closed
wants to merge 38 commits into from

Conversation

havogt
Copy link
Owner

@havogt havogt commented Nov 30, 2023

Description

Describe the content of the PR and links to related issues, bugs of features.

Requirements

Before submitting this PR, please make sure:

  • You have run the code checks, tests and documentation build successfully
  • All fixes and all new functionality are tested and documentation is up to date
  • You looked at the review checklist

Additionally, if this PR contains code authored by new contributors:

  • All the authors are covered by a valid contributor assignment agreement,
    signed by the employer if needed, provided to ETH Zurich
  • The names of all the new contributors have been added to an updated
    version of the AUTHORS.rst file included in the PR

tehrengruber and others added 30 commits November 29, 2023 17:59
Move `gt4py.next.iterator.ir_makers` and `gt4py.next.iterator.transforms.common_pattern_matcher` into a new module named `gt4py.next.iterator.ir_utils`. Just a small refactoring in preparation of GridTools#1350.
…ridTools#1370)

Full-inlining of unrolled reduce in DaCe backend requires lambda
arguments to be inlined, in order to generate the corresponding taskgraph.
This PR adds an option to the existing ITIR transformation InlineLambdas
to enable this additional transformation pass, disabled by default.
* Adapt state struct codegen for indexing of dace:* stencil backend

* Add new "Default" schedule type for dace <> gt4py schedule mapping

* Missing key for make template render

* Fix typo

* Typo of the typo (tm)
…expressions (GridTools#1377)

This PR adds support to DaCe backend for sparse fields and reductions over lift expressions.
)

During integration of icon4py stencils with the DaCe backend, it was found that reduce-unroll can generate an ITIR containing can_deref on a scalar value. Such expression should always evaluate to true, so it can be evaluated at compile-time.
Note that in theory such case could be detected by the ITIR pass, once ITIR type inference is replaced by a new solution. At that time, the solution proposed here should be removed.
This commit adds positional arguments to the generated SDFG.
It also improves the naming of some automatically generated symbols, such as the shape and stride.
…s#1379)

Before it was only possible to translate ITIR to SDFG and execute it and it was not possible to extract the SDFG.
This commits splits this task into two parts and thus allows to perform the ITIR to SDFG translation without executing it.
Most part of this PR is about cleaning up and refactoring the code in DaCe backend for translation of neighbor reduction. As part of the refactoring, the backend is now using the reduce library node from DaCe library.

However, this PR also contains one functional change, which is a fix. Neighbor reduction should check for validity of neighbor index. This means for neighbor-tables to check that the neighbor index stored in the table is not -1. For neighbor strided offsets, we should check that the neighbor index does not access the origin field out of boundary.
…ridTools#1393)

Some icon4py stencils require support for if expressions with tuple arguments.
This PR adds support to the DaCe backend in the visitor of builtin_if function.
Additionally, this PR contains one fix in the result of builtin_tuple_get, which should return a list.
Adds the scalar scan operator for embedded field view.
Fix for broken DaCe test in baseline:
- use `flatten_list` to get `ValueExpr` arguments to numeric builtin function

Additionally, enable test for DaCe backend (left-over from PR GridTools#1393).
- add style guide to the coding guidelines
- fix existing error messages in next
- deal with ensuing qa errorrs / test updates
- unshadow one test and fix the code it wasn't testing

Co-authored-by: Rico Häuselmann <ricoh@cscs.ch>
Co-authored-by: Enrique González Paredes <enriqueg@cscs.ch>
Changes to the quickstart guide to use `field.asnumpy()` (introduced in GridTools#1366) instead of `np.asarray(field)`. The quickstart guide is still broken though since the embedded backend (used by default) does not support skip neighbors connectivities.
- Introduce a better Infinity
- Make UnitRange Generic to express finite, infinite, left-finite, right-finite properly.
- Remove `Set` from UnitRange
)

Made it possible to also pass build flags to the `ITIR -> SDFG` translator.
Added a function to get the arguments to call an SDFG.

This commit adds a function that allows to generate the arguments needed to call an SDFG, before this was part of `run_dace_iterator()`.
This made it very complex to run an SDFG outside this function.

One should consider this as an amend to [PR GridTools#1379](GridTools#1379).
Implementation of array slicing in DaCe backend changed to a mapped tasklet. Tested on GPU. CUDA code generation did not support the previous implementation, based on memlet in nested-SDFG.
Modified how the SDFG arguments are computed.

It was noticed that some transformations, especially the `SDFG.apply_gpu_transformation()`, to the SDFG, added new arguments to the SDFG.
But, since a lot of functions build on the `SDFG.arg_names` member and this member was populated before the transformation, an error occurred.
Thus it was changed such that `SDFG.arg_names` was only populated with the arguments also known to the Fencil.
Currently only supported in field view embedded.
@havogt havogt closed this Oct 1, 2024
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.

6 participants