[PATCH] D129342: [mlgo] Don't provide default model URLs

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 19:53:22 PDT 2022


mtrofin created this revision.
mtrofin added reviewers: yundiqian, davidxl.
Herald added subscribers: hiraditya, mgorny.
Herald added a project: All.
mtrofin requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129342

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


Index: llvm/lib/CodeGen/CMakeLists.txt
===================================================================
--- llvm/lib/CodeGen/CMakeLists.txt
+++ llvm/lib/CodeGen/CMakeLists.txt
@@ -2,10 +2,7 @@
   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(
Index: llvm/lib/Analysis/CMakeLists.txt
===================================================================
--- llvm/lib/Analysis/CMakeLists.txt
+++ llvm/lib/Analysis/CMakeLists.txt
@@ -2,10 +2,7 @@
   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(
Index: llvm/cmake/modules/TensorFlowCompile.cmake
===================================================================
--- llvm/cmake/modules/TensorFlowCompile.cmake
+++ llvm/cmake/modules/TensorFlowCompile.cmake
@@ -92,10 +92,10 @@
   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.")
       endif()
 
       set(model ${default_url})


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129342.443119.patch
Type: text/x-patch
Size: 2518 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220708/9e2e5420/attachment.bin>


More information about the llvm-commits mailing list