Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw warning in case of Triton API minor version mismatch #90

Merged
merged 3 commits into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions src/client_backend/triton_c_api/triton_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,29 @@ TritonLoader::StartTriton()
REPORT_TRITONSERVER_ERROR(
api_version_fn_(&api_version_major, &api_version_minor),
"unable to get api version");
if ((TRITONSERVER_API_VERSION_MAJOR != api_version_major) ||
(TRITONSERVER_API_VERSION_MINOR > api_version_minor)) {
std::stringstream sstream;
sstream << "triton server API version mismatch. \n"
<< "Expected version major:" << TRITONSERVER_API_VERSION_MAJOR
<< ", minor:" << TRITONSERVER_API_VERSION_MINOR << "\n"
<< " Actual version major:" << api_version_major
<< ", minor:" << api_version_minor;
return Error(sstream.str());

auto createErrorMessage = [](const std::string& message, int expected,
int actual) {
return message + "Expected version: " + std::to_string(expected) + "\n" +
"Actual version: " + std::to_string(actual) + "\n";
};

if (TRITONSERVER_API_VERSION_MAJOR != api_version_major) {
ganeshku1 marked this conversation as resolved.
Show resolved Hide resolved
matthewkotila marked this conversation as resolved.
Show resolved Hide resolved
std::string errorMessage = createErrorMessage(
"Error: Triton server API major version mismatch.\n",
TRITONSERVER_API_VERSION_MAJOR, api_version_major);
return Error(errorMessage);
}

if (TRITONSERVER_API_VERSION_MINOR != api_version_minor) {
std::string warningMessage = createErrorMessage(
"Warning: Triton server API minor version mismatch.\n",
TRITONSERVER_API_VERSION_MINOR, api_version_minor);
warningMessage +=
"Attempting to proceed, but undefined behavior may occur.\n";
std::cerr << warningMessage;
}

// Create the server...
TRITONSERVER_ServerOptions* server_options = nullptr;
RETURN_IF_TRITONSERVER_ERROR(
Expand Down
Loading