tqchen commented on code in PR #14406:
URL: https://github.com/apache/tvm/pull/14406#discussion_r1150985938
##########
include/tvm/runtime/module.h:
##########
@@ -221,10 +221,20 @@ class TVM_DLL ModuleNode : public Object {
* By default, none of the property is set. Derived class can override this
function and set its
* own property.
*/
- virtual int GetProperty() const { return 0b000; }
+ virtual int GetPropertyMask() const { return 0b000; }
+
+ /*! \brief Returns true if this module is 'binary serializable'. */
+ bool IsBinarySerializable() const {
Review Comment:
I feel we don;t need this method. Instead, we can just expose GetProperty
and let python side use this function
##########
include/tvm/runtime/module.h:
##########
@@ -41,6 +41,30 @@
namespace tvm {
namespace runtime {
+/*!
+ * \brief Property of runtime module
+ * We classify the property of runtime module into the following categories.
+ * - kBinarySerializable: we can serialize the module to the stream of bytes.
CUDA/OpenCL/JSON
+ * runtime are representative examples. A binary exportable module can be
integrated into final
+ * runtime artifact by being serialized as data into the artifact, then
deserialized at runtime.
+ * This class of modules must implement SaveToBinary, and have a matching
deserializer registered as
+ * 'runtime.module.loadbinary_<type_key>'.
+ * - kRunnable: we can run the module directly. LLVM/CUDA/JSON runtime,
executors (e.g,
Review Comment:
move documentation into each field
--
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]