[Codegen |Serial Loop] Behavior of `MapToLoop` and pattern of access for arrays in serial loops
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- compilers, performance
Research direction
Start with the supplied Flux Advection archive and trace the listed pipeline: MapExpension, MapToLoop, inline SDFG, and RefineNestedAccess. Compare the generated serial-loop accesses with the examples; done means the strided accessor is lifted to loop entry, at least for center writes, without the remaining extra nesting.
Written by the indexing model from the issue text.
Description
Transforming a series of consecutive maps into a series of consecutives loop yield under performant code generation for array access by keeping the strided accessor at the deeper level of nestedness e.g.
for k
for i
for j
float gtIN__vc_im1 = vc[(((__i + (31 * __j)) + (961 * __k)) - 1)];
Further more the MapToLoop mechanism inserts a NestedSDFG for each new loop.
Applying RefineNestedAccess somewhat mitigate the issue but the lifting of the access remains one level to deep e.g.
for k
for i
vc_K = vc[k]
for j
float gtIN__vc_im1 = vc_K[(((__i + (31 * __j)) - 1)];
We would like to find a way to generate (at least for center writes) the access as soon as we enter the loop.
Linked is the Flux Advection code for C-grid of the FV3 dynamical core. It shows the behavior through the "best" pipeline we found
- original sdfg from stree
- expand maps via
MapExpension - convert to loop with
MapToLoop - attempt to inline SDFG (no change)
- refine memlets via
RefineNestedAccess
- Dominant language
- Python
- Stars
- 602
- Forks
- 171
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 43
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from spcl/dace
-
Difficulty 3/5 Half a day Newbie friendliness 55/100
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Maintainers usually reply within 2 days
-
Operational intensity raises TypeError on any library nodePossibly taken @abhinav-phi claimed this 4 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 2 days
-
ScalarToSymbolPromotion: replace the `0`-assignment fallback with guard-aware read/write analysisOpen
Difficulty 5/5 Over a week Newbie friendliness 42/100
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 2 days
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
software-mansion-labs/Diplomat#20 ·
Maintainers usually reply within 1 day
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPossibly taken @lijy91 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainers usually reply within 1 day
-
View Counts discarded due to field name mismatchPossibly taken @rsiva0400 claimed this today. Opensite-bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Model version publishes the new UK firm entity as a personPossibly taken @vahid-ahmadi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PolicyEngine/policyengine.py#764 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
spcl/HPCAgent-Bench#264 ·
Maintainers usually reply within 1 day