spcl / spcl/dace

[f2dace] Simple semi-structured benchmark failing on f2dace but not in main

Open
#1,999 0 comments 0 reactions 1 assignee Claimed by @acalotoiu View on GitHub
fortran
Dominant language
Python
Stars
593
Forks
163
Avg merge
2d 23h
Merged PRs (30d)
60

Description

The title explains the issue.

Semi-structured stencil SDFG obtained from Python frontend compiles and runs fine on main (also used for my Layout paper). Crashes in a transformation in `f2dace/dev`.

Tested commit hashes: for `main`: `d8b0347725204341c656c9be72d5221b736aa4af`
for `f2dace/dev`: `8abc38060233d56a52ffa8e79c1ddeb8022f0f1d` (also had the same error around in April 10)

The reproduce run the command: `python unstructured_stencil_3d_u_s_u_v2.py 128 128 128` on both branches. The file is attached with the same name (+.txt, remove .txt suffix).
There is a lot of boilerplate code but the SDFGs that are compiled and ran are saved by the script you can check that.

The error is about passing the wrong subset/ dereferencing.

Error output:
```
Traceback (most recent call last):
File "/home/primrose/Work/dace/dace/codegen/compiler.py", line 245, in configure_and_compile
_run_liveoutput("cmake --build . --config %s" % (Config.get('compiler', 'build_type')),
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
shell=True,
^^^^^^^^^^^
cwd=build_folder,
^^^^^^^^^^^^^^^^^
output_stream=output_stream)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/primrose/Work/dace/dace/codegen/compiler.py", line 429, in _run_liveoutput
raise subprocess.CalledProcessError(process.returncode, command, output.getvalue())
subprocess.CalledProcessError: Command 'cmake --build . --config RelWithDebInfo' returned non-zero exit status 2.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/primrose/Work/LayoutArtifacts/SemiStructuredStencil/unstructured_stencil_3d_u_s_u_v2.py", line 323, in
sdfg(vals_A=vals_A2, vals_B=vals_B2, neighbors=neighbors, N=_N, TSTEPS=_TSTEPS)
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/primrose/Work/dace/dace/sdfg/sdfg.py", line 2544, in __call__
binaryobj = sdfg.compile()
File "/home/primrose/Work/dace/dace/sdfg/sdfg.py", line 2468, in compile
shared_library = compiler.configure_and_compile(program_folder, sdfg.name)
File "/home/primrose/Work/dace/dace/codegen/compiler.py", line 254, in configure_and_compile
raise cgx.CompilationError('Compiler failure:\n' + ex.output)
dace.codegen.exceptions.CompilationError: Compiler failure:
[ 25%] Building CXX object CMakeFiles/kernel.dir/home/primrose/Work/LayoutArtifacts/SemiStructuredStencil/.dacecache/kernel_8d9efdc11d3f363405846f3c09c5567f/src/cpu/kernel.cpp.o
In file included from /home/primrose/Work/dace/dace/codegen/../runtime/include/dace/dace.h:14,
from /home/primrose/Work/LayoutArtifacts/SemiStructuredStencil/.dacecache/kernel_8d9efdc11d3f363405846f3c09c5567f/src/cpu/kernel.cpp:2:
/home/primrose/Work/dace/dace/codegen/../runtime/include/dace/types.h: In constructor ‘dace::half::half(float)’:
/home/primrose/Work/dace/dace/codegen/../runtime/include/dace/types.h:101:28: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
101 | uint32_t x = *((uint32_t*)&f);
| ~^~~~~~~~~~~~~~
/home/primrose/Work/LayoutArtifacts/SemiStructuredStencil/.dacecache/kernel_8d9efdc11d3f363405846f3c09c5567f/src/cpu/kernel.cpp: In function ‘void kernel_21_8_1_0_2(kernel_state_t*, double, double, double, double*, int64_t, int64_t, double*, int64_t, int64_t, double*, int64_t, int64_t, double*, int64_t, int64_t, double, int64_t, int64_t)’:
/home/primrose/Work/LayoutArtifacts/SemiStructuredStencil/.dacecache/kernel_8d9efdc11d3f363405846f3c09c5567f/src/cpu/kernel.cpp:17:487: warning: parameter ‘__tmp_22_12_w’ set but not used [-Wunused-but-set-parameter]
17 | inline void kernel_21_8_1_0_2(kernel_state_t *__state, const double __tmp_23_16_r, const double __tmp_24_18_r, const double __tmp_25_18_r, double* __tmp_26_18_r, const int64_t __tmp_26_25_r, const int64_t __tmp_26_56_r, double* __tmp_27_18_r, const int64_t __tmp_27_25_r, const int64_t __tmp_27_56_r, double* __tmp_28_18_r, const int64_t __tmp_28_25_r, const int64_t __tmp_28_56_r, double* __tmp_29_18_r, const int64_t __tmp_29_25_r, const int64_t __tmp_29_56_r, double __tmp_22_12_w, int64_t N, int64_t j) {
| ~~~~~~~~^~~~~~~~~~~~~
/home/primrose/Work/LayoutArtifacts/SemiStructuredStencil/.dacecache/kernel_8d9efdc11d3f363405846f3c09c5567f/src/cpu/kernel.cpp: In function ‘void kernel_31_8_1_0_8(kernel_state_t*, double, double, double, double*, int64_t, int64_t, double*, int64_t, int64_t, double*, int64_t, int64_t, double*, int64_t, int64_t, double, int64_t, int64_t)’:
/home/primrose/Work/LayoutArtifacts/SemiStructuredStencil/.dacecache/kernel_8d9efdc11d3f363405846f3c09c5567f/src/cpu/kernel.cpp:150:487: warning: parameter ‘__tmp_32_12_w’ set but not used [-Wunused-but-set-parameter]
150 | inline void kernel_31_8_1_0_8(kernel_state_t *__state, const double __tmp_33_16_r, const double __tmp_34_18_r, const double __tmp_35_18_r, double* __tmp_36_18_r, const int64_t __tmp_36_25_r, const int64_t __tmp_36_56_r, double* __tmp_37_18_r, const int64_t __tmp_37_25_r, const int64_t __tmp_37_56_r, double* __tmp_38_18_r, const int64_t __tmp_38_25_r, const int64_t __tmp_38_56_r, double* __tmp_39_18_r, const int64_t __tmp_39_25_r, const int64_t __tmp_39_56_r, double __tmp_32_12_w, int64_t N, int64_t j) {
| ~~~~~~~~^~~~~~~~~~~~~
/home/primrose/Work/LayoutArtifacts/SemiStructuredStencil/.dacecache/kernel_8d9efdc11d3f363405846f3c09c5567f/src/cpu/kernel.cpp: In function ‘void __program_kernel_internal(kernel_state_t*, int64_t*, double*, double*, int64_t, int64_t)’:
/home/primrose/Work/LayoutArtifacts/SemiStructuredStencil/.dacecache/kernel_8d9efdc11d3f363405846f3c09c5567f/src/cpu/kernel.cpp:298:56: error: cannot convert ‘double* __restrict__’ to ‘double’
298 | kernel_21_8_1_0_2(__state, vals_A, vals_A, vals_A, &vals_A[0], neighbors, neighbors, &vals_A[0], neighbors, neighbors, &vals_A[0], neighbors, neighbors, &vals_A[0], neighbors, neighbors, vals_B[(((((N * N) * (i + 1)) + (N * (j + 1))) + k) + 1)], N, j);
| ^~~~~~
| |
| double* __restrict__
/home/primrose/Work/LayoutArtifacts/SemiStructuredStencil/.dacecache/kernel_8d9efdc11d3f363405846f3c09c5567f/src/cpu/kernel.cpp:17:70: note: initializing argument 2 of ‘void kernel_21_8_1_0_2(kernel_state_t*, double, double, double, double*, int64_t, int64_t, double*, int64_t, int64_t, double*, int64_t, int64_t, double*, int64_t, int64_t, double, int64_t, int64_t)’
17 | inline void kernel_21_8_1_0_2(kernel_state_t *__state, const double __tmp_23_16_r, const double __tmp_24_18_r, const double __tmp_25_18_r, double* __tmp_26_18_r, const int64_t __tmp_26_25_r, const int64_t __tmp_26_56_r, double* __tmp_27_18_r, const int64_t __tmp_27_25_r, const int64_t __tmp_27_56_r, double* __tmp_28_18_r, const int64_t __tmp_28_25_r, const int64_t __tmp_28_56_r, double* __tmp_29_18_r, const int64_t __tmp_29_25_r, const int64_t __tmp_29_56_r, double __tmp_22_12_w, int64_t N, int64_t j) {
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/primrose/Work/LayoutArtifacts/SemiStructuredStencil/.dacecache/kernel_8d9efdc11d3f363405846f3c09c5567f/src/cpu/kernel.cpp:313:56: error: cannot convert ‘double* __restrict__’ to ‘double’
313 | kernel_31_8_1_0_8(__state, vals_B, vals_B, vals_B, &vals_B[0], neighbors, neighbors, &vals_B[0], neighbors, neighbors, &vals_B[0], neighbors, neighbors, &vals_B[0], neighbors, neighbors, vals_A[(((((N * N) * (i + 1)) + (N * (j + 1))) + k) + 1)], N, j);
| ^~~~~~
| |
| double* __restrict__
/home/primrose/Work/LayoutArtifacts/SemiStructuredStencil/.dacecache/kernel_8d9efdc11d3f363405846f3c09c5567f/src/cpu/kernel.cpp:150:70: note: initializing argument 2 of ‘void kernel_31_8_1_0_8(kernel_state_t*, double, double, double, double*, int64_t, int64_t, double*, int64_t, int64_t, double*, int64_t, int64_t, double*, int64_t, int64_t, double, int64_t, int64_t)’
150 | inline void kernel_31_8_1_0_8(kernel_state_t *__state, const double __tmp_33_16_r, const double __tmp_34_18_r, const double __tmp_35_18_r, double* __tmp_36_18_r, const int64_t __tmp_36_25_r, const int64_t __tmp_36_56_r, double* __tmp_37_18_r, const int64_t __tmp_37_25_r, const int64_t __tmp_37_56_r, double* __tmp_38_18_r, const int64_t __tmp_38_25_r, const int64_t __tmp_38_56_r, double* __tmp_39_18_r, const int64_t __tmp_39_25_r, const int64_t __tmp_39_56_r, double __tmp_32_12_w, int64_t N, int64_t j) {
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~
gmake[2]: *** [CMakeFiles/kernel.dir/build.make:76: CMakeFiles/kernel.dir/home/primrose/Work/LayoutArtifacts/SemiStructuredStencil/.dacecache/kernel_8d9efdc11d3f363405846f3c09c5567f/src/cpu/kernel.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/kernel.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
```

[unstructured_stencil_3d_u_s_u_v2.py.txt](https://github.com/user-attachments/files/20055244/unstructured_stencil_3d_u_s_u_v2.py.txt)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.