Skip to content

rfactored split rvars have qualified names #8557

@alexreinking

Description

@alexreinking

The following pipeline causes an error when passed to the Anderson2021 autoscheduler:

        if (true) {
            ImageParam im(Float(32), 2);

            Func max_fn{"max_fn"}, sum_fn{"sum_fn"}, output{"output"};
            Var u{"u"};
            RDom r(0, 8192);
            RVar ri{"ri"};

            max_fn(y) = Float(32).min();
            max_fn(y) = max(max_fn(y), im(r, y));

            sum_fn(y) += Halide::exp(im(r, y) - max_fn(y));
            sum_fn.update(0).split(r, r, ri, 8);
            sum_fn.update(0).rfactor(r, u);

            output(x, y) = sum_fn(x);

            output.set_estimates({{0, 8192}, {0, 32768}});

            Pipeline(output).apply_autoscheduler(target, params);
        }

This is in the context of test/autoschedulers/anderson2021/test.cpp. The error happens during schedule application / serialization. The factored RVar has the name r6$x.r6$x which is passed to var_name_match via dim_match. This produces the error:

Unhandled exception: Internal Error at /home/alex/Development/halide/src/Func.cpp:324 Condition failed: var.find('.') == string::npos: var_name_match expects unqualified names for the second argument. Name passed: r6$x.r6$x

I'm not sure if this is a bug with rfactor or with Anderson2021. Maybe @abadams can weigh in on this point? I didn't see the old rfactor implementation do anything to de-qualify the names.

Metadata

Metadata

Assignees

Labels

dev_meetingTopic to be discussed at the next dev meeting

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions