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

Error: SymbolRef of Dimension not found in offset provider #1387

Open
jeffzwe opened this issue Dec 5, 2023 · 0 comments
Open

Error: SymbolRef of Dimension not found in offset provider #1387

jeffzwe opened this issue Dec 5, 2023 · 0 comments

Comments

@jeffzwe
Copy link

jeffzwe commented Dec 5, 2023

Run configuration: Daint, gt4py version: 1.0.1

Description:

SymbolRef no found error for the offset_provider-entry 'Koff': K, where  K is a Dimension. 
The error does not occur when the field_operator contains the Dimension K in some way. 
For example if the return-type is Field[[Vertex, K], float_type] then the error does not occur.

Code:

@field_operator(backend=build_config.backend, grid_type=GridType.UNSTRUCTURED)
def initial_rho_test(
    mesh_xydeg_x: Field[[Vertex], float_type],
) -> Field[[Vertex], float_type]:
    return mesh_xydeg_x

out_test = as_field([Vertex], np.zeros(400))

initial_rho_test(
    mesh.xydeg_x,
    out=out_test,
    offset_provider=mesh.offset_provider,
)

Error:

Traceback (most recent call last):
  File "/users/zjeffrey/gt-gpu/gt4py/src/gt4py/next/otf/workflow.py", line 253, in __call__
    result = self._cache[hash_]
KeyError: 2189759977640088703

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/users/zjeffrey/gt-gpu/GridTools/../fvm_advection_sphere/tests/advection.py", line 115, in <module>
    initial_rho_test(
  File "/users/zjeffrey/gt-gpu/gt4py/src/gt4py/next/ffront/decorator.py", line 716, in __call__
    return self.as_program(arg_types, kwarg_types)(
  File "/users/zjeffrey/gt-gpu/gt4py/src/gt4py/next/ffront/decorator.py", line 306, in __call__
    self.backend(
  File "/users/zjeffrey/gt-gpu/gt4py/src/gt4py/next/program_processors/otf_compile_executor.py", line 54, in __call__
    self.otf_workflow(stages.ProgramCall(program, args, kwargs))(
  File "/users/zjeffrey/gt-gpu/gt4py/src/gt4py/next/otf/workflow.py", line 255, in __call__
    result = self._cache[hash_] = self.step(inp)
  File "/users/zjeffrey/gt-gpu/gt4py/src/gt4py/next/otf/workflow.py", line 144, in __call__
    step_result = getattr(self, step_name)(step_result)
  File "/users/zjeffrey/gt-gpu/gt4py/src/gt4py/next/program_processors/codegens/gtfn/gtfn_module.py", line 216, in __call__
    stencil_src = gtfn_backend.generate(
  File "/users/zjeffrey/gt-gpu/gt4py/src/gt4py/next/program_processors/codegens/gtfn/gtfn_backend.py", line 70, in generate
    gtfn_ir = _lower(
  File "/users/zjeffrey/gt-gpu/gt4py/src/gt4py/next/program_processors/codegens/gtfn/gtfn_backend.py", line 39, in _lower
    gtfn_ir = GTFN_lowering.apply(
  File "/users/zjeffrey/gt-gpu/gt4py/src/gt4py/next/program_processors/codegens/gtfn/itir_to_gtfn_ir.py", line 242, in apply
    ).visit(node)
  File "/users/zjeffrey/gt-gpu/gt4py/src/gt4py/eve/traits.py", line 169, in visit
    result = super().visit(node, **kwargs)
  File "/users/zjeffrey/gt-gpu/gt4py/src/gt4py/eve/visitors.py", line 122, in visit
    return visitor(node, **kwargs)
  File "/users/zjeffrey/gt-gpu/gt4py/src/gt4py/next/program_processors/codegens/gtfn/itir_to_gtfn_ir.py", line 549, in visit_FencilDefinition
    return FencilDefinition(
  File "<attrs generated init gt4py.next.program_processors.codegens.gtfn.gtfn_ir.FencilDefinition>", line 18, in __init__
  File "/users/zjeffrey/gt-gpu/gt4py/src/gt4py/eve/datamodels/core.py", line 943, in __attrs_post_init__
    validator.__get__(self)(self)
  File "/users/zjeffrey/gt-gpu/gt4py/src/gt4py/eve/traits.py", line 112, in _validate_symbol_refs
    raise exceptions.EveValueError(
gt4py.eve.exceptions.EveValueError: Symbols {SymbolRef('K')} not found.

Offset_provider:

{'V2V': <gt4py.next.iterator.embedded.NeighborTableOffsetProvider object at 0x15344e4ab310>, 
'V2E': <gt4py.next.iterator.embedded.NeighborTableOffsetProvider object at 0x1534893528c0>, 
'E2V': <gt4py.next.iterator.embedded.NeighborTableOffsetProvider object at 0x15344e4a92d0>, 
'Koff': Dimension(value='K', kind=<DimensionKind.VERTICAL: 'vertical'>)}
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

No branches or pull requests

1 participant