echuraev commented on code in PR #13868:
URL: https://github.com/apache/tvm/pull/13868#discussion_r1090724562
##########
include/tvm/runtime/module.h:
##########
@@ -192,6 +192,27 @@ class TVM_DLL ModuleNode : public Object {
/*! \return The module it imports from */
const std::vector<Module>& imports() const { return imports_; }
+ /*!
+ * \brief Returns true if this module supports building from pre-compiled
programs.
+ *
+ * The default implementation returns false.
+ */
+ virtual bool SupportPreCompiledPrograms() const { return false; }
+
+ /*!
+ * \brief Pass pre-compiled programs which module will use to speed up
compilation time.
+ * \param bytes string with bytes of pre-compiled programs.
+ */
Review Comment:
@tqchen thank you or your feedback! You mean that we need to update
`SaveToBinary` method and serialize pre-compiled programs in the library with
the model, then during the loading we can load these pre-compiled programs and
create OpenCL programs from them? Did I understand correctly?
Unfortunately, we cannot get pre-compiled programs during the model build.
Because OpenCL kernels are compiled on the first run of the OpenCL runtime and
the format of the pre-compiled programs is hardware specific. So we can get the
pre-compiled programs only on the target device in the runtime. The main idea
of this feature that the end user can significantly decrease the built time of
his model in a real application. For example, on the installation phase, the
user can get pre-compiled programs and write them somewhere on the device. And
on the next run, these pre-compiled kernels will be used in this application. I
have updated `rtvm` application to demonstrate this scenario.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]