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

anderson2021_test_apps_autoscheduler fails with Error: Can't treat this multidimensional RDom as an Expr #7729

Closed
steven-johnson opened this issue Jul 31, 2023 · 6 comments
Assignees

Comments

@steven-johnson
Copy link
Contributor

At current top-of-tree (9f43580), anyway -- not sure how far back it goes, I will check

@steven-johnson
Copy link
Contributor Author

steven-johnson commented Jul 31, 2023

More detail: the first overflow is in this clause of the test:

    // A separable downsample that models the start of local_laplacian
    if (true) {
        Buffer<float> in(2048, 2048);
        Var k;
        Func orig("orig"), expensive("expensive"), downy("downy"), downx("downx");
        Expr e = 0;
        for (int i = 0; i < 100; i++) {
            e += 1;
            e *= e;
        }
        orig(x, y) = e;
        expensive(x, y, k) = orig(x, y) * orig(x, y) + (x + orig(x, y)) * (1 + orig(x, y)) + sqrt(k + orig(x, y));
        downy(x, y, k) = expensive(x, 2 * y - 1, k) + expensive(x, 2 * y, k) + expensive(x, 2 * y + 1, k) + expensive(x, 2 * y + 2, k);
        downx(x, y, k) = downy(2 * x - 1, y, k) + downy(2 * x, y, k) + downy(2 * x + 1, y, k) + downy(2 * x + 2, y, k);
        downx.set_estimate(x, 1, 1022).set_estimate(y, 1, 1022).set_estimate(k, 0, 256);

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

and happens in compute_function_value_bounds() where we try to simplify this Expr that is a lower bound:

(let t0.min = ((0 + 1)*(0 + 1)) in (let t1.min = ((t0.min + 1)*(t0.min + 1)) in (let t2.min = ((t1.min + 1)*(t1.min + 1)) in (let t3.min = ((t2.min + 1)*(t2.min + 1)) in (let t4.min = ((t3.min + 1)*(t3.min + 1)) in (let t5.min = ((t4.min + 1)*(t4.min + 1)) in (let t6.min = ((t5.min + 1)*(t5.min + 1)) in (let t7.min = ((t6.min + 1)*(t6.min + 1)) in (let t8.min = ((t7.min + 1)*(t7.min + 1)) in (let t9.min = ((t8.min + 1)*(t8.min + 1)) in (let t10.min = ((t9.min + 1)*(t9.min + 1)) in (let t11.min = ((t10.min + 1)*(t10.min + 1)) in (let t12.min = ((t11.min + 1)*(t11.min + 1)) in (let t13.min = ((t12.min + 1)*(t12.min + 1)) in (let t14.min = ((t13.min + 1)*(t13.min + 1)) in (let t15.min = ((t14.min + 1)*(t14.min + 1)) in (let t16.min$1 = ((t15.min + 1)*(t15.min + 1)) in (let t17.min = ((t16.min$1 + 1)*(t16.min$1 + 1)) in (let t18.min = ((t17.min + 1)*(t17.min + 1)) in (let t19.min = ((t18.min + 1)*(t18.min + 1)) in (let t20.min = ((t19.min + 1)*(t19.min + 1)) in (let t21.min = ((t20.min + 1)*(t20.min + 1)) in (let t22.min = ((t21.min + 1)*(t21.min + 1)) in (let t23.min = ((t22.min + 1)*(t22.min + 1)) in (let t24.min = ((t23.min + 1)*(t23.min + 1)) in (let t25.min = ((t24.min + 1)*(t24.min + 1)) in (let t26.min = ((t25.min + 1)*(t25.min + 1)) in (let t27.min = ((t26.min + 1)*(t26.min + 1)) in (let t28.min = ((t27.min + 1)*(t27.min + 1)) in (let t29.min = ((t28.min + 1)*(t28.min + 1)) in (let t30.min = ((t29.min + 1)*(t29.min + 1)) in (let t31.min = ((t30.min + 1)*(t30.min + 1)) in (let t32.min = ((t31.min + 1)*(t31.min + 1)) in (let t33.min = ((t32.min + 1)*(t32.min + 1)) in (let t34.min = ((t33.min + 1)*(t33.min + 1)) in (let t35.min = ((t34.min + 1)*(t34.min + 1)) in (let t36.min = ((t35.min + 1)*(t35.min + 1)) in (let t37.min = ((t36.min + 1)*(t36.min + 1)) in (let t38.min = ((t37.min + 1)*(t37.min + 1)) in (let t39.min = ((t38.min + 1)*(t38.min + 1)) in (let t40.min = ((t39.min + 1)*(t39.min + 1)) in (let t41.min = ((t40.min + 1)*(t40.min + 1)) in (let t42.min = ((t41.min + 1)*(t41.min + 1)) in (let t43.min = ((t42.min + 1)*(t42.min + 1)) in (let t44.min = ((t43.min + 1)*(t43.min + 1)) in (let t45.min = ((t44.min + 1)*(t44.min + 1)) in (let t46.min = ((t45.min + 1)*(t45.min + 1)) in (let t47.min = ((t46.min + 1)*(t46.min + 1)) in (let t48.min = ((t47.min + 1)*(t47.min + 1)) in (let t49.min = ((t48.min + 1)*(t48.min + 1)) in (let t50.min = ((t49.min + 1)*(t49.min + 1)) in (let t51.min = ((t50.min + 1)*(t50.min + 1)) in (let t52.min = ((t51.min + 1)*(t51.min + 1)) in (let t53.min = ((t52.min + 1)*(t52.min + 1)) in (let t54.min = ((t53.min + 1)*(t53.min + 1)) in (let t55.min = ((t54.min + 1)*(t54.min + 1)) in (let t56.min = ((t55.min + 1)*(t55.min + 1)) in (let t57.min = ((t56.min + 1)*(t56.min + 1)) in (let t58.min = ((t57.min + 1)*(t57.min + 1)) in (let t59.min = ((t58.min + 1)*(t58.min + 1)) in (let t60.min = ((t59.min + 1)*(t59.min + 1)) in (let t61.min = ((t60.min + 1)*(t60.min + 1)) in (let t62.min = ((t61.min + 1)*(t61.min + 1)) in (let t63.min = ((t62.min + 1)*(t62.min + 1)) in (let t64.min = ((t63.min + 1)*(t63.min + 1)) in (let t65.min = ((t64.min + 1)*(t64.min + 1)) in (let t66.min = ((t65.min + 1)*(t65.min + 1)) in (let t67.min = ((t66.min + 1)*(t66.min + 1)) in (let t68.min = ((t67.min + 1)*(t67.min + 1)) in (let t69.min = ((t68.min + 1)*(t68.min + 1)) in (let t70.min = ((t69.min + 1)*(t69.min + 1)) in (let t71.min = ((t70.min + 1)*(t70.min + 1)) in (let t72.min = ((t71.min + 1)*(t71.min + 1)) in (let t73.min = ((t72.min + 1)*(t72.min + 1)) in (let t74.min = ((t73.min + 1)*(t73.min + 1)) in (let t75.min = ((t74.min + 1)*(t74.min + 1)) in (let t76.min = ((t75.min + 1)*(t75.min + 1)) in (let t77.min = ((t76.min + 1)*(t76.min + 1)) in (let t78.min = ((t77.min + 1)*(t77.min + 1)) in (let t79.min = ((t78.min + 1)*(t78.min + 1)) in (let t80.min = ((t79.min + 1)*(t79.min + 1)) in (let t81.min = ((t80.min + 1)*(t80.min + 1)) in (let t82.min = ((t81.min + 1)*(t81.min + 1)) in (let t83.min = ((t82.min + 1)*(t82.min + 1)) in (let t84.min = ((t83.min + 1)*(t83.min + 1)) in (let t85.min = ((t84.min + 1)*(t84.min + 1)) in (let t86.min = ((t85.min + 1)*(t85.min + 1)) in (let t87.min = ((t86.min + 1)*(t86.min + 1)) in (let t88.min = ((t87.min + 1)*(t87.min + 1)) in (let t89.min = ((t88.min + 1)*(t88.min + 1)) in (let t90.min = ((t89.min + 1)*(t89.min + 1)) in (let t91.min = ((t90.min + 1)*(t90.min + 1)) in (let t92.min = ((t91.min + 1)*(t91.min + 1)) in (let t93.min = ((t92.min + 1)*(t92.min + 1)) in (let t94.min = ((t93.min + 1)*(t93.min + 1)) in (let t95.min = ((t94.min + 1)*(t94.min + 1)) in (let t96.min = ((t95.min + 1)*(t95.min + 1)) in (let t97.min = ((t96.min + 1)*(t96.min + 1)) in (let t98.min = ((t97.min + 1)*(t97.min + 1)) in ((t98.min + 1)*(t98.min + 1)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

@steven-johnson
Copy link
Contributor Author

FYI, testing with #7706 merged too has no effect

@steven-johnson
Copy link
Contributor Author

This is kinda bonkers -- none of the changes in #7726 seem like they should affect this at all, and from what I can tell, none of the new code paths there are being hit -- maybe there's a subtle mistake in some of the changes? I'll see what I can find.

@steven-johnson
Copy link
Contributor Author

Hm, upon further review, it might not be an injection by #7726 after all? I can't repeat it with the steps I used before (or at least, what I noted down as the steps). Investigating.

@steven-johnson
Copy link
Contributor Author

OK, I think the answer here is: this test has been broken for some long period of time, because we aren't testing anderson2021 on the bots right now: it's only enabled if PTX is enabled, but we don't test autoschedule for PTX because we didn't use to be able to. Obviously we need to fix the buildbots to do this, but first we need to fix this bug. I'm going to assign it to @abadams for now since he is the usual go-to for simplification failures like this.

@steven-johnson
Copy link
Contributor Author

steven-johnson commented Aug 1, 2023

Ignore all my previous comments: previous versions of the test gave lots of warnings about signed integer overflow, but this didn't cause the test to fail. The failure injection is indeed #7726, and the injection is the new clause in this test... with the error being that we are using a 2D RDom in a sum() expression in an illegal way. (Why the error isn't printing is not clear.)

@steven-johnson steven-johnson changed the title anderson2021_test_apps_autoscheduler fails with Unhandled intrinsic call signed_integer_overflow anderson2021_test_apps_autoscheduler fails with ~Unhandled intrinsic call signed_integer_overflow~ Error: Can't treat this multidimensional RDom as an Expr Aug 1, 2023
@steven-johnson steven-johnson changed the title anderson2021_test_apps_autoscheduler fails with ~Unhandled intrinsic call signed_integer_overflow~ Error: Can't treat this multidimensional RDom as an Expr anderson2021_test_apps_autoscheduler fails with ~~Unhandled intrinsic call signed_integer_overflow~~ Error: Can't treat this multidimensional RDom as an Expr Aug 1, 2023
@steven-johnson steven-johnson changed the title anderson2021_test_apps_autoscheduler fails with ~~Unhandled intrinsic call signed_integer_overflow~~ Error: Can't treat this multidimensional RDom as an Expr anderson2021_test_apps_autoscheduler fails with ~Unhandled intrinsic call signed_integer_overflow~ Error: Can't treat this multidimensional RDom as an Expr Aug 1, 2023
@steven-johnson steven-johnson changed the title anderson2021_test_apps_autoscheduler fails with ~Unhandled intrinsic call signed_integer_overflow~ Error: Can't treat this multidimensional RDom as an Expr anderson2021_test_apps_autoscheduler fails with Error: Can't treat this multidimensional RDom as an Expr Aug 1, 2023
@steven-johnson steven-johnson self-assigned this Aug 1, 2023
ardier pushed a commit to ardier/Halide-mutation that referenced this issue Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants