Skip to content

feature[next]: Dycore fusion passes - #2906

Closed
dganellari wants to merge 5 commits into
GridTools:amd_chiplet_settingfrom
dganellari:dycore-fusion-passes
Closed

dganellari wants to merge 5 commits into
GridTools:amd_chiplet_settingfrom
dganellari:dycore-fusion-passes

Conversation

@dganellari

@dganellari dganellari commented Sep 21, 2026 •

Copy link
Copy Markdown

Enable guarded producer/consumer fusion in the DaCe backend while retaining the original model field operators. Both extensions are opt-in and reuse existing GT4Py transformations.

  • Extend VerticalSplitMapRange with allow_shared_data. Require disjoint pointwise writers and one covering writer for each reader. Preserve external stores and later consumers; reject unknown or unsafe partitions. Applications select candidates through the existing auto-optimizer callback.
  • Add bounded scan-input fusion using fuse_as_fieldop once per original scan, with optional per-input selection, alias guards and shifted-input handling. The optional field_operator preparation combines local coefficient expressions within their original function boundary. Calls to upstream field operators remain boundaries. Run the standard field-view transforms before fusion and again after a successful rewrite.
  • Convert array scalars before formatting the non-contiguous-domain warning, so a CuPy warning cannot abort compilation of an otherwise valid program.

The design ADR describes options, examples and safety limits. This branch is based on amd_chiplet_setting (eb763b97).

Reproduction with ICON4Py

Companion application integration and controlled runner: C2SM/icon4py#1484.

The reproduction instructions pin this compiler and the measured DaCe base. The runner selects the passes through normal ICON4Py model options, with separate or combined comparisons on global/120 and regional/120. It restores arrays and scalar state, checks 148 fields, uses balanced A/B quartets with interleaved A/A controls, and saves device/wall samples, SDFGs, generated code and source provenance. No compiler overlay or model rewrite is required.

Published controlled compiler-only measurements, original versus both passes:

GPU Regional device-time reduction Global device-time reduction
MI300A 5.99% 4.81%
GH200 2.06% 4.45%

These are the archived GPU experiments. The newly packaged public PR pair still requires its end-to-end GPU replay. The figures are combined-treatment results, not a universal profitability guarantee or isolated attribution to each pass. The ICON4Py PR documents wall time, timing controls, generated-code evidence and the original grid-dependent vendor gap.

Validation

  • Focused fusion/backend suites: 74 tests passed in branch validation.
  • Domain utility suite, including the array-scalar warning regression: 37 passed.
  • gt4py.next doctests: 111 passed, 2 skipped.
  • Staged pre-commit checks, including mypy and dependency boundaries, passed.

Requirements

  • Fixes and features have corresponding tests.
  • Design decisions are documented in the ADR.

@dganellari

Copy link
Copy Markdown
Author

Split this into three PRs so the changes can be reviewed separately:

Closing this PR in favor of those three. Keeping this branch available because our earlier GPU results refer to it.

@dganellari dganellari closed this Sep 25, 2026
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.

1 participant