mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-14 04:44:00 +08:00
[Serving][backend]serving support multi stream and backend support external stream (#431)
* serving support multi stream * pybind add external stream Co-authored-by: Jason <jiangjiajun@baidu.com>
This commit is contained in:
@@ -379,6 +379,7 @@ TRITONSERVER_Error* ModelState::LoadModel(
|
||||
if ((instance_group_kind == TRITONSERVER_INSTANCEGROUPKIND_GPU) ||
|
||||
(instance_group_kind == TRITONSERVER_INSTANCEGROUPKIND_AUTO)) {
|
||||
runtime_options_->UseGpu(instance_group_device_id);
|
||||
runtime_options_->SetExternalStream((void*)stream);
|
||||
} else {
|
||||
runtime_options_->UseCpu();
|
||||
}
|
||||
@@ -1001,9 +1002,7 @@ TRITONSERVER_Error* ModelInstanceState::Run(
|
||||
runtime_->Infer(input_tensors_, &output_tensors_);
|
||||
#ifdef TRITON_ENABLE_GPU
|
||||
if (Kind() == TRITONSERVER_INSTANCEGROUPKIND_GPU) {
|
||||
// TODO: stream controll
|
||||
cudaDeviceSynchronize();
|
||||
// cudaStreamSynchronize(CudaStream());
|
||||
cudaStreamSynchronize(CudaStream());
|
||||
}
|
||||
#endif
|
||||
return nullptr;
|
||||
|
Reference in New Issue
Block a user