From 4c63f1befa1063184c5982b11b6a2cc17d4e5815 Mon Sep 17 00:00:00 2001 From: Steven Johnson Date: Thu, 6 Apr 2023 16:34:59 -0700 Subject: [PATCH] Revise autoscheduler tool names to match those from #7483 (#7484) 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. --- Makefile | 6 +++--- packaging/CMakeLists.txt | 4 ++-- src/autoschedulers/adams2019/CMakeLists.txt | 8 ++++---- src/autoschedulers/adams2019/Makefile | 4 ++-- .../{autotune_loop.sh => adams2019_autotune_loop.sh} | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) rename src/autoschedulers/adams2019/{autotune_loop.sh => adams2019_autotune_loop.sh} (99%) diff --git a/Makefile b/Makefile index 9bfbcd26435f..fe262aebc699 100644 --- a/Makefile +++ b/Makefile @@ -2381,12 +2381,12 @@ endif # Adams2019 also includes autotuning tools $(DISTRIB_DIR)/lib/libautoschedule_adams2019.$(PLUGIN_EXT): $(BIN_DIR)/libautoschedule_adams2019.$(PLUGIN_EXT) @mkdir -p $(@D) - $(MAKE) -f $(SRC_DIR)/autoschedulers/adams2019/Makefile $(BIN_DIR)/retrain_cost_model $(BIN_DIR)/featurization_to_sample $(BIN_DIR)/get_host_target HALIDE_DISTRIB_PATH=$(CURDIR)/$(DISTRIB_DIR) + $(MAKE) -f $(SRC_DIR)/autoschedulers/adams2019/Makefile $(BIN_DIR)/adams2019_retrain_cost_model $(BIN_DIR)/featurization_to_sample $(BIN_DIR)/get_host_target HALIDE_DISTRIB_PATH=$(CURDIR)/$(DISTRIB_DIR) cp $< $(DISTRIB_DIR)/lib/ - for TOOL in retrain_cost_model featurization_to_sample get_host_target; do \ + for TOOL in adams2019_retrain_cost_model featurization_to_sample get_host_target; do \ cp $(BIN_DIR)/$${TOOL} $(DISTRIB_DIR)/bin/; \ done - cp $(SRC_DIR)/autoschedulers/adams2019/autotune_loop.sh $(DISTRIB_DIR)/tools/ + cp $(SRC_DIR)/autoschedulers/adams2019/adams2019_autotune_loop.sh $(DISTRIB_DIR)/tools/ ifeq ($(UNAME), Darwin) install_name_tool -id @rpath/$(@F) $(CURDIR)/$@ endif diff --git a/packaging/CMakeLists.txt b/packaging/CMakeLists.txt index dc9d0802701c..e2e9a30afc9b 100644 --- a/packaging/CMakeLists.txt +++ b/packaging/CMakeLists.txt @@ -79,7 +79,7 @@ else () set(rbase $ORIGIN) endif () -foreach (util IN ITEMS adams2019_retrain_cost_model adams2019_featurization_to_sample adams2019_get_host_target adams2019_weightsdir_to_weightsfile) +foreach (util IN ITEMS adams2019_retrain_cost_model featurization_to_sample get_host_target adams2019_weightsdir_to_weightsfile) if (TARGET ${util}) if (NOT CMAKE_INSTALL_RPATH) set_target_properties(${util} PROPERTIES INSTALL_RPATH "${rbase};${rbase}/${lib_dir}") @@ -121,7 +121,7 @@ install(DIRECTORY ${Halide_SOURCE_DIR}/tools/ PATTERN "build_halide_h.cpp" EXCLUDE PATTERN "find_inverse.cpp" EXCLUDE) -install(PROGRAMS ${Halide_SOURCE_DIR}/src/autoschedulers/adams2019/autotune_loop.sh +install(PROGRAMS ${Halide_SOURCE_DIR}/src/autoschedulers/adams2019/adams2019_autotune_loop.sh DESTINATION ${Halide_INSTALL_TOOLSDIR} COMPONENT Halide_Development) diff --git a/src/autoschedulers/adams2019/CMakeLists.txt b/src/autoschedulers/adams2019/CMakeLists.txt index 938a3c63ce50..74dcda55ce24 100644 --- a/src/autoschedulers/adams2019/CMakeLists.txt +++ b/src/autoschedulers/adams2019/CMakeLists.txt @@ -71,7 +71,7 @@ if (APPLE AND num_archs GREATER 1) ) endif () -# retrain_cost_model +# adams2019_retrain_cost_model if (WITH_UTILS) add_executable(adams2019_retrain_cost_model DefaultCostModel.cpp @@ -106,10 +106,10 @@ target_link_libraries(Halide_Adams2019 PRIVATE ASLog ParamParser adams2019_cost_ # TODO(#4053): implement auto-tuning support in CMake? if (WITH_UTILS) - add_executable(adams2019_featurization_to_sample featurization_to_sample.cpp) + add_executable(featurization_to_sample featurization_to_sample.cpp) - add_executable(adams2019_get_host_target get_host_target.cpp) - target_link_libraries(adams2019_get_host_target PRIVATE Halide::Halide) + add_executable(get_host_target get_host_target.cpp) + target_link_libraries(get_host_target PRIVATE Halide::Halide) add_executable(adams2019_weightsdir_to_weightsfile weightsdir_to_weightsfile.cpp Weights.cpp) target_link_libraries(adams2019_weightsdir_to_weightsfile PRIVATE Halide::Runtime) diff --git a/src/autoschedulers/adams2019/Makefile b/src/autoschedulers/adams2019/Makefile index fb0ac8461af1..2b5e1724c4c0 100644 --- a/src/autoschedulers/adams2019/Makefile +++ b/src/autoschedulers/adams2019/Makefile @@ -87,7 +87,7 @@ $(BIN)/libautoschedule_adams2019.$(PLUGIN_EXT): \ @mkdir -p $(@D) $(CXX) -shared $(USE_EXPORT_DYNAMIC) -fPIC -fvisibility=hidden -fvisibility-inlines-hidden $(CXXFLAGS) $(OPTIMIZE) -I $(BIN)/cost_model $(filter-out %.h $(LIBHALIDE_LDFLAGS),$^) -o $@ $(HALIDE_SYSTEM_LIBS) $(HALIDE_RPATH_FOR_LIB) -$(BIN)/retrain_cost_model: $(SRC)/retrain_cost_model.cpp \ +$(BIN)/adams2019_retrain_cost_model: $(SRC)/retrain_cost_model.cpp \ $(COMMON_DIR)/ASLog.cpp \ $(SRC)/DefaultCostModel.h \ $(SRC)/DefaultCostModel.cpp \ @@ -108,7 +108,7 @@ $(BIN)/featurization_to_sample: $(SRC)/featurization_to_sample.cpp $(BIN)/get_host_target: $(SRC)/get_host_target.cpp $(LIB_HALIDE) $(HALIDE_DISTRIB_PATH)/include/Halide.h @mkdir -p $(@D) $(CXX) $(CXXFLAGS) $(filter %.cpp,$^) $(LIBHALIDE_LDFLAGS) $(OPTIMIZE) -o $@ $(HALIDE_RPATH_FOR_BIN) -$(BIN)/weightsdir_to_weightsfile: $(SRC)/weightsdir_to_weightsfile.cpp $(SRC)/Weights.cpp +$(BIN)/adams2019_weightsdir_to_weightsfile: $(SRC)/weightsdir_to_weightsfile.cpp $(SRC)/Weights.cpp @mkdir -p $(@D) $(CXX) $(CXXFLAGS) $^ $(OPTIMIZE) -o $@ diff --git a/src/autoschedulers/adams2019/autotune_loop.sh b/src/autoschedulers/adams2019/adams2019_autotune_loop.sh similarity index 99% rename from src/autoschedulers/adams2019/autotune_loop.sh rename to src/autoschedulers/adams2019/adams2019_autotune_loop.sh index 92f419c005de..4e34ab47b543 100755 --- a/src/autoschedulers/adams2019/autotune_loop.sh +++ b/src/autoschedulers/adams2019/adams2019_autotune_loop.sh @@ -213,7 +213,7 @@ for ((BATCH_ID=$((FIRST+1));BATCH_ID<$((FIRST+1+NUM_BATCHES));BATCH_ID++)); do echo Retraining model... find ${SAMPLES} -name "*.sample" | \ - ${AUTOSCHED_BIN}/retrain_cost_model \ + ${AUTOSCHED_BIN}/adams2019_retrain_cost_model \ --epochs=${BATCH_SIZE} \ --rates="0.0001" \ --num_cores=32 \