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

Fix handling of thread features for scalars in Anderson2021 #7726

Merged
merged 2 commits into from
Jul 31, 2023

Conversation

aekul
Copy link
Contributor

@aekul aekul commented Jul 31, 2023

This fixes the issue in #7699. The cause is that the autoscheduler assumes that every Func is surrounded by a block loop and a thread loop, which means it assumes there is always a non-null ThreadInfo object when the features are computed. But in this case, the output of the generator is a single number so the autoscheduler is currently not creating a block and thread loop for it, so the ThreadInfo object ends up being null.

The main thing this PR does is add some special cases to compute_features for handling scalars. It was also necessary to change some function signatures to accept a ThreadInfo* instead of a ThreadInfo& so that it can test whether the passed object is null or not.

@aekul aekul mentioned this pull request Jul 31, 2023
Copy link
Contributor

@steven-johnson steven-johnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I presume that #7703 is still an issue -- after this lands, do we want to consider #7706 as a fix for it, or do you have an alternate suggestion?

@steven-johnson
Copy link
Contributor

(Oh, and thanks SO much for taking the time to look at this!)

@steven-johnson steven-johnson merged commit f54bc08 into halide:main Jul 31, 2023
3 checks passed
@steven-johnson
Copy link
Contributor

This looks like it may have injected #7729 based on a quick bisection -- I thought that anderson2021_test_apps_autoscheduler had run on the testbots, but maybe I misread due to other false-positive failures :-/

@aekul
Copy link
Contributor Author

aekul commented Aug 1, 2023

No problem. Thanks for looking into the test failure.

And yes, I think we should consider #7706 as a fix for #7703

@aekul aekul deleted the scalar-features branch August 1, 2023 05:12
ardier pushed a commit to ardier/Halide-mutation that referenced this pull request Mar 3, 2024
)

* Fix handling of thread features for scalars

* Remove unneeded change
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

Successfully merging this pull request may close these issues.

2 participants