Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SCC wrapper transformation #124

Merged
merged 3 commits into from
Aug 29, 2023
Merged

Remove SCC wrapper transformation #124

merged 3 commits into from
Aug 29, 2023

Conversation

mlange05
Copy link
Collaborator

This PR does pretty much what it says on the tin: Remove the old SCC wrapper transformation and instead use the component-wise composition in the ecphys entry point. In addition, it includes some slight cosmetics improvements and removes the redundant duplicated tests in the transformations sub-package.

I've tested this with the Cy48R1 ec-physics demonstrator and things are fine. Please note that I haven't enabled the vector-section trim or global var offloads yet, because I'm planning to consolidate this with the convert entry point soon, and possibly more these into the config file.

This also includes minor cosmetics in the entry point logic that
composes the trafos to be applied.
@github-actions
Copy link

Documentation for this branch can be viewed at https://sites.ecmwf.int/docs/loki/124/index.html

@codecov
Copy link

codecov bot commented Aug 11, 2023

Codecov Report

Merging #124 (340e452) into main (7507b06) will decrease coverage by 0.06%.
Report is 11 commits behind head on main.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #124      +/-   ##
==========================================
- Coverage   92.15%   92.10%   -0.06%     
==========================================
  Files          90       89       -1     
  Lines       16653    16540     -113     
==========================================
- Hits        15347    15234     -113     
  Misses       1306     1306              
Flag Coverage Δ
lint_rules 96.01% <ø> (+0.05%) ⬆️
loki 92.04% <ø> (-0.06%) ⬇️
transformations 91.65% <ø> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
transformations/transformations/__init__.py 85.71% <ø> (-0.96%) ⬇️

... and 7 files with indirect coverage changes

transformation = None
if mode == 'idem':
transformation = IdemTransformation()

if mode == 'sca':
# Define the target dimension to strip from kernel and caller
horizontal = scheduler.config.dimensions['horizontal']
transformation = ExtractSCATransformation(horizontal=horizontal)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not need to wrap this in a tuple? Same for the idem trafo above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I've added an as_tuple around the transformations in the application loop, which will have the same effect, but makes it a little safer.

Copy link
Collaborator

@reuterbal reuterbal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I agree with @awnawab's comment regarding wrapping in tupels for other transformation modes, currently this looks like it might break.

@@ -222,59 +222,6 @@ def test_scc_base_masked_statement(frontend, horizontal):
assert fgen(kernel_conds[0].else_body) == 'q(jl, jk) = t(jl, jk)'


@pytest.mark.parametrize('frontend', available_frontends())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure we're not loosing test coverage: The deleted tests were essentially redundant in the sense that they tested functionality with the wrapper that's already been checked on the invidividual relevant transformations?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I believe so. @awnawab might be better placed to confirm this, but I've glanced over them and they looked fairly identical still.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, all the tests with 'wrapper' in the name were essentially redundant.

Copy link
Contributor

@awnawab awnawab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the as_tuple, looks good to go 👍

@reuterbal reuterbal merged commit 4360075 into main Aug 29, 2023
12 checks passed
@reuterbal reuterbal deleted the naml-remove-scc-wrapper branch August 29, 2023 09:37
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.

3 participants