-
Notifications
You must be signed in to change notification settings - Fork 13
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
Conversation
There was a problem hiding this 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
dsl/pace/dsl/gt4py_utils.py
Outdated
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 | ||
) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
fv3core/fv3core/decorators.py
Outdated
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 |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
pad_field_in_j(value, self.grid.njd) | ||
pad_field_in_j( | ||
value, self.grid.njd, backend=self.grid.stencil_factory.backend | ||
) |
There was a problem hiding this comment.
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!
There was a problem hiding this 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
launch jenkins |
3 similar comments
launch jenkins |
launch jenkins |
launch jenkins |
launch jenkins |
1 similar comment
launch jenkins |
In this PR, a top level
dsl
folder is created. The eventual goal is to have allgt4py
calls go throughpace.dsl
, and there're no direct import ofgt4py
inside dycore or physics.Changes:
fv3core.utils.future_stencil
topace.dsl.future_stencil
fv3core.utils.gt4py_utils
topace.dsl.gt4py_utils
fv3core.utils.stencil
topace.dsl.stencil
fv3core.utils.typing
topace.dsl.typing