spcl / dace

DaCe - Data Centric Parallel Programming

Home Page:http://dace.is/fast

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

v0.15 regression: missing type in code generation.

FlorianDeconinck opened this issue · comments

A weird one.

At code generation a type is missing, leading to bad codegen.

In the SDFG we have:

                      "label": "uc_contra_corners_computation_139685237967312_Tasklet",
                      "attributes": {
                        "code": {
                          "string_data": "damp_gen_0: dace.float32\ndamp_gen_0 = (dace.float32(1.0) / (dace.float32(1.0) - ((dace.float32(0.0625) * cosa_u__) * cosa_v__im1)))\n__uc_contra = ((uc__ - ((dace.float32(0.25) * cosa_u__) * ((((vc_contra__im1_jp1 + vc_contra__jp1) + vc_contra__) + vc__im1) - ((dace.float32(0.25) * cosa_v__im1) * ((uc_contra_copy__im1 + uc_contra_copy__im1_jm1) + uc_contra_copy__jm1))))) * damp_gen_0)",
                          "language": "Python"
                        },

But when code gets generated...

///////////////////
// Tasklet code (uc_contra_corners_computation_139685237967312_Tasklet)
damp_gen_0;
[...]

instead of the expected dace::float32 damp_gen_0; which is present in some of the kernels!

Linked the SDFG pace_full_model_bad_type.sdfgz (put a fake ZIP extension so github leaves me alone, but it's a SDFGZ). Unfortunately this the SDFG of the entire dynamical core, a fairly large piece of code, since I can't get the bug on smaller code.

Fixed in #1465. There was a shift in how the CUDA code generator is called (to allow block specialization) that skipped clearing the local variable names. That clearing was now moved into generate_tasklet so it is never skipped. Verified fix with uploaded SDFG(Z).