diff --git a/src/gt4py/cartesian/backend/dace_backend.py b/src/gt4py/cartesian/backend/dace_backend.py index 7a37a740c0..d0b60bf0e9 100644 --- a/src/gt4py/cartesian/backend/dace_backend.py +++ b/src/gt4py/cartesian/backend/dace_backend.py @@ -14,7 +14,7 @@ import re from typing import TYPE_CHECKING, ClassVar -from dace import SDFG, DebugInfo, Memlet, SDFGState, config, data, dtypes, nodes, subsets, symbolic +from dace import SDFG, Memlet, SDFGState, config, data, dtypes, nodes, subsets, symbolic from dace.codegen import codeobject from dace.sdfg.analysis.schedule_tree import treenodes as tn from dace.sdfg.utils import inline_sdfgs @@ -146,10 +146,7 @@ def _sdfg_add_arrays_and_edges( if name in inputs: state.add_edge( - state.add_read( - name, - DebugInfo(123456), # fake DebugInfo to avoid calls to `inspect` - ), + state.add_read(name), None, nsdfg, name, @@ -159,10 +156,7 @@ def _sdfg_add_arrays_and_edges( state.add_edge( nsdfg, name, - state.add_write( - name, - DebugInfo(123456), # fake DebugInfo to avoid calls to `inspect` - ), + state.add_write(name), None, Memlet(name, subset=subsets.Range(ranges)), ) @@ -175,10 +169,7 @@ def _sdfg_add_arrays_and_edges( ) if name in inputs: state.add_edge( - state.add_read( - name, - DebugInfo(123456), # fake DebugInfo to avoid calls to `inspect` - ), + state.add_read(name), None, nsdfg, name, @@ -188,10 +179,7 @@ def _sdfg_add_arrays_and_edges( state.add_edge( nsdfg, name, - state.add_write( - name, - DebugInfo(123456), # fake DebugInfo to avoid calls to `inspect` - ), + state.add_write(name), None, Memlet(name), ) @@ -273,8 +261,7 @@ def freeze_origin_domain_sdfg( inputs = set(filter(lambda name: not inner_sdfg.arrays[name].transient, inputs)) outputs = set(filter(lambda name: not inner_sdfg.arrays[name].transient, outputs)) - # fake DebugInfo to avoid calls to `inspect` - nsdfg = state.add_nested_sdfg(inner_sdfg, inputs, outputs, debuginfo=DebugInfo(123456)) + nsdfg = state.add_nested_sdfg(inner_sdfg, inputs, outputs) _sdfg_add_arrays_and_edges( field_info, wrapper_sdfg, state, inner_sdfg, nsdfg, inputs, outputs, origin @@ -608,6 +595,11 @@ def apply(cls, builder: StencilBuilder, sdfg: SDFG) -> str: value=gt_config.DACE_DEFAULT_BLOCK_SIZE, ) config.Config.set("compiler", "cpu", "openmp_sections", value=False) + # The default, "inspect", will inspect the python stack for every object that's added + # to the SDFG, which doesn't provide a DebugInfo object. Those calls add up over time + # and - in our case - end up with line information pointing to the GT4Py-DaCe bridge. + # We thus decided to turn off lineinfo in the DaCe config. + config.Config.set("compiler", "lineinfo", value="none") code_objects = sdfg.generate_code() is_gpu = "CUDA" in {co.title for co in code_objects} diff --git a/uv.lock b/uv.lock index ddc7468424..449acb09ef 100644 --- a/uv.lock +++ b/uv.lock @@ -1210,7 +1210,7 @@ wheels = [ [[package]] name = "dace" version = "1.0.0" -source = { git = "https://github.com/GridTools/dace?branch=romanc%2Fstree-v2#0d9f3b4ede7a87aa3c86913481740390431e2b21" } +source = { git = "https://github.com/GridTools/dace?branch=romanc%2Fstree-v2#43811b298769a626085d8917e5d9516060af8ec5" } resolution-markers = [ "python_full_version >= '3.14' and sys_platform == 'win32'", "python_full_version >= '3.14' and sys_platform == 'emscripten'", @@ -1789,7 +1789,7 @@ build = [ { name = "wheel" }, ] dace-cartesian = [ - { name = "dace", version = "1.0.0", source = { git = "https://github.com/GridTools/dace?branch=romanc%2Fstree-v2#0d9f3b4ede7a87aa3c86913481740390431e2b21" } }, + { name = "dace", version = "1.0.0", source = { git = "https://github.com/GridTools/dace?branch=romanc%2Fstree-v2#43811b298769a626085d8917e5d9516060af8ec5" } }, ] dace-next = [ { name = "dace", version = "43!2026.4.20", source = { registry = "https://gridtools.github.io/pypi/" } },