Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Internal error during partition loops #7851

Closed
TH3CHARLie opened this issue Sep 15, 2023 · 0 comments · Fixed by #7864
Closed

Internal error during partition loops #7851

TH3CHARLie opened this issue Sep 15, 2023 · 0 comments · Fixed by #7864
Assignees
Labels

Comments

@TH3CHARLie
Copy link
Contributor

A simple repro

    Func input("input");
    Func local_sum("local_sum");
    Func blurry("blurry");
    Var x("x"), y("y");
    input(x, y) = 2 * x + 5 * y;
    RDom r(-2, 5, -2, 5);
    local_sum(x, y) = 0;
    local_sum(x, y) += input(x + r.x, y + r.y);
    blurry(x, y) = cast<int32_t>(local_sum(x, y) / 25);
    Var yo("yo"), yi("yi"), xo("xo"), xi("xi"), yo_x_f("yo_x_f"), yo_x_fo("yo_x_fo"), yo_x_fi("yo_x_fi");
    blurry.split(y,yo, yi, 2, TailStrategy::RoundUp).fuse(yo, x, yo_x_f).vectorize(yi).split(yo_x_f, yo_x_fo, yo_x_fi, 2, TailStrategy::Predicate).reorder(yo_x_fo, yo_x_fi, yi);
    input.split(y, yo, yi, 2, TailStrategy::PredicateStores).fuse(yo, x, yo_x_f).vectorize(yi).split(yo_x_f, yo_x_fo, yo_x_fi, 2, TailStrategy::Predicate).reorder(yo_x_fo, yo_x_fi, yi);
    blurry.store_root();
    input.compute_at(blurry, yi);
    Pipeline p({blurry});
    Buffer<int> buf = p.realize({32, 32});

Triggers:

Internal Error at /home/xuanda/dev/Serializer/Halide/src/PartitionLoops.cpp:276 triggered by user code at : Condition failed: s.condition.type().is_scalar(): (ramp((((((input.s0.y.yo.yo_x_f.yo_x_fo*2) + input.s0.y.yo.yo_x_f.yo_x_fi) % ((blurry.extent.1 + 5)/2))*2) + blurry.min.1) + -4, 1, 2) <= x2((((blurry.extent.1 + -1)/2)*2) + blurry.min.1))
@abadams abadams added the bug label Sep 15, 2023
@abadams abadams self-assigned this Sep 15, 2023
abadams added a commit that referenced this issue Sep 25, 2023
In one place in PartitionLoops and in another place in the simplifier we
were neglecting to consider nested vectorization.

I added the fuzzer output as a new test, because I have no idea how I'd
generate this error with human-readable code. It stems from an
interaction of several tail strategies.
abadams added a commit that referenced this issue Sep 25, 2023
Fix #7851

In one place in PartitionLoops and in another place in the simplifier we
were neglecting to consider nested vectorization.

I added the fuzzer output as a new test, because I have no idea how I'd
generate this error with human-readable code. It stems from an
interaction of several tail strategies.
ardier pushed a commit to ardier/Halide-mutation that referenced this issue Mar 3, 2024
Fix halide#7851

In one place in PartitionLoops and in another place in the simplifier we
were neglecting to consider nested vectorization.

I added the fuzzer output as a new test, because I have no idea how I'd
generate this error with human-readable code. It stems from an
interaction of several tail strategies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants