Skip to content

Commit

Permalink
Add more descriptions and improve function naming
Browse files Browse the repository at this point in the history
  • Loading branch information
kthui committed Jul 13, 2023
1 parent 60993a0 commit 686ebc9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/backend_model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,9 @@ TritonModel::PrepareInstances(
std::vector<std::shared_ptr<TritonModelInstance>>>
existing_instances = IndexInstances();

// Iterates over all the requested instances on the model config, and decides
// if each requested instance can reuse an existing instance or a new instance
// is needed.
for (const auto& group : model_config.instance_group()) {
std::vector<std::string> profile_names;
for (const auto& profile_name : group.profile()) {
Expand Down Expand Up @@ -668,7 +671,9 @@ TritonModel::UpdateConfiguredScheduler(
return sched->Update(added_instances, removed_instances);
}

// Non-sequence scheduler does not need to be updated.
// Non-sequence scheduler does not need to be updated, because other
// schedulers do not require the information on model instances to function,
// and only interact with the rate limiter.
return Status::Success;
}

Expand Down
4 changes: 2 additions & 2 deletions src/backend_model_instance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ TritonModelInstance::CreateInstance(
}

RETURN_IF_ERROR(SetNumaConfigOnThread(*host_policy));
auto err = CreateInstance(
auto err = ConstructAndInitializeInstance(
model, name, signature, kind, device_id, profile_names, passive,
host_policy_name, *host_policy, rate_limiter_config, secondary_devices,
triton_model_instance);
Expand Down Expand Up @@ -241,7 +241,7 @@ TritonModelInstance::CreateInstance(
}

Status
TritonModelInstance::CreateInstance(
TritonModelInstance::ConstructAndInitializeInstance(
TritonModel* model, const std::string& name, const Signature& signature,
const TRITONSERVER_InstanceGroupKind kind, const int32_t device_id,
const std::vector<std::string>& profile_names, const bool passive,
Expand Down
2 changes: 1 addition & 1 deletion src/backend_model_instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class TritonModelInstance {
const triton::common::HostPolicyCmdlineConfig& host_policy,
const TritonServerMessage& host_policy_message,
const std::vector<SecondaryDevice>& secondary_devices);
static Status CreateInstance(
static Status ConstructAndInitializeInstance(
TritonModel* model, const std::string& name, const Signature& signature,
const TRITONSERVER_InstanceGroupKind kind, const int32_t device_id,
const std::vector<std::string>& profile_names, const bool passive,
Expand Down

0 comments on commit 686ebc9

Please sign in to comment.