@@ -1097,6 +1097,13 @@ ModelInstanceState::GetInputTensor(
10971097
10981098 ModelState* model_state = reinterpret_cast <ModelState*>(Model ());
10991099 bool cpu_only_tensors = model_state->ForceCPUOnlyInputTensors ();
1100+
1101+ if (!cpu_only_tensors && model_state->IsDecoupled ()) {
1102+ return TRITONSERVER_ErrorNew (
1103+ TRITONSERVER_ERROR_INTERNAL,
1104+ " FORCE_CPU_ONLY_INPUT_TENSORS set to OFF is not yet supported in the "
1105+ " decoupled API." );
1106+ }
11001107 if (input_dtype == TRITONSERVER_TYPE_BYTES) {
11011108 cpu_only_tensors = true ;
11021109 }
@@ -2443,19 +2450,13 @@ TRITONBACKEND_ModelInstanceExecute(
24432450 requests, request_count, infer_requests);
24442451
24452452 if (error != nullptr ) {
2446- for (auto & infer_request : infer_requests) {
2447- // We should only delete the response factory for the requests that have
2448- // not been closed.
2453+ for (uint32_t r = 0 ; r < request_count; ++r) {
2454+ TRITONBACKEND_Request* request = requests[r];
24492455 if (!instance_state->ExistsInClosedRequests (
2450- infer_request->RequestAddress ())) {
2451- LOG_IF_ERROR (
2452- infer_request->DeleteResponseFactory (),
2453- " Failed to delete the response factory." );
2456+ reinterpret_cast <intptr_t >(request))) {
24542457 TRITONBACKEND_Response* response = nullptr ;
24552458 LOG_IF_ERROR (
2456- TRITONBACKEND_ResponseNew (
2457- &response, reinterpret_cast <TRITONBACKEND_Request*>(
2458- infer_request->RequestAddress ())),
2459+ TRITONBACKEND_ResponseNew (&response, request),
24592460 " Failed to create a new resposne." );
24602461
24612462 if (response != nullptr ) {
@@ -2466,6 +2467,17 @@ TRITONBACKEND_ModelInstanceExecute(
24662467 }
24672468 }
24682469 }
2470+
2471+ // We should only delete the response factory for the requests that have
2472+ // not been closed.
2473+ for (auto & infer_request : infer_requests) {
2474+ if (!instance_state->ExistsInClosedRequests (
2475+ infer_request->RequestAddress ())) {
2476+ LOG_IF_ERROR (
2477+ infer_request->DeleteResponseFactory (),
2478+ " Failed to delete the response factory." );
2479+ }
2480+ }
24692481 }
24702482 }
24712483
0 commit comments