Infrastructure to test DaCe's codegen (in)deterministic behavior#2590
Open
kotsaloscv wants to merge 11 commits into
Open
Infrastructure to test DaCe's codegen (in)deterministic behavior#2590kotsaloscv wants to merge 11 commits into
kotsaloscv wants to merge 11 commits into
Conversation
…CD integration [WIP]
…CD integration [WIP]
…t ONLY GT4Py tests (next & cartesian)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds infrastructure to detect non-determinism in gt4py's DaCe codegen. Two new parametrized nox sessions run gt4py's own DaCe test selection twice with isolated build caches, then byte-compare the generated sources under each program's
src/. The session is successful when the codegen is identical between the two runs, fails on any diff. Supports thedace_cpu,dace_gpu(CUDA), and HIP backends. Driven entirely from gt4py's own nox sessions — no external repo needed.Layout
noxfile.py— two new sessions,test_cartesian_determinismandtest_next_determinism, parametrized overdevice(plusmeshlibfortest_next). Each calls a shared_run_dace_determinism_checkhelper that runs gt4py's regular DaCe pytest selection twice withGT4PY_BUILD_CACHE_DIRpointed at isolated workdirs, then invokes the comparator. Taggeddace+determinism, sonox -t determinismruns every variant.scripts/dace_deterministic_codegen.py— pure-stdlib comparison library + thin argparse CLI. Snapshots each cache, compares<program>/src/{cpu,cuda}/...byte-for-byte (HIP files undersrc/cuda/hip/covered transparently). Distinct exception types (and CLI exit codes) for actual mismatch, unsupported backend, no programs cached, and source-not-retained — each with an actionable diagnostic. Reusable for ad-hoc comparison of any two existing caches.ci/cscs-ci-dace-determinism.yml— CI driver, included fromcscs-ci.yml.DaCe build folder mode
The check requires
DACE_compiler_build_folder_mode=development. gt4py configures DaCe toproductionby default, which strips the generatedsrc/tree after compilation — leaving nothing to compare. The nox sessions set this env var automatically; the comparator raisesNoSourceFilesObservedErrorwith an env-var hint if it ever encounters caches built without it.CI
New
dace-determinismstage inci/cscs-ci-dace-determinism.yml, included fromcscs-ci.yml.Local use