Skip to content
Open
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
16 changes: 9 additions & 7 deletions src/libtorch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -532,15 +532,17 @@ ModelState::ParseParameters()
TRITONSERVER_ErrorDelete(err);
}
} else {
if (inter_op_thread_count > 0) {
if ((inter_op_thread_count > 0) &&
(inter_op_thread_count != at::get_num_interop_threads()) &&
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can still allow a repeated call if two model config files set the number of interop threads to different values. (See #159 for a safer solution.)

(at::get_num_interop_threads() == std::thread::hardware_concurrency())) {
at::set_num_interop_threads(inter_op_thread_count);
LOG_MESSAGE(
TRITONSERVER_LOG_INFO,
(std::string("Inter op thread count is set to ") +
std::to_string(inter_op_thread_count) + " for model instance '" +
Name() + "'")
.c_str());
}
LOG_MESSAGE(
TRITONSERVER_LOG_INFO,
(std::string("Inter op thread count is set to ") +
std::to_string(at::get_num_interop_threads()) + " for model instance '" +
Name() + "'")
.c_str());
}
}

Expand Down