-
Notifications
You must be signed in to change notification settings - Fork 49
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
fix[cartesian]: Fix minimal k-range computation #1842
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.
I am confused. In my mental model, min_k_size
is the minimal height of the vertical column. Why do
def stencil_no_extent_1(field_a: gs.Field[float], field_b: gs.Field[float]):
with computation(PARALLEL), interval(0, 2):
field_a = field_b[0, 0, 0]
def stencil_no_extent_2(field_a: gs.Field[float], field_b: gs.Field[float]):
with computation(PARALLEL), interval(1, 2):
field_a = field_b[0, 0, 0]
both have a min_k_size
of 2? Both have the same upper bound of 2, but the second one starts at the first level. I'd thus expect 2 for the first one and 1 for the second one. This was already before your changes, so maybe I don't understand correctly. What's wrong with my thinking?
Sor for the second stencil to make sense, the domain in k need to have size 2. Otherwise the second interval would be empty. |
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.
Alright, I understand the meaning of min_k_size
now and this looks good from what I understand.
I don't understand the k_bounds
thingy to be honest, hence the question if the docstring was wrong to begin with. Anyways, since we don't have changes there I guess that's okay for now and I don't need to understand.
# vertical domain size >= 16 required for test_large_k_interval | ||
stencil(**args, origin=(10, 10, 5), domain=(3, 3, 16)) | ||
# vertical domain size > 16 required for test_large_k_interval | ||
stencil(**args, origin=(10, 10, 5), domain=(3, 3, 17)) |
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.
Suggestion: also change the comment in
gt4py/tests/cartesian_tests/integration_tests/multi_feature_tests/stencil_definitions.py
Line 298 in 4b566d7
with interval(6, -10): # this stage will only run if field has more than 16 elements |
I think it's technically still valid because this interval demands a size of 16 and the extra one comes from the interval(-10, None)
below. I just - I don't like the wording because - to me - "will only run" sounds more like it will be skipped rather than throwing an error.
This reverts commit 5615205.
all good from my side |
cscs-ci run |
cscs-ci run |
cscs-ci run |
Gitlab ci timed out on SLURM - re-launch |
Description
The computation of the minimal k-ranges that happen during the vaildate-args step is allowing for inconsistent computation to happen. This PR stiffens the requirements on fields:
[START+X ,END+y)
are now also considered:interval(3,-1)
requires a minimal size of 5 for the interval to not be emptyinterval(3,None)
now requires a minimal size of 4[START+X, START+Y)
and[END+X,END+Y)
are not affected.interval(...)
still requires no k-sizeRequirements