From 45c73ad49946c7c607b65f07f188375746953030 Mon Sep 17 00:00:00 2001 From: Hannes Vogt Date: Mon, 4 Nov 2024 13:15:29 +0000 Subject: [PATCH] add gtir_python backend --- ci/default.yml | 4 ++-- model/common/src/icon4py/model/common/config.py | 3 +++ model/common/src/icon4py/model/common/test_utils/helpers.py | 2 +- .../src/icon4py/model/common/test_utils/pytest_config.py | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ci/default.yml b/ci/default.yml index 70bf351d94..855cf635d3 100644 --- a/ci/default.yml +++ b/ci/default.yml @@ -7,11 +7,11 @@ include: - tox -r -e run_stencil_tests -c model/ -- --backend=$BACKEND --grid=$GRID parallel: matrix: - - BACKEND: [gtfn_cpu, gtfn_gpu, roundtrip] + - BACKEND: [gtfn_cpu, gtfn_gpu, roundtrip, gtir_python] GRID: [simple_grid, icon_grid] rules: # exclude slow test configurations - - if: $BACKEND == "roundtrip" && $GRID == "icon_grid" + - if: $BACKEND in ["roundtrip", "gtir_python"] && $GRID == "icon_grid" when: never - when: on_success test_model_stencils_x86_64: diff --git a/model/common/src/icon4py/model/common/config.py b/model/common/src/icon4py/model/common/config.py index fba138bf14..637ad19366 100644 --- a/model/common/src/icon4py/model/common/config.py +++ b/model/common/src/icon4py/model/common/config.py @@ -18,6 +18,7 @@ run_gtfn_cached, run_gtfn_gpu_cached, ) +from gt4py.next.program_processors.runners.roundtrip import gtir as gtir_python try: @@ -44,6 +45,7 @@ class GT4PyBackend(Enum): CPU = "run_gtfn_cached" GPU = "run_gtfn_gpu_cached" ROUNDTRIP = "run_roundtrip" + GTIR_PYTHON = "gtir_python" DACE_CPU = "run_dace_cpu" DACE_GPU = "run_dace_gpu" DACE_CPU_NOOPT = "run_dace_cpu_noopt" @@ -83,6 +85,7 @@ def gt4py_runner(self): GT4PyBackend.CPU.name: run_gtfn_cached, GT4PyBackend.GPU.name: run_gtfn_gpu_cached, GT4PyBackend.ROUNDTRIP.name: run_roundtrip, + GT4PyBackend.GTIR_PYTHON.name: gtir_python, } if dace: backend_map |= { diff --git a/model/common/src/icon4py/model/common/test_utils/helpers.py b/model/common/src/icon4py/model/common/test_utils/helpers.py index da3334b6bd..dc52f7d474 100644 --- a/model/common/src/icon4py/model/common/test_utils/helpers.py +++ b/model/common/src/icon4py/model/common/test_utils/helpers.py @@ -45,7 +45,7 @@ def is_embedded(backend) -> bool: def is_roundtrip(backend) -> bool: - return backend.name == "roundtrip" if backend else False + return backend.name in ["roundtrip", "gtir_python"] if backend else False def _shape( diff --git a/model/common/src/icon4py/model/common/test_utils/pytest_config.py b/model/common/src/icon4py/model/common/test_utils/pytest_config.py index d3a9934e8c..2163f2604d 100644 --- a/model/common/src/icon4py/model/common/test_utils/pytest_config.py +++ b/model/common/src/icon4py/model/common/test_utils/pytest_config.py @@ -10,6 +10,7 @@ import pytest from gt4py.next import gtfn_cpu, gtfn_gpu, itir_python +from gt4py.next.program_processors.runners.roundtrip import gtir as gtir_python import icon4py.model.common.settings as settings from icon4py.model.common.test_utils.datatest_utils import ( @@ -21,6 +22,7 @@ backends = { "embedded": None, "roundtrip": itir_python, + "gtir_python": gtir_python, "gtfn_cpu": gtfn_cpu, "gtfn_gpu": gtfn_gpu, }