Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Assertion failure on Auto-Scheduling #2426

Open
DerZc opened this issue Jul 18, 2023 · 2 comments
Open

Assertion failure on Auto-Scheduling #2426

DerZc opened this issue Jul 18, 2023 · 2 comments
Labels
bug - identified Bugs with an identified cause

Comments

@DerZc
Copy link

DerZc commented Jul 18, 2023

The following program triggers an assertion failure:

.decl A(x:float)
.decl B(x: unsigned)
.decl res(a:float)
.output res 

A(-1).
B(1).

res(a) :- B(x), A(a).

This is the command:

souffle test.dl -p profile --emit-statistics
souffle -c test.dl --auto-schedule=profile -o binary

The second command triggers the assertion failure:

souffle: /tmp/souffle/src/ast2ram/utility/SipsMetric.cpp:134: virtual std::vector<long unsigned int> souffle::ast::SelingerProfileSipsMetric::getReordering(const souffle::ast::Clause*, const std::vector<std::__cxx11::basic_string<char> >&) const: Assertion `profileUseAnalysis->hasAutoSchedulerStats() && "Must have stats in order to auto-schedule!"' failed.
Aborted

If I remove the B(x) in the rule, then there is no assertion failure, but still get the message failed to execute binary.
The souffle version is 0ad4109

@fangyi-zhou
Copy link
Contributor

I've attempted to fix the auto-scheduler in #2421. There has been a few commits refactoring the auto-scheduler and the refactoring is likely the cause of these errors. If you need to use the auto-scheduler, the easiest way is to revert the refactoring commits manually.

@quentin quentin added the bug - identified Bugs with an identified cause label Dec 16, 2023
@strRM
Copy link
Contributor

strRM commented Nov 13, 2024

Although some fixes have gone into the auto-scheduler and they fix one of our problems, the example above still triggers an error with the latest master 73edcf3. It also fails on 2.3, where I think this was all introduced.

The problem executing the binary is probably because he doesn't have . in his path. Using ./binary works for me (maybe that should be a separate issue?).

strRM added a commit to strRM/souffle that referenced this issue Nov 13, 2024
There is a bug souffle-lang#2426, which causes an assertion in the
SelingerProfileSipsMetric::getReordering. There is no need to assert,
since we can handle the problem gracefully by not reordering atoms.
strRM added a commit to strRM/souffle that referenced this issue Nov 13, 2024
There is a bug souffle-lang#2426, which causes an assertion in the
SelingerProfileSipsMetric::getReordering.
In our use case we cannot fail the compilation, if as long as
the datalog is valid. So, rather than fixing the problem I
decided to work-around it for the time being, until we have a
proper fix.

We can work around this problem in one of two ways:
1. don't assert and just don't reorder atoms (this should be fine)
2. don't create the metric in the first place, if there is no profile

I decided to use souffle-lang#2 as that seems to be the safer option. A warning
is printed if the scheduler cannot be used.
strRM added a commit to strRM/souffle that referenced this issue Nov 13, 2024
There is a bug souffle-lang#2426, which causes an assertion in the
SelingerProfileSipsMetric::getReordering.
In our use case we cannot fail the compilation, if as long as
the datalog is valid. So, rather than fixing the problem I
decided to work-around it for the time being, until we have a
proper fix.

We can work around this problem in one of two ways:
1. don't assert and just don't reorder atoms (this should be fine)
2. don't create the metric in the first place, if there is no profile

I decided to use souffle-lang#2 as that seems to be the safer option. A warning
is printed if the scheduler cannot be used.
strRM added a commit to strRM/souffle that referenced this issue Nov 13, 2024
There is a bug souffle-lang#2426, which causes an assertion in the
SelingerProfileSipsMetric::getReordering.

Rther than fixing the problem I decided to work-around it for
the time being, until we have a proper fix.

We can work around this problem in one of two ways:
1. don't assert and just don't reorder atoms (this should be fine)
2. don't create the metric in the first place, if there is no profile

I decided to use souffle-lang#2 as that seems to be the safer option.

I added code for a warning, but disabled it because it is incompatible
with the ctest suite.
@strRM strRM mentioned this issue Nov 13, 2024
strRM added a commit to strRM/souffle that referenced this issue Nov 13, 2024
There is a bug souffle-lang#2426, which causes an assertion in the
SelingerProfileSipsMetric::getReordering.

Rther than fixing the problem I decided to work-around it for
the time being, until we have a proper fix.

We can work around this problem in one of two ways:
1. don't assert and just don't reorder atoms (this should be fine)
2. don't create the metric in the first place, if there is no profile

I decided to use souffle-lang#2 as that seems to be the safer option.

I added code for a warning, but disabled it because it is incompatible
with the ctest suite.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug - identified Bugs with an identified cause
Projects
None yet
Development

No branches or pull requests

4 participants