[llvm] 24c6c35 - [mlgo] Don't provide default model URLs

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 11 07:38:16 PDT 2022


Author: Mircea Trofin
Date: 2022-07-11T07:37:14-07:00
New Revision: 24c6c3527089ad1a02390fcef339f34adacb2686

URL: https://github.com/llvm/llvm-project/commit/24c6c3527089ad1a02390fcef339f34adacb2686
DIFF: https://github.com/llvm/llvm-project/commit/24c6c3527089ad1a02390fcef339f34adacb2686.diff

LOG: [mlgo] Don't provide default model URLs

Pointed out in Issue #56432: the current reference models may not be
quite friendly to open source projects. Their purpose is only
illustrative - the expectation is that projects would train their own.
To avoid unintentionally pulling such a model, made the URL cmake
setting require explicit user setting.

Differential Revision: https://reviews.llvm.org/D129342

Added: 
    

Modified: 
    llvm/cmake/modules/TensorFlowCompile.cmake
    llvm/lib/Analysis/CMakeLists.txt
    llvm/lib/CodeGen/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/TensorFlowCompile.cmake b/llvm/cmake/modules/TensorFlowCompile.cmake
index 80e361eba6895..d5ff44c9330d1 100644
--- a/llvm/cmake/modules/TensorFlowCompile.cmake
+++ b/llvm/cmake/modules/TensorFlowCompile.cmake
@@ -92,10 +92,11 @@ function(tf_find_and_compile model default_url default_path test_model_generator
   else()
     if ("${model}" STREQUAL "download")
       # Crash if the user wants to download a model but a URL is set to "TO_BE_UPDATED"
-      if ("${default_url}" STREQUAL "TO_BE_UPDATED")
-          message(FATAL_ERROR "Default URL was set to 'download' but there is no"
-          " model url currently specified in cmake - likely, the model interface"
-          " recently changed, and so there is not a released model available.")
+      if ("${default_url}" STREQUAL "<UNSPECIFIED>")
+          message(FATAL_ERROR "Model path was set to 'download' but there is no"
+          " model url currently specified in cmake. You can generate a model"
+          " using, for example, the tools at http://github.com/google/ml-compiler-opt."
+          " Some reference models are also periodically released there.")
       endif()
 
       set(model ${default_url})

diff  --git a/llvm/lib/Analysis/CMakeLists.txt b/llvm/lib/Analysis/CMakeLists.txt
index 16f18a08d76d2..821d1938b2163 100644
--- a/llvm/lib/Analysis/CMakeLists.txt
+++ b/llvm/lib/Analysis/CMakeLists.txt
@@ -2,10 +2,7 @@ if (DEFINED LLVM_HAVE_TF_AOT OR DEFINED LLVM_HAVE_TF_API)
   include(TensorFlowCompile)
   set(LLVM_INLINER_MODEL_PATH_DEFAULT "models/inliner-Oz")
 
-  # This url points to the most recent most which is known to be compatible with
-  # LLVM. When better models are published, this url should be updated to aid
-  # discoverability.
-  set(LLVM_INLINER_MODEL_CURRENT_URL "https://github.com/google/ml-compiler-opt/releases/download/inlining-Oz-v1.1/inlining-Oz-99f0063-v1.1.tar.gz")
+  set(LLVM_INLINER_MODEL_CURRENT_URL "<UNSPECIFIED>")
 
   if (DEFINED LLVM_HAVE_TF_AOT)
     tf_find_and_compile(

diff  --git a/llvm/lib/CodeGen/CMakeLists.txt b/llvm/lib/CodeGen/CMakeLists.txt
index 2ef8380d578ed..689fa9651766d 100644
--- a/llvm/lib/CodeGen/CMakeLists.txt
+++ b/llvm/lib/CodeGen/CMakeLists.txt
@@ -2,10 +2,7 @@ if (DEFINED LLVM_HAVE_TF_AOT OR DEFINED LLVM_HAVE_TF_API)
   include(TensorFlowCompile)
   set(LLVM_RAEVICT_MODEL_PATH_DEFAULT "models/regalloc-eviction")
 
-  # This url points to the most recent most which is known to be compatible with
-  # LLVM. When better models are published, this url should be updated to aid
-  # discoverability.
-  set(LLVM_RAEVICT_MODEL_CURRENT_URL "https://github.com/google/ml-compiler-opt/releases/download/regalloc-evict-v1.0/regalloc-evict-e67430c-v1.0.tar.gz")
+  set(LLVM_RAEVICT_MODEL_CURRENT_URL "<UNSPECIFIED>")
 
   if (DEFINED LLVM_HAVE_TF_AOT)
     tf_find_and_compile(


        


More information about the llvm-commits mailing list