[PATCH] D104829: Fail gracefully if no inlining model is available to download.
Jacob Hegna via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 29 10:20:43 PDT 2021
jacobhegna updated this revision to Diff 355286.
jacobhegna added a comment.
Move the relevant code to TensorflowCompile.cmake.
When removing a model, the default url should be set to the string literal
"none".
We cannot simply set it to "", as cmake will then think that the call to
tf_find_and_compile is missing and argument.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104829/new/
https://reviews.llvm.org/D104829
Files:
llvm/cmake/modules/TensorFlowCompile.cmake
Index: llvm/cmake/modules/TensorFlowCompile.cmake
===================================================================
--- llvm/cmake/modules/TensorFlowCompile.cmake
+++ llvm/cmake/modules/TensorFlowCompile.cmake
@@ -88,6 +88,11 @@
function(tf_find_and_compile model default_url default_path generation_config tag_set signature_def_key fname cpp_class)
if ("${model}" STREQUAL "download")
+ # Crash if the user wants to download a model but a URL is set to "none"
+ if ("${LLVM_INLINER_MODEL_CURRENT_URL}" STREQUAL "none")
+ message(FATAL_ERROR "LLVM_INLINER_MODEL_PATH 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.")
+ endif()
+
set(model ${default_url})
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104829.355286.patch
Type: text/x-patch
Size: 822 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210629/4cf37bf2/attachment.bin>
More information about the llvm-commits
mailing list