[Other] Optimize poros backend (#1331)

* Optimize poros backend

* Fix pybind error

---------

Co-authored-by: root <root@bjyz-sys-gpu-kongming3.bjyz.baidu.com>
This commit is contained in:
Jason
2023-02-17 14:32:35 +08:00
committed by GitHub
parent ee41944f47
commit db471c3466
6 changed files with 66 additions and 45 deletions

View File

@@ -84,11 +84,13 @@ int main(int argc, char* argv[]) {
runtime_option.SetModelPath(model_file, "", fd::ModelFormat::TORCHSCRIPT);
runtime_option.UsePorosBackend();
runtime_option.UseGpu(0);
runtime_option.is_dynamic = true;
// Compile runtime
std::unique_ptr<fd::Runtime> runtime =
std::unique_ptr<fd::Runtime>(new fd::Runtime());
runtime->Init(runtime_option);
if (!runtime->Compile(prewarm_datas, runtime_option)) {
std::cerr << "--- Init FastDeploy Runitme Failed! "
<< "\n--- Model: " << model_file << std::endl;
@@ -114,4 +116,4 @@ int main(int argc, char* argv[]) {
output_tensors[0].PrintInfo();
return 0;
}
}