diff --git a/src/gt4py/next/program_processors/runners/dace_common/utility.py b/src/gt4py/next/program_processors/runners/dace_common/utility.py index d678fdab7f..bc01e2abda 100644 --- a/src/gt4py/next/program_processors/runners/dace_common/utility.py +++ b/src/gt4py/next/program_processors/runners/dace_common/utility.py @@ -19,7 +19,7 @@ # regex to match the symbols for field shape and strides -FIELD_SYMBOL_RE: Final[re.Pattern] = re.compile("__.+_(size|stride)_\d+") +FIELD_SYMBOL_RE: Final[re.Pattern] = re.compile(r"__.+_(size|stride)_\d+") def as_dace_type(type_: ts.ScalarType) -> dace.typeclass: diff --git a/src/gt4py/next/program_processors/runners/dace_fieldview/workflow.py b/src/gt4py/next/program_processors/runners/dace_fieldview/workflow.py index 85ae95c432..aa4fd0cd3e 100644 --- a/src/gt4py/next/program_processors/runners/dace_fieldview/workflow.py +++ b/src/gt4py/next/program_processors/runners/dace_fieldview/workflow.py @@ -57,7 +57,12 @@ def generate_sdfg( if auto_opt: gtx_transformations.gt_auto_optimize(sdfg, gpu=on_gpu) elif on_gpu: - gtx_transformations.gt_gpu_transformation(sdfg, try_removing_trivial_maps=False) + # We run simplify to bring the SDFG into a canonical form that the gpu transformations + # can handle. This is a workaround for an issue with scalar expressions that are + # promoted to symbolic expressions and computed on the host (CPU), but the intermediate + # result is written to a GPU global variable (https://github.com/spcl/dace/issues/1773). + gtx_transformations.gt_simplify(sdfg) + gtx_transformations.gt_gpu_transformation(sdfg, try_removing_trivial_maps=True) return sdfg diff --git a/tests/next_tests/definitions.py b/tests/next_tests/definitions.py index c86ba88ead..01fd18897d 100644 --- a/tests/next_tests/definitions.py +++ b/tests/next_tests/definitions.py @@ -193,11 +193,7 @@ class ProgramFormatterId(_PythonObjectIdMixin, str, enum.Enum): OptionalProgramBackendId.DACE_CPU: DACE_SKIP_TEST_LIST, OptionalProgramBackendId.DACE_GPU: DACE_SKIP_TEST_LIST, OptionalProgramBackendId.GTIR_DACE_CPU: GTIR_DACE_SKIP_TEST_LIST, - OptionalProgramBackendId.GTIR_DACE_GPU: GTIR_DACE_SKIP_TEST_LIST - + [ - # TODO(edopao): Enable when GPU codegen issues related to symbolic domain are fixed. - (ALL, XFAIL, UNSUPPORTED_MESSAGE), - ], + OptionalProgramBackendId.GTIR_DACE_GPU: GTIR_DACE_SKIP_TEST_LIST, ProgramBackendId.GTFN_CPU: GTFN_SKIP_TEST_LIST + [(USES_SCAN_NESTED, XFAIL, UNSUPPORTED_MESSAGE)], ProgramBackendId.GTFN_CPU_IMPERATIVE: GTFN_SKIP_TEST_LIST diff --git a/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_execution.py b/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_execution.py index f10f195d3a..a5453151e6 100644 --- a/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_execution.py +++ b/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_execution.py @@ -7,21 +7,14 @@ # SPDX-License-Identifier: BSD-3-Clause from functools import reduce -from gt4py.next.otf import languages, stages, workflow -from gt4py.next.otf.binding import interface import numpy as np import pytest -import diskcache -from gt4py.eve import SymbolName - import gt4py.next as gtx from gt4py.next import ( astype, broadcast, common, - constructors, errors, - field_utils, float32, float64, int32, @@ -30,8 +23,6 @@ neighbor_sum, ) from gt4py.next.ffront.experimental import as_offset -from gt4py.next.program_processors.runners import gtfn -from gt4py.next.type_system import type_specifications as ts from gt4py.next import utils as gt_utils from next_tests.integration_tests import cases @@ -306,7 +297,7 @@ def test_double_use_scalar(cartesian_case): # TODO(tehrengruber): This should be a regression test on ITIR level, but tracing doesn't # work for this case. @gtx.field_operator - def testee(a: np.int32, b: np.int32, c: cases.IField) -> cases.IField: + def testee(a: int32, b: int32, c: cases.IField) -> cases.IField: tmp = a * b tmp2 = tmp * tmp # important part here is that we use the intermediate twice so that it is