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][dace]: Fixes to DaCe backend to support latest ITIR #1499

Merged
merged 15 commits into from
Mar 19, 2024

Conversation

edopao
Copy link
Contributor

@edopao edopao commented Mar 18, 2024

Fixes in DaCe backend to support latest ITIR:

  • Add support for tuple argument to lambda functions.
  • Flatten list of expressions in if-statememts

Minor code cleanup: skip debug information for memlets.

edopao and others added 13 commits March 8, 2024 11:52
It noticed we execute some tests that use cupy in the cpu CSCS-CI. These tests are always executed when cupy is installed (which usually means we have a gpu, but not necessarily). This PR changes this such that they are marked with `requires_gpu` and as such can be disabled.
Variadic generic type: 
```python
ShapeT = TypeVarTuple("ShapeT")


class Dims(Generic[Unpack[ShapeT]]):
    shape: tuple[Unpack[ShapeT]]


DimsT = TypeVar("DimsT", bound=Dims, covariant=True)
```
such that field type is as follows: 
```python
Field[Dims[D0, D1, ...], DType]
```
## New:
- "next.ffront":
  - ".past_to_itir": workflow step PAST -> ITIR
- ".transform_utils": some utility functions moved from
"next.ffront.decorator"
 
## Changed:
 - "Backend":
   - is not a "ProgramProcessor" anymore
   - still passes "is_program_backend" test
- new attribute ".transformer", a workflow which prepares for the
".executor"
- currently starts at "stages.PastClosure" (PAST node + args, kwargs)
but will evolve into starting from function definition + args, kwargs
 
 - "ModularExecutor":
   - is now a "ProgramExecutor" (passes "is_processor_kind" test)

 - "program_processor_interface":
- "is_program_backend" test now checks for existence of an ".executor"
attribute, which must pass the executor test
   
 - "ffront.decorator":
   - several utilities and methods refactored out into the new modules

- tests: test utils / fixtures refactored to deal with backends which
are not executors

---------

Co-authored-by: nfarabullini <nicoletta.farabullini@c2sm.ethz.ch>
Co-authored-by: Rico Häuselmann <ricoh@cscs.ch>
Requires full type annotations in next.ffront.
Introduces `concat_where` to be used for boundary conditions.

`where` will intersect all 3 fields. Therefore `where(klevel == 0,
boundary_layer, interior)` will not work if `boundary_layer` is only
defined on `klevel == 0`.

`concat_where` will concatenate the fields that are selected by the mask
regions. The `mask` is currently required to be 1 dimensional.
@edopao edopao changed the title Dace fix if values fix[next][dace]: Fixes to DaCe backend to support latest ITIR Mar 18, 2024
@edopao edopao marked this pull request as ready for review March 19, 2024 10:53
@edopao edopao merged commit 0a9be51 into GridTools:main Mar 19, 2024
31 checks passed
@edopao edopao deleted the dace-fix_if-values branch March 19, 2024 17:28
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