`progam.sdfg` Does Not Lead to Reproducibility
- Dominant language
- Python
- Stars
- 593
- Forks
- 163
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 60
Description
When DaCe generates the code for an SDFG it also creates the `program.sdfg` file which is the SDFG that was actually compiled.
This is not the SDFG on which `.compile()` was called, but one that further transformed (such as `CopyToMap` or the expansion of library node).
However, for some SDFG it was noticed that this does not lead to the same code (this only refers to the `.cu` file).
Consider the following:
```python
sdfg1 = make_sdfg()
sdfg1.name = "my_sdfg1"
csdfg1 = sdfg1.compile()
# Now load the SDFG from the folder
sdfg2 = dace.SDFG.from_file(".dacecache/my_sdfg1/program.sdfg")
sdfg2.name = "my_sdfg2"
csdfg2 = sdfg2.compile()
```
We would now expect that the two folders `.dacecache/my_sdfg1/src/cuda/` and `.dacecache/my_sdfg2/src/cuda/` contains the same code, beside the changes due to the renaming from `my_sdfg1` to `my_sdfg2`.
However, we currently have an SDFG for which this is not true.
The code, especially the order is significantly different for the two version, see attached files.
However, if we would now do the same with `sdfg2`, i.e. if we would construct `sdfg3 = dace.SDFG.from_file(".dacecache/my_sdfg2/program.sdfg")` then we would get a stable behaviour.
[sdfg_compile_instability.tar.gz](https://github.com/user-attachments/files/18908458/sdfg_compile_instability.tar.gz)
I am not 100% sure, but I am pretty sure that there is no relation to issue #1946
Contributor guide
Assessment
This issue has not been assessed yet.