From 4e613a55cf38f11a54160cf8eead4d8947a5115b Mon Sep 17 00:00:00 2001 From: Iman Tabrizian Date: Mon, 11 Sep 2023 15:48:20 -0400 Subject: [PATCH] Fix null requests --- src/backend_model_instance.cc | 3 ++- src/infer_request.cc | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backend_model_instance.cc b/src/backend_model_instance.cc index cf42b5bd7..526c558f9 100644 --- a/src/backend_model_instance.cc +++ b/src/backend_model_instance.cc @@ -633,7 +633,8 @@ TritonModelInstance::WarmUp() reinterpret_cast(request.get())); // For warmup requests we need to manually set ResponseFactory - // since they don't run `PrepareForInference`. + // since they modify the callback after PrepareForInference has + // been called. request->SetResponseFactory(); } diff --git a/src/infer_request.cc b/src/infer_request.cc index 438e3d272..57828e8dc 100644 --- a/src/infer_request.cc +++ b/src/infer_request.cc @@ -590,6 +590,7 @@ InferenceRequest::CopyAsNull(const InferenceRequest& from) lrequest->SetResponseCallback( &null_allocator, nullptr, NullResponseComplete, nullptr); lrequest->SetReleaseCallback(NullRequestComplete, nullptr); + lrequest->SetResponseFactory(); // Must normalize inputs here... for (auto& pr : lrequest->original_inputs_) {