Skip to content

perf[cartesian]: reduce SDFG construction time in dace backends#2519

Merged
romanc merged 2 commits intoGridTools:mainfrom
romanc:romanc/orch-compile-times
Mar 10, 2026
Merged

perf[cartesian]: reduce SDFG construction time in dace backends#2519
romanc merged 2 commits intoGridTools:mainfrom
romanc:romanc/orch-compile-times

Conversation

@romanc
Copy link
Contributor

@romanc romanc commented Mar 10, 2026

Description

This PR reduces SDFG construction time in dace backends. It does so by

  1. using a fake DebugInfo object when adding read/write nodes and nested SDFGs. If no DebugInfo object is given (the current state), dace will go and inspect the python stack to figure out where (in the python world) this access / nested SDFG was added. This call is first slow and second not really useful because it would just point to a line somewhere in dace_backend.py instead of pointing to user code. If we wanted to point to user code, we'd need to patch this information all the way from the OIR (through the schedule tree) to the SDFG that we are freezing. There might be better ways to freeze origin/domain into the SDFG. Exploring so is saved for later, see [Build] Orchestration build times & cache re-usability NOAA-GFDL/NDSL#397.
  2. removing safeguards like sdfg.validate() which have been deployed in a bunch of places when we built the gt4py/dace bridge and during the oir -> stree -> sdfg bridge. While these are important debugging tools while working on the dace backend and/or orchestration pipeline, they shouldn't end up in production.

Requirements

  • All fixes and/or new features come with corresponding tests.
    Covered by existing tests.
  • Important design decisions have been documented in the appropriate ADR inside the docs/development/ADRs/ folder.
    N/A

romanc added 2 commits March 9, 2026 19:43
Use a fake `DebugInfo` object to avoid calls to `inspect()` which would
anyway not return useful debug information since it will just point to
`dace_backend.py` and not the parsed code.
Copy link
Contributor

@FlorianDeconinck FlorianDeconinck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@romanc romanc merged commit 24b2dab into GridTools:main Mar 10, 2026
31 checks passed
@romanc romanc deleted the romanc/orch-compile-times branch March 10, 2026 17:40
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.

2 participants