Skip to content

Commit d300a9a

Browse files
Tabrizianmc-nv
authored andcommitted
Revert "Load PyTorch backend as a persistent backend (#224)" (#250)
This reverts commit 0811529.
1 parent 41d9978 commit d300a9a

File tree

3 files changed

+0
-57
lines changed

3 files changed

+0
-57
lines changed

src/backend_manager.cc

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -381,43 +381,4 @@ TritonBackendManager::BackendState(
381381
return Status::Success;
382382
}
383383

384-
Status
385-
TritonBackendManager::PreloadBackend(
386-
const std::string& backend_name,
387-
const triton::common::BackendCmdlineConfigMap& config_map)
388-
{
389-
std::string backends_dir;
390-
std::string specialized_backend_name;
391-
std::string backend_libname;
392-
RETURN_IF_ERROR(
393-
BackendConfigurationGlobalBackendsDirectory(config_map, &backends_dir));
394-
RETURN_IF_ERROR(BackendConfigurationSpecializeBackendName(
395-
config_map, backend_name, &specialized_backend_name));
396-
RETURN_IF_ERROR(BackendConfigurationBackendLibraryName(
397-
specialized_backend_name, &backend_libname));
398-
399-
const auto backend_dir = JoinPath({backends_dir, specialized_backend_name});
400-
const auto backend_libpath = JoinPath({backend_dir, backend_libname});
401-
bool exists = false;
402-
RETURN_IF_ERROR(FileExists(backend_libpath, &exists));
403-
if (exists) {
404-
triton::common::BackendCmdlineConfig empty_backend_cmdline_config;
405-
const triton::common::BackendCmdlineConfig* config;
406-
const auto& itr = config_map.find(backend_name);
407-
if (itr == config_map.end()) {
408-
config = &empty_backend_cmdline_config;
409-
} else {
410-
config = &itr->second;
411-
}
412-
413-
// Backend manager would always hold a reference to the backend object
414-
// so it is ok if this object goes out of scope.
415-
std::shared_ptr<TritonBackend> backend;
416-
RETURN_IF_ERROR(CreateBackend(
417-
backend_name, backend_dir, backend_libpath, *config, &backend));
418-
}
419-
420-
return Status::Success;
421-
}
422-
423384
}} // namespace triton::core

src/backend_manager.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <string>
3232
#include <unordered_map>
3333

34-
#include "backend_config.h"
3534
#include "constants.h"
3635
#include "filesystem/api.h"
3736
#include "server_message.h"
@@ -170,10 +169,6 @@ class TritonBackendManager {
170169
const triton::common::BackendCmdlineConfig& backend_cmdline_config,
171170
std::shared_ptr<TritonBackend>* backend);
172171

173-
Status PreloadBackend(
174-
const std::string& backend_name,
175-
const triton::common::BackendCmdlineConfigMap& config_map);
176-
177172
Status BackendState(
178173
std::unique_ptr<
179174
std::unordered_map<std::string, std::vector<std::string>>>*
@@ -182,7 +177,6 @@ class TritonBackendManager {
182177
private:
183178
DISALLOW_COPY_AND_ASSIGN(TritonBackendManager);
184179
TritonBackendManager() = default;
185-
186180
std::unordered_map<std::string, std::shared_ptr<TritonBackend>> backend_map_;
187181
};
188182

src/server.cc

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,6 @@ InferenceServer::Init()
151151
return status;
152152
}
153153

154-
// TODO: Remove once the PyTorch bug is resolved. Currently, PyTorch has some
155-
// issues with simultaneous model loading of other backends causing a segfault
156-
// (TF to be specific). Once those issues are resolved we can remove this
157-
// change.
158-
status =
159-
backend_manager_->PreloadBackend("pytorch", backend_cmdline_config_map_);
160-
if (!status.IsOk()) {
161-
ready_state_ = ServerReadyState::SERVER_FAILED_TO_INITIALIZE;
162-
return status;
163-
}
164-
165154
// CacheManager
166155
status = TritonCacheManager::Create(&cache_manager_, cache_dir_);
167156
if (!status.IsOk()) {
@@ -249,7 +238,6 @@ InferenceServer::Init()
249238
LOG_WARNING << status.Message();
250239
}
251240

252-
253241
// Create the model manager for the repository. Unless model control
254242
// is disabled, all models are eagerly loaded when the manager is created.
255243
bool polling_enabled = (model_control_mode_ == ModelControlMode::MODE_POLL);

0 commit comments

Comments
 (0)