---
# System prepended metadata

title: '[DaCe] Optimization V'
tags: [cycle 26 - 11/24]

---

# [DaCe] Optimization V
<!-- [DaCe] Optimization V -- The Optimizer Strikes Back -->

- Shaped by: Philip
- Appetite (FTEs, weeks): (66%)
- Developers: <!-- Filled in at the betting table unless someone is specifically required here -->

## Problem
In this is mostly a continuation of our work from [last cycle](https://hackmd.io/6w2Oupl3QgWzxBawx6n7bA?view).
There we were able to optimize the [`apply_diffusion_to_vn`](https://github.com/C2SM/icon4py/blob/main/model/atmosphere/diffusion/src/icon4py/model/atmosphere/diffusion/stencils/apply_diffusion_to_vn.py) and get [~50%](https://docs.google.com/presentation/d/1ANdDw1lzA8q9bUXZi4oUpnt2pl9A9cPaxRfrlurqayc/edit?usp=sharing) increase comparred to OpenACC.
However, we were unable to also test the second one [apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulence](https://github.com/C2SM/icon4py/blob/main/model/atmosphere/diffusion/src/icon4py/model/atmosphere/diffusion/stencils/apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulence.py).
So in this project we will focuse on:
1) Doing the same thing to the second stencil.
2) Trying to merge the current pipeline back to main.

Especially the first point is interessting, because here fussing everything together is not fully beneficial.



## Appetite
The full clcle, but I have to work 33% of my time for LUMI.


## Solution
<!-- The core elements we came up with, presented in a form that’s easy for people to immediately understand -->

## Rabbit holes
<!-- Details about the solution worth calling out to avoid problems -->

## No-gos
<!-- Anything specifically excluded from the concept: functionality or use cases we intentionally aren’t covering to fit the ## appetite or make the problem tractable -->

## Progress
<!-- Don't fill during shaping. This area is for collecting TODOs during building. As first task during building add a preliminary list of coarse-grained tasks for the project and refine them with finer-grained items when it makes sense as you work on them. -->

- Run them as is.
- [x] Apply the modification to the offset tables
- [ ] Fixing the k-Blocking transformation.
- [ ] Make transformation for unify the storage type of everything.
- Fixing the the WCR transformation such that the reductions can be fused.
- Replicating and relocating transformation
- Implement the "Shrinking Map Fusion"
- If time Start thinking about the map OTFMapFusion





