Skip to content

Commit 615f885

Browse files
authored
Remove TF1 dependency from Triton (#182) (#184)
* Check for command-line tf version * Fix tf lib name
1 parent 02ed661 commit 615f885

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/backend_config.cc

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
// Copyright 2020-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
//
33
// Redistribution and use in source and binary forms, with or without
44
// modification, are permitted provided that the following conditions
@@ -35,25 +35,28 @@ namespace triton { namespace core {
3535
namespace {
3636

3737
Status
38-
GetTFSpecializedBackendName(
39-
const triton::common::BackendCmdlineConfigMap& config_map,
40-
std::string* specialized_name)
38+
CheckTFSpecializedBackendName(
39+
const triton::common::BackendCmdlineConfigMap& config_map)
4140
{
4241
std::string tf_version_str = "2";
4342
const auto& itr = config_map.find("tensorflow");
4443
if (itr != config_map.end()) {
4544
if (BackendConfiguration(itr->second, "version", &tf_version_str).IsOk()) {
46-
if ((tf_version_str != "1") && (tf_version_str != "2")) {
45+
if (tf_version_str == "1") {
46+
return Status(
47+
Status::Code::INVALID_ARG,
48+
"starting from 23.04, Triton no longer supports Tensorflow 1. "
49+
"Please switch to Tensorflow 2.");
50+
}
51+
if (tf_version_str != "2") {
4752
return Status(
4853
Status::Code::INVALID_ARG,
4954
"unexpected TensorFlow library version '" + tf_version_str +
50-
"', expects 1 or 2.");
55+
"', expects 2.");
5156
}
5257
}
5358
}
5459

55-
*specialized_name += tf_version_str;
56-
5760
return Status::Success;
5861
}
5962
} // namespace
@@ -177,7 +180,7 @@ BackendConfigurationSpecializeBackendName(
177180
{
178181
*specialized_name = backend_name;
179182
if (backend_name == "tensorflow") {
180-
RETURN_IF_ERROR(GetTFSpecializedBackendName(config_map, specialized_name));
183+
RETURN_IF_ERROR(CheckTFSpecializedBackendName(config_map));
181184
}
182185

183186
return Status::Success;

0 commit comments

Comments
 (0)