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

gt4py dependency analysis thinks parameters are written when used as data indices #1007

Closed
jdahm opened this issue Oct 24, 2022 · 0 comments · Fixed by #979
Closed

gt4py dependency analysis thinks parameters are written when used as data indices #1007

jdahm opened this issue Oct 24, 2022 · 0 comments · Fixed by #979
Assignees
Labels
gt4py.cartesian Issues concerning the current version with support only for cartesian grids. module: analysis triage: bug Something isn't working

Comments

@jdahm
Copy link
Contributor

jdahm commented Oct 24, 2022

This newly added test currently fails:

    @pytest.mark.parametrize("backend", ALL_BACKENDS)
    def test_write_data_dim_indirect_addressing(backend):
        INT32_VEC2 = (np.int32, (2,))
    
        def stencil(
            input_field: gtscript.Field[gtscript.IJK, np.int32],
            output_field: gtscript.Field[gtscript.IJK, INT32_VEC2],
            index: int,
        ):
            with computation(PARALLEL), interval(...):
                output_field[0, 0, 0][index] = input_field
    
        aligned_index = (0, 0, 0)
        full_shape = (1, 1, 2)
        input_field = gt_storage.ones(
            full_shape, backend=backend, aligned_index=aligned_index, dtype=np.int32
        )
        output_field = gt_storage.zeros(
            full_shape, backend=backend, aligned_index=aligned_index, dtype=INT32_VEC2
        )
    
>       gtscript.stencil(definition=stencil, backend=backend)(input_field, output_field, index := 1)
@jdahm jdahm self-assigned this Oct 24, 2022
@jdahm jdahm added this to the v1.0 / Christmas Cleanup 2022 milestone Oct 24, 2022
@jdahm jdahm added triage: bug Something isn't working module: analysis gt4py.cartesian Issues concerning the current version with support only for cartesian grids. labels Oct 25, 2022
jdahm added a commit that referenced this issue Oct 26, 2022
Major changes:

- Adds type checking on a few more files.
- Expr.dtype's type is no longer Optional[DataType], because that caused type havoc. Therefore, the default is changed from None to DataType.AUTO when not set explicitly. The gtir_dtype_resolver and other visitors are updated to check for DataType.AUTO instead of None.
- Moves most of the code that was in eve.iterators to eve.concepts to work around a circular dependency after solving ClassVar parameters cannot include any type variables #565 using @egparedes's suggestion. This is a temporary workaround until we replace Eve with the new version.
- gt4py.stencil_object.ArgsInfo is made non-private and used in gt4py.dace_stencil_object to fix a type issue.
- Ignores typing in eve visitor contexts -- need to fix that in a follow-up PR.
- npir.HorizontalMask is created as a tuple of tuples, to avoid the Optional[AxisBound] in the common.HorizontalInterval type.
- Replaces gt_backend references with gt4py.backend.

Follows #978.

Resolves #565.
Resolves #992.
Resolves #1007.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gt4py.cartesian Issues concerning the current version with support only for cartesian grids. module: analysis triage: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant