jtuyls commented on a change in pull request #6343:
URL: https://github.com/apache/incubator-tvm/pull/6343#discussion_r480200949



##########
File path: src/runtime/contrib/vitis_ai/vitis_ai_runtime.cc
##########
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*!
+ * \file vitis_ai_runtime.cc
+ */
+#include <tvm/runtime/registry.h>
+#include <tvm/ir/transform.h>
+
+#include "vitis_ai_runtime.h"
+
+namespace tvm {
+namespace runtime {
+
+TVM_REGISTER_PASS_CONFIG_OPTION("target_", String);
+TVM_REGISTER_PASS_CONFIG_OPTION("vai_build_dir_", String);
+
+std::shared_ptr<pyxir::graph::XGraph> load_xgraph_model(const std::string& 
model_path) {
+  std::string model_name = model_path + "/" + "dpu_xgraph.json";
+  std::string model_weights = model_path + "/" + "dpu_xgraph.h5";
+  return pyxir::load(model_name, model_weights);
+}

Review comment:
       I agree that it would be less fragile to write the XGraph files into the 
binary stream. Currently, our runtime is directory based so we anyway have this 
directory with a couple of compilation files and target device information. At 
the moment we write this XGraph into the same directory. However, fewer files 
is better so for the TVM side we will have a look at serializing the JSON and 
HDF5 files into the binary stream.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to