Skip to content

Commit

Permalink
Rename model config util config change require reload function
Browse files Browse the repository at this point in the history
  • Loading branch information
kthui committed Aug 16, 2024
1 parent 3d2f5c3 commit e6da04c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/model_config_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2432,7 +2432,7 @@ TritonToDataType(const TRITONSERVER_DataType dtype)
}

bool
EquivalentInNonInstanceGroupAndNonVersionPolicyConfig(
ConfigChangeRequiresReload(
const inference::ModelConfig& old_config,
const inference::ModelConfig& new_config)
{
Expand All @@ -2441,7 +2441,7 @@ EquivalentInNonInstanceGroupAndNonVersionPolicyConfig(
old_config.descriptor()->FindFieldByLowercaseName("instance_group"));
pb_diff.IgnoreField(
old_config.descriptor()->FindFieldByLowercaseName("version_policy"));
return pb_diff.Compare(old_config, new_config);
return !pb_diff.Compare(old_config, new_config);
}

bool
Expand Down
6 changes: 3 additions & 3 deletions src/model_config_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,10 @@ inference::DataType TritonToDataType(const TRITONSERVER_DataType dtype);
/// configs are equivalent.
/// \param old_config The old model config.
/// \param new_config The new model config.
/// \return True if the model configs are equivalent in all non instance group
/// and non version policy settings. False if they differ in non instance group
/// \return False if the model configs are equivalent in all non instance group
/// and non version policy settings. True if they differ in non instance group
/// and non version policy settings.
bool EquivalentInNonInstanceGroupAndNonVersionPolicyConfig(
bool ConfigChangeRequiresReload(
const inference::ModelConfig& old_config,
const inference::ModelConfig& new_config);

Expand Down
2 changes: 1 addition & 1 deletion src/model_repository_manager/model_lifecycle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ ModelLifeCycle::AsyncLoad(
// be completed with a simple config update.
if (!serving_model->is_ensemble_ &&
!prev_timestamp.IsModelVersionModified(curr_timestamp, version) &&
EquivalentInNonInstanceGroupAndNonVersionPolicyConfig(
!ConfigChangeRequiresReload(
serving_model->model_config_, model_config)) {
// Update the model
model_info = serving_model.get();
Expand Down

0 comments on commit e6da04c

Please sign in to comment.