Skip to content
Merged
Show file tree
Hide file tree
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
23 changes: 23 additions & 0 deletions src/python_be.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2005,6 +2005,29 @@ ModelState::ValidateModelConfig()
return nullptr;
}

TRITONSERVER_Error*
ModelState::SetModelConfig()
{
BackendModel::SetModelConfig();
// `Update model_transaction_policy` if setting was set
// with `set_model_transaction_policy`
triton::common::TritonJson::Value model_transaction_policy;
bool is_decoupled = false;
if (ModelConfig().Find(
"model_transaction_policy", &model_transaction_policy)) {
triton::common::TritonJson::Value decoupled;
if (model_transaction_policy.Find("decoupled", &decoupled)) {
auto error = decoupled.AsBool(&is_decoupled);
if (error != nullptr) {
throw BackendModelException(error);
}
SetDecoupled(is_decoupled);
}
}

return nullptr;
}


extern "C" {

Expand Down
7 changes: 7 additions & 0 deletions src/python_be.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ class ModelState : public BackendModel {
// Is decoupled API being used.
bool IsDecoupled() { return decoupled_; }

// Set decoupled mode
void SetDecoupled(bool decoupled) { decoupled_ = decoupled; }

// Returns the value in the `runtime_modeldir_` field
std::string RuntimeModelDir() { return runtime_modeldir_; }

Expand All @@ -247,6 +250,10 @@ class ModelState : public BackendModel {
// Validate Model Configuration
TRITONSERVER_Error* ValidateModelConfig();

// Overrides `BackendModel::SetModelConfig` to also
// set `ModelState::decoupled_`
TRITONSERVER_Error* SetModelConfig();

// Auto-complete stub
std::unique_ptr<StubLauncher>& Stub() { return auto_complete_stub_; }

Expand Down
2 changes: 1 addition & 1 deletion src/resources/triton_python_backend_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def add_input(self, input):
+ input["name"]
+ "' in auto-complete-config function for model '"
+ self._model_config["name"]
+ "' contains property other than 'name', 'data_type' and 'dims'."
+ "' contains property other than 'name', 'data_type', 'dims' and 'optional'."
)

if "name" not in input:
Expand Down