From ea607ffc24277a46624a5a29158430e14e7a349e Mon Sep 17 00:00:00 2001 From: Iman Tabrizian Date: Mon, 11 Sep 2023 11:17:09 -0400 Subject: [PATCH] Revert "Load PyTorch backend as a persistent backend (#224)" (#250) This reverts commit 081152997cdada346fb0bde2a41adb99cf6a3c20. --- src/backend_manager.cc | 39 --------------------------------------- src/backend_manager.h | 6 ------ src/server.cc | 12 ------------ 3 files changed, 57 deletions(-) diff --git a/src/backend_manager.cc b/src/backend_manager.cc index d2b95d066..d18815dd4 100644 --- a/src/backend_manager.cc +++ b/src/backend_manager.cc @@ -381,43 +381,4 @@ TritonBackendManager::BackendState( return Status::Success; } -Status -TritonBackendManager::PreloadBackend( - const std::string& backend_name, - const triton::common::BackendCmdlineConfigMap& config_map) -{ - std::string backends_dir; - std::string specialized_backend_name; - std::string backend_libname; - RETURN_IF_ERROR( - BackendConfigurationGlobalBackendsDirectory(config_map, &backends_dir)); - RETURN_IF_ERROR(BackendConfigurationSpecializeBackendName( - config_map, backend_name, &specialized_backend_name)); - RETURN_IF_ERROR(BackendConfigurationBackendLibraryName( - specialized_backend_name, &backend_libname)); - - const auto backend_dir = JoinPath({backends_dir, specialized_backend_name}); - const auto backend_libpath = JoinPath({backend_dir, backend_libname}); - bool exists = false; - RETURN_IF_ERROR(FileExists(backend_libpath, &exists)); - if (exists) { - triton::common::BackendCmdlineConfig empty_backend_cmdline_config; - const triton::common::BackendCmdlineConfig* config; - const auto& itr = config_map.find(backend_name); - if (itr == config_map.end()) { - config = &empty_backend_cmdline_config; - } else { - config = &itr->second; - } - - // Backend manager would always hold a reference to the backend object - // so it is ok if this object goes out of scope. - std::shared_ptr backend; - RETURN_IF_ERROR(CreateBackend( - backend_name, backend_dir, backend_libpath, *config, &backend)); - } - - return Status::Success; -} - }} // namespace triton::core diff --git a/src/backend_manager.h b/src/backend_manager.h index a1aa68def..0bc3452d0 100644 --- a/src/backend_manager.h +++ b/src/backend_manager.h @@ -31,7 +31,6 @@ #include #include -#include "backend_config.h" #include "constants.h" #include "filesystem/api.h" #include "server_message.h" @@ -170,10 +169,6 @@ class TritonBackendManager { const triton::common::BackendCmdlineConfig& backend_cmdline_config, std::shared_ptr* backend); - Status PreloadBackend( - const std::string& backend_name, - const triton::common::BackendCmdlineConfigMap& config_map); - Status BackendState( std::unique_ptr< std::unordered_map>>* @@ -182,7 +177,6 @@ class TritonBackendManager { private: DISALLOW_COPY_AND_ASSIGN(TritonBackendManager); TritonBackendManager() = default; - std::unordered_map> backend_map_; }; diff --git a/src/server.cc b/src/server.cc index 66e740790..0484f90c5 100644 --- a/src/server.cc +++ b/src/server.cc @@ -151,17 +151,6 @@ InferenceServer::Init() return status; } - // TODO: Remove once the PyTorch bug is resolved. Currently, PyTorch has some - // issues with simultaneous model loading of other backends causing a segfault - // (TF to be specific). Once those issues are resolved we can remove this - // change. - status = - backend_manager_->PreloadBackend("pytorch", backend_cmdline_config_map_); - if (!status.IsOk()) { - ready_state_ = ServerReadyState::SERVER_FAILED_TO_INITIALIZE; - return status; - } - // CacheManager status = TritonCacheManager::Create(&cache_manager_, cache_dir_); if (!status.IsOk()) { @@ -249,7 +238,6 @@ InferenceServer::Init() LOG_WARNING << status.Message(); } - // Create the model manager for the repository. Unless model control // is disabled, all models are eagerly loaded when the manager is created. bool polling_enabled = (model_control_mode_ == ModelControlMode::MODE_POLL);