[Hackathon 181] Add TVM support for FastDeploy on macOS (#1969)

* update for tvm backend

* update third_party

* update third_party

* update

* update

* update

* update

* update

* update

* update

* update

---------

Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com>
This commit is contained in:
Zheng-Bicheng
2023-05-25 19:59:02 +08:00
committed by GitHub
parent 49c033a828
commit 643730bf5f
20 changed files with 658 additions and 31 deletions

View File

@@ -39,6 +39,7 @@ enum Backend {
RKNPU2, ///< RKNPU2, support RKNN format model, Rockchip NPU only
SOPHGOTPU, ///< SOPHGOTPU, support SOPHGO format model, Sophgo TPU only
HORIZONNPU, ///< HORIZONNPU, support Horizon format model, Horizon NPU
TVM, ///< TVMBackend, support TVM format model, CPU / Nvidia GPU
};
/**
@@ -74,6 +75,7 @@ enum ModelFormat {
TORCHSCRIPT, ///< Model with TorchScript format
SOPHGO, ///< Model with SOPHGO format
HORIZON, ///< Model with HORIZON format
TVMFormat, ///< Model with TVM format
};
/// Describle all the supported backends for specified model format
@@ -85,16 +87,17 @@ static std::map<ModelFormat, std::vector<Backend>>
{ModelFormat::RKNN, {Backend::RKNPU2}},
{ModelFormat::HORIZON, {Backend::HORIZONNPU}},
{ModelFormat::TORCHSCRIPT, {Backend::POROS}},
{ModelFormat::SOPHGO, {Backend::SOPHGOTPU}}
{ModelFormat::SOPHGO, {Backend::SOPHGOTPU}},
{ModelFormat::TVMFormat, {Backend::TVM}}
};
/// Describle all the supported backends for specified device
static std::map<Device, std::vector<Backend>>
s_default_backends_by_device = {
{Device::CPU, {Backend::LITE, Backend::PDINFER, Backend::ORT,
Backend::OPENVINO, Backend::POROS}},
Backend::OPENVINO, Backend::POROS, Backend::TVM}},
{Device::GPU, {Backend::LITE, Backend::PDINFER, Backend::ORT,
Backend::TRT, Backend::POROS}},
Backend::TRT, Backend::POROS, Backend::TVM}},
{Device::RKNPU, {Backend::RKNPU2}},
{Device::SUNRISENPU, {Backend::HORIZONNPU}},
{Device::IPU, {Backend::PDINFER}},