Repository navigation
Conversation
…ured programs in gtfn Add a required grid_type field to ProgramSource, filled by the gtfn and dace translation steps, and use it in the nanobind bindings to apply unstructured_horizontal_has_unit_stride only to unstructured programs.
PR Reviewer Guide 🔍(Review updated until commit 1b78864)Here are some key observations to aid the review process:
⚙️ Agent run details
✅ Resolved findingssrc/gt4py/next/program_processors/codegens/gtfn/gtfn_module.py:227Test coverage gap The gtfn translation step now fills |
|
/review |
Parametrize test_codegen (gtfn) and test_translation_grid_type (dace) over cartesian and unstructured programs. The dace test also checks the strides of the emitted SDFG, which makes the cartesian find_constant_symbols test redundant.
|
/review |
havogt
left a comment
There was a problem hiding this comment.
The dace changes look ok, but the gtfn changes can't be in the generic build infrastructure.
…cture Address review: revert grid_type on ProgramSource, compiledb and nanobind. GTFNTranslationStep now emits a GTFNProgramSource, a ProgramSource subclass with the grid type, and make_gtfn_bindings returns a GTFNBindings step that enables unstructured_horizontal_has_unit_stride only for unstructured programs before calling the unchanged nanobind.ExtensionGenerator.
I've reverted the changes to |
Description
The
unstructured_horizontal_has_unit_strideoption assumes unit stride on the horizontal dimension of fields and connectivities. It should apply only to unstructured programs, and only to horizontal dimensions. On a Cartesian gridIDim/JDimare both horizontal, so applying it there gives fields with two unit-stride dimensions, which is wrong.find_constant_symbolssets the stride symbols to 1 only for the horizontal dimension, and only when the program is unstructured.ProgramSource, nanobind, compiledb) is unchanged:GTFNTranslationStepemits aGTFNProgramSource, aProgramSourcesubclass that carries the grid type of the program.make_gtfn_bindingsreturns aGTFNBindingsstep, which enablesunstructured_horizontal_has_unit_strideonly for unstructured programs before calling the unchangednanobind.ExtensionGenerator.Tests
test_dace_translation.py:test_find_constant_symbols: on fields with a vertical dimension, unit stride is set on the horizontal dimension only (flag on/off, field origin on/off).test_translation_grid_type(Cartesian and unstructured): runs the full translator and checks the strides of the emitted SDFG. The horizontal dimensions are unit stride for the unstructured program, and all strides stay symbolic for the Cartesian one.test_codegenintest_gtfn_module.py(Cartesian and unstructured): the translation step emits aGTFNProgramSourcewith the grid type of the program.test_bindings_static_stridesintest_gtfn.py: checks thestride_specgenerated by the GTFN bindings step for unstructured (flag on/off) and Cartesian programs.