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

Feature/move gt4py utils to pace dsl #50

Merged
merged 9 commits into from
Dec 10, 2021
Merged

Conversation

elynnwu
Copy link
Collaborator

@elynnwu elynnwu commented Dec 7, 2021

In this PR, a top level dsl folder is created. The eventual goal is to have all gt4py calls go through pace.dsl, and there're no direct import of gt4py inside dycore or physics.

Changes:

  • move fv3core.utils.future_stencil to pace.dsl.future_stencil
  • move fv3core.utils.gt4py_utils to pace.dsl.gt4py_utils
  • move fv3core.utils.stencil to pace.dsl.stencil
  • move fv3core.utils.typing to pace.dsl.typing

@elynnwu elynnwu changed the title Feature/move gt4py pace dsl Feature/move gt4py utils to pace dsl Dec 7, 2021
Copy link
Contributor

@rheacangeo rheacangeo left a comment

Choose a reason for hiding this comment

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

Wow massive PR! What a nice shift. I just have a couple of small comments, but looks pretty good to go

Comment on lines 119 to 123
data = _make_storage_data_1d(data, shape, start, dummy, axis, read_only)
data = _make_storage_data_1d(
data, shape, backend, start, dummy, axis, read_only
)
elif n_dims == 2:
data = _make_storage_data_2d(data, shape, start, dummy, axis, read_only)
data = _make_storage_data_2d(
data, shape, backend, start, dummy, axis, read_only
)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is slightly different from Jeremy's PR (backend is now set as a keyword argument). you might want to merge feature/fv3core_infra_tests into your branch (or wait until his is merged into main and update to main). could even modify this PR to compare against his branch until it is merged so that the differences you are introducing stand out

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for pointing this out! Will wait to merge from that PR

Comment on lines 11 to 12
from fv3core.utils.stencil import FrozenStencil, StencilFactory
from fv3core.utils.typing import Index3D
from pace.dsl.stencil import FrozenStencil, StencilFactory
from pace.dsl.typing import Index3D
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm open to this being a different PR< but we might want to delete this file. state_inputs and get_namespace are no longer used, and get_stencils_with_varied_bounds probably makes sense to get moved in this PR to the pace.dsl space? It could be a feature that physics uses (or not, there are usually other workarounds)

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, will move get_stencils_with_varied_bounds to pace.dsl in this PR. In light of Christmas cleaning, I'll also delete the decorators file with state_inputs and get_namespace.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay, we found that fvsubgridz still uses argspec. Will clean that out in a different PR.

Comment on lines -51 to +53
pad_field_in_j(value, self.grid.njd)
pad_field_in_j(
value, self.grid.njd, backend=self.grid.stencil_factory.backend
)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think jeremy's PR altered the test code to not use global backend in the tests (and device_sync), so this is a step further!

Copy link
Contributor

@rheacangeo rheacangeo left a comment

Choose a reason for hiding this comment

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

Once the tests pass looks ready to merge

@elynnwu
Copy link
Collaborator Author

elynnwu commented Dec 8, 2021

launch jenkins

3 similar comments
@rheacangeo
Copy link
Contributor

launch jenkins

@rheacangeo
Copy link
Contributor

launch jenkins

@elynnwu
Copy link
Collaborator Author

elynnwu commented Dec 9, 2021

launch jenkins

@elynnwu elynnwu enabled auto-merge (squash) December 9, 2021 17:32
@elynnwu
Copy link
Collaborator Author

elynnwu commented Dec 9, 2021

launch jenkins

1 similar comment
@rheacangeo
Copy link
Contributor

launch jenkins

@elynnwu elynnwu merged commit 3ebbdd5 into main Dec 10, 2021
@elynnwu elynnwu deleted the feature/move-gt4py-pace-dsl branch December 10, 2021 00:02
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.

2 participants