Skip to content

Commit

Permalink
Do not register empty model name to warmup registry
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 542723133
  • Loading branch information
tensorflower-gardener authored and tensorflow-copybara committed Jun 23, 2023
1 parent f31c756 commit 1598cfe
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,14 @@ constexpr int WarmupConsts::kMaxNumRecords;
Status RunSavedModelWarmup(
const ModelWarmupOptions& model_warmup_options, const string export_dir,
std::function<Status(PredictionLog)> warmup_request_executor) {
auto warmup = GetGlobalWarmupStateRegistry().Register(
{model_warmup_options.model_name(),
model_warmup_options.model_version()});
TF_RETURN_IF_ERROR(warmup.status());
WarmupStateRegistry::Handle warmup_handle;
if (!model_warmup_options.model_name().empty()) {
auto h = GetGlobalWarmupStateRegistry().Register(
{model_warmup_options.model_name(),
model_warmup_options.model_version()});
TF_RETURN_IF_ERROR(h.status());
warmup_handle = std::move(h.value());
}

const uint64_t start_microseconds = EnvTime::NowMicros();
const string warmup_path =
Expand Down

0 comments on commit 1598cfe

Please sign in to comment.