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 in Extracting Kernels #4

Open
ThrudPrimrose opened this issue Oct 9, 2024 · 3 comments
Open

Error in Extracting Kernels #4

ThrudPrimrose opened this issue Oct 9, 2024 · 3 comments
Assignees

Comments

@ThrudPrimrose
Copy link
Owner

Describe the bug
I cant extract many kernels of velocity tendencies because of the following error:
I use the following function to cut out kernels, where I call the following function for every GPU_Device scheduled map.

def _copy_sub_scope(state: dace.sdfg.SDFGState, scope_entry: dace.nodes.MapEntry):
    nn = []
    for n in state.bfs_nodes(scope_entry):
        if n == state.exit_node(scope_entry):
            break
        nn.append(n)

    cut_sdfg = SDFGCutout.singlestate_cutout(state, *nn)
    return cut_sdfg

The error I get is:
Extract kernel: T_l2716_c2728_gmap[T_l2716_c2728__gmapi=0] ( T_l2716_c2728_gmap[T_l2716_c2728__gmapi=0] )
Error in extracting and profiling kernel: T_l2716_c2728_gmap[T_l2716_c2728__gmapi=0] ( T_l2716_c2728_gmap[T_l2716_c2728__gmapi=0] )
Error: 'NestedDict does not support setting nested keys'

Could it be related to structs? I am going to create a better minimally reproducible example with one of the kernels that fail and provide more details.

@ThrudPrimrose
Copy link
Owner Author

ThrudPrimrose commented Oct 9, 2024

The detailed error message:

Extract kernel:  T_l224_c228_gmap[T_l224_c228__gmapi=0] ( T_l224_c228_gmap[T_l224_c228__gmapi=0] )
Traceback (most recent call last):
  File "/home/primrose/Work/IconGrounds/auto_profile.py", line 11, in <module>
    profile_results = auto_profile.auto_profile(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/primrose/Work/forkdace/dace/transformation/auto_tile/auto_profile.py", line 59, in auto_profile
    kernel_sdfg = auto_tile_util._copy_sub_scope(state, node)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/primrose/Work/forkdace/dace/transformation/auto_tile/auto_tile_util.py", line 23, in _copy_sub_scope
    cut_sdfg = SDFGCutout.singlestate_cutout(state, *nn)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/primrose/Work/forkdace/dace/sdfg/analysis/cutout.py", line 217, in singlestate_cutout
    cutout.add_datadesc(memlet.data, new_desc)
  File "/home/primrose/Work/forkdace/dace/sdfg/sdfg.py", line 2014, in add_datadesc
    self._arrays[name] = datadesc
    ~~~~~~~~~~~~^^^^^^
  File "/home/primrose/Work/forkdace/dace/sdfg/sdfg.py", line 63, in __setitem__
    raise KeyError('NestedDict does not support setting nested keys')
KeyError: 'NestedDict does not support setting nested keys'

In the viewer all of the direct inputs (views, light blue) have float64 datatype.
gpu_p_init and gpu_p_prog are pointers.

The kernel looks like this:
image

@ThrudPrimrose
Copy link
Owner Author

I add the SDFG and the reproducer (change the path accordingly):

import dace
from dace.sdfg.analysis.cutout import SDFGCutout

sdfg = dace.SDFG.from_file("/home/primrose/Work/IconGrounds/velocity_tendencies_simplified_f.sdfgz")

for state in sdfg.states():
    if state._label == "_state_l502_c502_1":
        cut_sdfg = SDFGCutout.singlestate_cutout(state, *state.nodes())
        cut_sdfg.save("cut_3.sdfgz")

Uploading velocity_tendencies_simplified_f.sdfgz.json…

@phschaad
Copy link
Collaborator

This is addressed in spcl#1662

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

2 participants