Open learning-chip opened 1 year ago
Thanks, can you please send a PR?
I haven't diagnosed the root cause of error, but simply skipped the cases that calls partialSparsification
in order to compile that example program. For example SpTrSv_LL_HDAGG
doesn't call sparsification so still runs, but SpTrSv_LL_Tree_HDAGG
breaks. However the inspection time of HDAGG
is many times slower than Tree_HDAGG
, presumably due to lack of sparsification.
One clue: The same SpTRSV_runtime.cpp example from the older repo https://github.com/BehroozZare/HDagg-benchmark (as of commit 948b38f
) runs fine without array-bound errors. So it must be due to some updates in between.
Got it, thanks. I think HDagg repo is more updated than this for the HDagg algorithm.
Hi @cheshmi I found the problem with this repo --
The find_package(OpenMP)
in the top-level cmake file is disabled:
This is probably fine when compiled as a subproject of Sympiler (where OpenMP is found one level higher); but when compiling this aggregation
repo as a standalone project, the ENABLE_OPENMP
macro and OpenMP flags won't get defined. Then, inside the HDAGG::partialSparsification
function:
Both bins
and tid
will be set to 1
, causing a bug when the user wants parallel partitioning.
Uncommenting find_package(OpenMP)
fixes the bug. Or maybe using the HAS_PARENT
condition to optionally include dependencies.
One the other hand, in the older HDagg-benchmark repo, there is no ENABLE_OPENMP
switch, and bins
is always set to omp_get_num_threads()
, so no such bug.
More unit tests for the HDagg procedure (sparsification, grouping, partitioning, ungrouping...) might help prevent future bugs? In the current Catch_tests there seems to be only one test for the simple levelset sptrsv, but not more advanced partitionings like LBC or HDagg. And the test is disabled in cmake file.
The current GitHub workflow runs lbc_demo
and sptrsv_demo
, but not Hdagg_SpTRSV
(the executable for SpTRSV_runtime.cpp
).
If you add lines like
cmake --build ${{github.workspace}}/build --target Hdagg_SpTRSV
${{github.workspace}}/build/example/Hdagg_SpTRSV`,
you should see the error message in GitHub actions.
OK I saw that find_package(OpenMP)
was disabled by the commit https://github.com/sympiler/aggregation/commit/5b8830961acdf173f48f69a080ceb64bd3f63278 , presumably to ensure compatibility with the parent Sympiler directory.
May using
if(LBC_IS_TOPLEVEL)
find_package(OpenMP)
endif()
to avoid duplication. Although I think duplicately calling find_package(OpenMP)
is also fine...
At the latest commit da104fa343672469f2000efa4285dccb32107370, and fixed #4, there is still run-time error for
examples/SpTRSV_runtime.cpp
. The error occurs during the call toHDAGG::partialSparsification
inexamples/SpTRSV_runtime.h
, in particular this assertion insidepartialSparsification
:https://github.com/sympiler/aggregation/blob/da104fa343672469f2000efa4285dccb32107370/src/hdagg/hdagg.cpp#L2083-L2086
Error messages
With debug build, the error message is:
The "LL Serial" and "LL Levelset" case work fine because they don't call
partialSparsification
. The "LL Tree + Levelset" and later cases fail atpartialSparsification
.With release build it leads to memory errors, likely due to exceeding array bounds:
The above are using the built-in random matrix generation. Using an external matrix like G2_circuit give a different error, but still memory-related.
Steps to reproduce
The system environment can be reproduced using this trivial Dockerfile that installs GCC 11.3 and CMake 3.22: