Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 11 additions & 19 deletions src/gt4py/cartesian/backend/dace_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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)),
)
Expand All @@ -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,
Expand All @@ -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),
)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}

Expand Down
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading