(Towards/Close #3315, Closes #3590) New implementation of lfric loop fuse trans - #3595
LonelyCat124 wants to merge 14 commits into
Conversation
|
Here is the example of min and max builtins that could be easy targets to fuse: |
|
Some notes from our meeting.
We think most of the the benefit will come from fusing built-ins (particularly those that do MIN/MAX on the same field). We also discussed 'constant propagation' but realised that often, a |
|
I think the new implementation does most of this, what I couldn't work out is why is this necessary: This can be either:
Does that make sense @arporter ? I am also unsure I've done anything re: " I think they can be fused following the rules above, provided that the DA doesn't determine that a halo-exchange is required between them". I'll have to work that out next. |
Yes, sorry, I was a bit slack in how I phrased it. If the iteration space is defined by the same field/operator then we don't have to look at function spaces. We probably still need to worry about stencil accesses. In fact, now that I write that, we need to be careful about kernels that update more than one argument (they are permitted to do this). A first step might be to refuse to fuse such cases. |
|
I think I've added a check in validate for writing to only one field (I think). |
Codecov Report❌ Patch coverage is
❌ Your project check has failed because you have indirect coverage changes. Learn more about Unexpected Coverage Changes and reasons for indirect coverage changes. Additional details and impacted files@@ Coverage Diff @@
## master #3595 +/- ##
===========================================
- Coverage 100.00% 99.96% -0.04%
===========================================
Files 399 403 +4
Lines 56467 56905 +438
===========================================
+ Hits 56467 56887 +420
- Misses 0 18 +18 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Initial implementation for the new lfric loop fuse trans setup.
There are still for sure some things to sort out but it seems to work for our tests and solves ANY_SPACE things.
I'd like to have an investigate of being able to fuse more than 2 LFRicLoops, provided they all meet some criteria (i.e. some_space is provided, they're all on the same field etc., or that they all have the same space at runtime) but I'd need to know if that is useful @christophermaynard @MetBenjaminWent ? Its probably a more substantial implementation but I think its possible.