jroesch commented on a change in pull request #8725:
URL: https://github.com/apache/tvm/pull/8725#discussion_r687428575



##########
File path: rust/tvm/examples/resnet/src/main.rs
##########
@@ -78,24 +78,26 @@ fn main() -> anyhow::Result<()> {
         "/deploy_lib.so"
     )))?;
 
-    let mut graph_rt = GraphRt::create_from_parts(&graph, lib, dev)?;
-
     // parse parameters and convert to TVMByteArray
     let params: Vec<u8> = fs::read(concat!(env!("CARGO_MANIFEST_DIR"), 
"/deploy_param.params"))?;
-
     println!("param bytes: {}", params.len());
 
+    let mut output: Vec<f32>;
+    let mut graph_rt = GraphRt::create_from_parts(&graph, lib.clone(), dev)?;

Review comment:
       @schell this program should demonstrate what is going on, there was a 
fundamental ref-count issue which I fixed, and I think there is one more issue 
with load_params but if you set the params once outside of your inference loop 
memory should be completely stable. These changes work for `tvm-rt` crate but 
it will require a bit more refactoring to fix the `tvm` crate itself. You 
should try these changes and see if you can avoid the issues. 




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


Reply via email to