Yeah, I think I didn't make it very clear. The problem was because we may have 
multiple subgraphs, each of them may have "var_name: NDarray" pairs. I was 
trying to just have one `ModuleInitWrapper` to take charge of the 
initialization of engines for all subgraphs so that users don't need to 
orchestrate from the Python side. This means we need to have a field like 
`Map<String, Map<String, NDArray>> metadata_`, to save the mapping of each 
subgraph symbol to the `var_name: ndarray` pairs. This makes passing by array a 
bit more complicated.

Another alternative approach could be having multiple `ModuleInitWrapper`. Each 
of them only takes care of one engine. Then we would only have `Map<var_name,  
ndarray>`, and then we could pass this by two arrays `Array<String> variables_` 
and `Array<NDArray> metadata_`. This would need users to be aware of that there 
would be multiple modules and they need to initiate multiple 
`ModuleInitWrapper` for different engines. This is okay for CSourceModule stuff 
because we would usually only have one such a module. For execution engines 
like TRT, there would be multiple of it depending on the number of subgraphs. 

Maybe I can give a try to the alternative approach. @tqchen @junrushao1994  how 
do you think about the effort from frontend?





---
[Visit 
Topic](https://discuss.tvm.ai/t/byoc-runtime-json-runtime-for-byoc/6579/23) to 
respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.ai/email/unsubscribe/62b3a4b3ae89cbb9fabe79ce18a3f50bd5f63d9d39bd48a56378f40d7436ebf2).

Reply via email to