@@ -402,13 +402,26 @@ void ZeroInferRequest::set_tensor_data(std::shared_ptr<ov::ITensor> tensor, cons
402
402
if (setTensorData) {
403
403
_tensorsData[name] = TensorData{_copyAllTensors.at (name)->data (),
404
404
_copyAllTensors.at (name)->get_byte_size (),
405
- levelZeroTensorCreatedLocally,
406
- !_createPipeline};
407
- _updateCommandList = true ;
405
+ levelZeroTensorCreatedLocally};
406
+
407
+ if (_pipelineIsCreated) {
408
+ _logger.debug (" ZeroInferRequest::infer_async - update command list" );
409
+
410
+ intel_npu::ZeroExecutor::ArgumentDescriptor desc;
411
+ if (isParameter) {
412
+ desc = _executor->inputs_desc_map ().at (name);
413
+ } else {
414
+ desc = _executor->outputs_desc_map ().at (name);
415
+ }
416
+
417
+ _pipeline->updateCommandList (_tensorsData[name], desc.idx , _batchSize);
418
+ }
408
419
}
409
420
}
410
421
411
- void ZeroInferRequest::set_remote_tensor_data (std::shared_ptr<ZeroRemoteTensor> tensor, const std::string& name) {
422
+ void ZeroInferRequest::set_remote_tensor_data (std::shared_ptr<ZeroRemoteTensor> tensor,
423
+ const std::string& name,
424
+ bool isParameter) {
412
425
auto l0_context = reinterpret_cast <ze_context_handle_t >(
413
426
extract_object (tensor->get_context ()->get_property (), ov::intel_npu::l0_context));
414
427
if (_initStructs->getContext () != l0_context) {
@@ -421,8 +434,20 @@ void ZeroInferRequest::set_remote_tensor_data(std::shared_ptr<ZeroRemoteTensor>
421
434
}
422
435
423
436
_copyAllTensors[name] = tensor;
424
- _tensorsData[name] = TensorData{data, tensor->get_byte_size (), false , !_createPipeline};
425
- _updateCommandList = true ;
437
+ _tensorsData[name] = TensorData{data, tensor->get_byte_size (), false };
438
+
439
+ if (_pipelineIsCreated) {
440
+ _logger.debug (" ZeroInferRequest::infer_async - update command list" );
441
+
442
+ intel_npu::ZeroExecutor::ArgumentDescriptor desc;
443
+ if (isParameter) {
444
+ desc = _executor->inputs_desc_map ().at (name);
445
+ } else {
446
+ desc = _executor->outputs_desc_map ().at (name);
447
+ }
448
+
449
+ _pipeline->updateCommandList (_tensorsData[name], desc.idx , _batchSize);
450
+ }
426
451
}
427
452
428
453
void ZeroInferRequest::set_tensor (const ov::Output<const ov::Node>& port, const ov::SoPtr<ov::ITensor>& tensor) {
@@ -444,7 +469,9 @@ void ZeroInferRequest::set_tensor(const ov::Output<const ov::Node>& port, const
444
469
ov::op::util::is_parameter (port.get_node ()));
445
470
} else {
446
471
_logger.debug (" ZeroInferRequest::set_tensor - set new remote tensor" );
447
- set_remote_tensor_data (remoteTensor, port.get_node ()->get_friendly_name ());
472
+ set_remote_tensor_data (remoteTensor,
473
+ port.get_node ()->get_friendly_name (),
474
+ ov::op::util::is_parameter (port.get_node ()));
448
475
}
449
476
}
450
477
}
@@ -489,23 +516,11 @@ void ZeroInferRequest::infer_async() {
489
516
OV_ITT_SCOPED_TASK (itt::domains::LevelZeroBackend, " infer_async" );
490
517
491
518
_executor->mutexLock ();
492
-
493
- if (_createPipeline) {
519
+ if (!_pipelineIsCreated) {
494
520
create_pipeline ();
495
521
496
- _createPipeline = false ;
497
- _updateCommandList = false ;
522
+ _pipelineIsCreated = true ;
498
523
}
499
-
500
- if (_initStructs->getMutableCommandListVersion ()) {
501
- if (_updateCommandList) {
502
- _logger.debug (" ZeroInferRequest::infer_async - update command list" );
503
- _pipeline->updateCommandList (_tensorsData, _batchSize);
504
-
505
- _updateCommandList = false ;
506
- }
507
- }
508
-
509
524
_executor->mutexUnlock ();
510
525
511
526
for (const std::string& name : _inputAndStateInputNames) {
0 commit comments