Skip to content

perf[next-dace]: allow guarded fusion through shared outputs - #2922

Open
dganellari wants to merge 1 commit into
GridTools:mainfrom
dganellari:review-shared-output-fusion
Open

dganellari wants to merge 1 commit into
GridTools:mainfrom
dganellari:review-shared-output-fusion

Conversation

@dganellari

@dganellari dganellari commented Sep 25, 2026 •

Copy link
Copy Markdown

Allow a producer map to be split to match its consumers even when it writes external outputs. Existing map fusion can then combine matching pieces while preserving required output stores and later-state reads.

Before: producer(theta, rho)[0:12] -> consumer(theta)[0:3], consumer(theta)[3:12]
After:  fused producer/consumer[0:3], fused producer/consumer[3:12]
        External theta and rho stores remain in both bands.

The option defaults to off. vertical_split_allow_shared_data enables it through the normal optimizer; vertical_split_shared_data and vertical_split_shared_data_dimension can restrict the field and split dimension. Aliases, uncertain coverage and unsupported accesses are rejected. Applications do not need to inspect or modify SDFG nodes to select this pattern.

This PR targets main and contains only shared-output SDFG changes. ADR 0029 explains the pattern, selection and safety restrictions. The separate scan-input pass is #2923; the array-scalar warning fix is #2924. ICON4Py selects these options in C2SM/icon4py#1484.

Focused compiler/backend tests, scoped nox/doctests and staged checks passed. The refreshed companion stack also passed regional/global GPU validation at 120 levels on MI300A and GH200, with all 146 compared arrays matching exactly and generated-graph checks confirming the transformations.

Those GPU timings enable both passes together. The theta-rho program improved 14.67% on regional MI300A, but regressed 3.22% on regional GH200 at its 32x8 block setting; global theta changes were unresolved. This supports selective application, not a general profitability rule. The older timings in the ADR remain historical and are not substituted for the rebase results.

… backend.

Keep the transformation opt-in and preserve required external writes.
@dganellari

dganellari commented Oct 27, 2026 •

Copy link
Copy Markdown
Author

Tested with this pass enabled for all programs in the stencil benchmark suite. We did not find any additional benefit apart from theta-rho, where we already had the improvement. So I think we should keep it enabled only for theta-rho in ICON4Py for now.

This branch has not been deployed

No deployments
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