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

Clean up various autoscheduler tool issues #7483

Merged
merged 5 commits into from
Apr 11, 2023
Merged

Conversation

steven-johnson
Copy link
Contributor

  • In CMake, not all of the tooling for Anderson2021 was included in packaging; now it is.
  • Since the featurization_to_sample and get_host_target tools are 100% identical across all autoschedulers, they now get build only once, and don't get the adams2019_ (etc) prefix they formerly did.
  • conversely, the autotune_loop.sh and weightsdir_to_weightsfile tools now do get autoscheduler-specific prefixes, because they aren't interchangeable.
  • Fixes to various scripts etc to use the correct tool names.
  • When the Anderson2021 autoscheduler was added, we tried to factor out common coding and tooling, but went a bit too far: the weightsdir_to_weightsfile source was moved into common/, and while it and the related Weights source were identical, they needed to include different Featurization.h files, and so basically relied on the build rules building it twice, with a different include path each time. IMHO this is unreasonably fragile and weird, so I moved those sources back into the folders in question, as there isn't any compelling reason to keep these sources exactly in sync anyway.
  • Same story for the test_function_dag test.

Note that I started to add support for Anderson2021 to the main Makefile, but it became painful to do -- it works fine for CMake, so I will leave adding Make support for someone who wants to use it there. (Honestly, the Makefile for it is still kind of a mess even after some cleanup; I'm tempted to delete it and just declare that that one is CMake-only...)

- In CMake, not all of the tooling for Anderson2021 was included in packaging; now it is.
- Since the featurization_to_sample and get_host_target tools are 100% identical across all autoschedulers, they now get build only once, and don't get the `adams2019_` (etc) prefix they formerly did.
- conversely, the autotune_loop.sh and weightsdir_to_weightsfile tools now *do* get autoscheduler-specific prefixes, because they aren't interchangeable.
- Fixes to various scripts etc to use the correct tool names.
- When the Anderson2021 autoscheduler was added, we tried to factor out common coding and tooling, but went a bit too far: the weightsdir_to_weightsfile source was moved into common/, and while it and the related Weights source were identical, they needed to include *different* Featurization.h files, and so basically relied on the build rules building it twice, with a different include path each time. IMHO this is unreasonably fragile and weird, so I moved those sources back into the folders in question, as there isn't any compelling reason to keep these sources exactly in sync anyway.
- Same story for the test_function_dag test.

Note that I started to add support for Anderson2021 to the main Makefile, but it became painful to do -- it works fine for CMake, so I will leave adding Make support for someone who wants to use it there.
steven-johnson added a commit that referenced this pull request Apr 6, 2023
The Halide 15.0.0 release inadvertently omitted all of these tools from the packaging. They are being re-added for 15.0.1. While we're doing this, let's go ahead and have the names match those proposed for Halide 16.
steven-johnson added a commit that referenced this pull request Apr 6, 2023
The Halide 15.0.0 release inadvertently omitted all of these tools from the packaging. They are being re-added for 15.0.1. While we're doing this, let's go ahead and have the names match those proposed for Halide 16.
@@ -36,23 +36,23 @@ $(BIN)/baseline_weights.o: $(BIN)/baseline_weights.cpp
$(CXX) -c $< -o $@

AUTOSCHED_COST_MODEL_LIBS=\
$(BIN)/cost_model/adams2019_cost_model.a \
$(BIN)/cost_model/adams2019_train_cost_model.a \
$(BIN)/adams2019_cost_model/adams2019_cost_model.a \
Copy link
Member

Choose a reason for hiding this comment

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

Why the adams2019 prefix on the cost model directory and generator? This file should be private to this autoscheduler, so it shouldn't need namespacing,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, a holdover from a brief, aborted attempt at integrating Anderson2021 into the base Makefile -- both this and that were trying to create the same target, and hilarity ensued. I'll revert them.

@@ -14,7 +14,7 @@ int main(int argc, char **argv) {
AutoschedulerParams params = {"Anderson2021", {{"parallelism", std::to_string(hardware_parallelism)}}};

// Use a fixed target for the analysis to get consistent results from this test.
Target target("x86-64-linux-sse41-avx-avx2-cuda");
Target target("x86-64-linux-sse41-avx-avx2-cuda-debug");
Copy link
Member

Choose a reason for hiding this comment

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

Unintentional? This isn't going to change anything in the current test, but if the test is changed to actually run code, it's going to invalidate any performance measurements.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops, yes, fixing

@steven-johnson
Copy link
Contributor Author

Monday Morning Review Ping

@abadams
Copy link
Member

abadams commented Apr 11, 2023

LGTM for my part, but would like Alex to approve for the cmake changes.

Copy link
Member

@alexreinking alexreinking left a comment

Choose a reason for hiding this comment

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

Build changes look good to me across the board.

@steven-johnson steven-johnson merged commit 264c440 into main Apr 11, 2023
@steven-johnson steven-johnson deleted the srj/autoscheduler-bin branch April 11, 2023 17:18
ardier pushed a commit to ardier/Halide-mutation that referenced this pull request Mar 3, 2024
* Clean up various autoscheduler tool issues

- In CMake, not all of the tooling for Anderson2021 was included in packaging; now it is.
- Since the featurization_to_sample and get_host_target tools are 100% identical across all autoschedulers, they now get build only once, and don't get the `adams2019_` (etc) prefix they formerly did.
- conversely, the autotune_loop.sh and weightsdir_to_weightsfile tools now *do* get autoscheduler-specific prefixes, because they aren't interchangeable.
- Fixes to various scripts etc to use the correct tool names.
- When the Anderson2021 autoscheduler was added, we tried to factor out common coding and tooling, but went a bit too far: the weightsdir_to_weightsfile source was moved into common/, and while it and the related Weights source were identical, they needed to include *different* Featurization.h files, and so basically relied on the build rules building it twice, with a different include path each time. IMHO this is unreasonably fragile and weird, so I moved those sources back into the folders in question, as there isn't any compelling reason to keep these sources exactly in sync anyway.
- Same story for the test_function_dag test.

Note that I started to add support for Anderson2021 to the main Makefile, but it became painful to do -- it works fine for CMake, so I will leave adding Make support for someone who wants to use it there.

* Fix needless renames

* Remove scalpel left in patient

* Update CMakeLists.txt

* Update Makefile
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.

3 participants