Repository navigation
Conversation
The call-site `scan` takes `range=(dim, start, stop)` instead of `axis`: the carry starts from `init` at the range boundary and the result is only defined on the range, independent of the domain the result is accessed on. `@scan_operator` keeps `axis`. The bounds are lowered into the scan's `as_fieldop` domain; domain inference keeps its vertical range. Where the scan's domain differs from what a `set_at` or a `concat_where` branch writes, the scan is read through a copy. Embedded call-site scans use the range instead of the closure column range.
- global_tmps: materialize a scan in a temporary and copy the part each output element needs, one statement per element domain, clipped to the scan's range - dace: clip scan branches of concat_where to their region instead of copying - embedded: write each tuple output element on its own domain - `cpm.is_applied_scan` replaces three local scan checks
Contributor
Author
|
🤖 Written by an agent on behalf of @havogt |
# Conflicts: # src/gt4py/next/embedded/operators.py # src/gt4py/next/ffront/foast_to_gtir.py # src/gt4py/next/iterator/transforms/infer_domain.py # tests/next_tests/integration_tests/feature_tests/ffront_tests/test_scan.py
This branch has not been deployed
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.
Description
Stacked on #3066.
The
scanbuiltin takes a required verticalrange=(dim, start, stop)instead ofaxis:initatstart(forward) or atstop - 1(backward).startandstopare integer scalars and may be runtime values.@scan_operatoris unchanged and keepsaxis.Changes:
rangeas(vertical dimension, integer, integer). The axis check is shared with the decorator, which still passesaxis.as_fieldop, with(-inf, inf)on every other dimension. The bounds (and a runtimeinit) are bound outside the lambda over the scan pass's parameters, so a parameter named like a bound does not capture it.set_atwrites, the scan is materialized in a temporary and copied with clipping.concat_whereclips a branch to its domain.Behaviour changes in embedded execution: a
@scan_operatorwith tuple outputs on different domains now raises instead of silently writing the intersection, and non-scan field operators with tuple outputs on different domains write each element in full, as the compiled backends do.Requirements