Skip to content

Conversation

@XinWangIntel
Copy link
Contributor

@XinWangIntel XinWangIntel commented Dec 15, 2025

Add new classes for handling dynamic pipelines and inference requests, update the build system to conditionally include these features, and ensure proper integration with the existing backend.

Dynamic Inference and Pipeline Support:

  • Build new dynamic feature only under developer build
  • Added new header zero_dynamic_infer_request.hpp implementing the ZeroDynamicInferRequest class, which add shape predict, tensor allocation with user and local tensor info based on normal ZeroInferRequest.
  • Added new header zero_dynamic_pipeline.hpp implementing the DynamicPipeline struct, which manages command list, graph arguments for dynamic execution.
  • Added IRGraph to forward inference call from dynamic pipeline to npu_mlir_runtime.
  • Update metadata with blob type, and parse blob type to create dynamic inferrequest and dynamic pipeline.
  • Update InferDynamicNetworkImportSetShapeCPUTensor to set legal shape

Tickets:

  • C-164943

@github-actions github-actions bot added category: build OpenVINO cmake script / infra category: samples OpenVINO Runtime Samples category: NPU OpenVINO NPU plugin labels Dec 15, 2025
Copy link
Collaborator

@rkazants rkazants left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do NOT merge

if (irGraph) {
IRGraph::GraphArguments graphArgs;
irGraph->getBinding(graphArgs);
std::vector<IRGraph::MemRefType> inputPros = graphArgs._inputs;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::vector<IRGraph::MemRefType> inputPros = graphArgs._inputs;
std::vector<IRGraph::MemRefType>& inputPros = graphArgs._inputs;

As this likely creates a copy of the vector

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need copy since each DynamicPipeline has own graph arguments, the input shape or size may be different among them.

// irGraph->predict_output_shape(inputPros, outputPros);

bool shapeChanged = false;
for (size_t i = 0; i < outputPros.size(); i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really required?

I would try to avoid extra logic in infer_async if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most time, the tensor we set can be used without issue. need predict_shape to detect if internal output tensor is large enough or need recreate. Need to check with complex model

@XinWangIntel XinWangIntel force-pushed the dynamic-pipeline-mlir-deps-v3 branch from 44b9061 to 6eafc74 Compare December 25, 2025 08:28
@XinWangIntel XinWangIntel force-pushed the dynamic-pipeline-mlir-deps-v3 branch from 6eafc74 to af1e4a8 Compare January 12, 2026 04:06
@XinWangIntel XinWangIntel changed the title Test dynamic-pipline v3 Add dynamic host pipeline to support host compile Jan 20, 2026
@XinWangIntel XinWangIntel force-pushed the dynamic-pipeline-mlir-deps-v3 branch from 60ac319 to d8340e3 Compare January 28, 2026 05:20
@github-actions github-actions bot removed the category: samples OpenVINO Runtime Samples label Jan 28, 2026
@XinWangIntel XinWangIntel marked this pull request as ready for review January 28, 2026 07:39
@XinWangIntel XinWangIntel requested review from a team as code owners January 28, 2026 07:39
@XinWangIntel XinWangIntel changed the title Add dynamic host pipeline to support host compile [NPU] Add dynamic host pipeline to support host compile Jan 28, 2026
@XinWangIntel XinWangIntel force-pushed the dynamic-pipeline-mlir-deps-v3 branch from 67fcad5 to 3a77880 Compare February 2, 2026 02:39
ov_add_api_validator_post_build_step(TARGET ${NPU_PLUGIN_TARGET})
if(NOT ENABLE_NPU_DEBUG_CAPS)
ov_add_api_validator_post_build_step(TARGET ${NPU_PLUGIN_TARGET})
endif() No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed changes on this file

Use point instread of MemRef
Wrap deps to zero pipeline
Refactor code
Move tensor allocator to pipeline
Try to allocate tensor on pipeline
Allocate tensor in dynamic inferrequest
Clear changes on inferrequest
Clean code
add free
Not release mem buffer to solve segment issue
Use StridedMemRefType
Clear zero_dynamic_infer_request
Remove zero dynamic_infer_request
Move ir_graph to compiler_adapter
Fix copy issue
Add TODO
Reuse engine in dynamic pipeline
Support windows
Update to latest commit
Fix stream status issue
Update mlir lib
Fix windows build and link issue
Fix min func issue on win and lin
dynamic shape
Fix linux build compilation
add NPU_LLVM_BACKEND
support multiple pipeline (batch)
Impelemtn updateMutableCmdList
Fix compilation errors after rebasing the code
fix a compilation issue w/ NPU_LLVM_BACKEND disabled
Add control and refactor
Update level_zero_wrapper, mlir lib
Use different tensor for different inferrequest in benchmark
Update windows jit libs
Add set_argument_property to update data, strides, shapes
Change update_graph_arguments to pass strides and shape
Blob will not be released in IRGraph
Fix buffer issue
Update stride in MemRefType to be element based
Move debug log into logger
Update arguments if we reuse L0 tensor on dynamic pipeline
Use plugin Metadata to show blob type
Add BlobType
Use zero_dynamic_infer_request to manage buffer for dynamic pipeline
Fix metadata test and code style
Add InferRequestDynamicShapeTest
Add test and fix engine init issue
Only disable test for min size and unprocessed model
Add test for remote tensor and host tensor
Rebase and solve conflict
Fix accuracy check
Move mlir deps to npu mlir runtime
Add metadata to return shapeFromIRModel
Load lib instead of link
Remove redundant libs
Update lib and fix window
Clean mlir deps
Fix code style
Use predict_shape function to check output tensor
Use MemRef instead of ze arg properties
Fix call of mlir runtime API and metadata
Fix stride issue
Add new functions to manage runtime MemRef object
Use new API to manage MemRef
Fix memref issue
Use new api
Update API to use continuous memory
Only create handle before execute
Fix ArgumentDescriptor
Fix index issue
reference code for output shape
Fix predict shape
Fix init issue
Signed-off-by: Xin Wang <[email protected]>

Signed-off-by: Xin Wang <[email protected]>
Signed-off-by: Xin Wang <[email protected]>

Signed-off-by: Xin Wang <[email protected]>
Signed-off-by: Xin Wang <[email protected]>

Signed-off-by: Xin Wang <[email protected]>
Signed-off-by: Xin Wang <[email protected]>

Signed-off-by: Xin Wang <[email protected]>
Signed-off-by: Xin Wang <[email protected]>

Signed-off-by: Xin Wang <[email protected]>
Signed-off-by: Xin Wang <[email protected]>

Signed-off-by: Xin Wang <[email protected]>
Signed-off-by: Xin Wang <[email protected]>

Signed-off-by: Xin Wang <[email protected]>
Signed-off-by: Xin Wang <[email protected]>

Signed-off-by: Xin Wang <[email protected]>
Signed-off-by: Xin Wang <[email protected]>

Signed-off-by: Xin Wang <[email protected]>
XinWangIntel and others added 18 commits February 3, 2026 18:33
Signed-off-by: Xin Wang <[email protected]>

Signed-off-by: Xin Wang <[email protected]>
Signed-off-by: Xin Wang <[email protected]>

Signed-off-by: Xin Wang <[email protected]>
Signed-off-by: Xin Wang <[email protected]>

Signed-off-by: Xin Wang <[email protected]>
Signed-off-by: Xin Wang <[email protected]>

Signed-off-by: Xin Wang <[email protected]>
Signed-off-by: Xin Wang <[email protected]>

Signed-off-by: Xin Wang <[email protected]>
Signed-off-by: Xin Wang <[email protected]>

Signed-off-by: Xin Wang <[email protected]>
Signed-off-by: Xin Wang <[email protected]>

Signed-off-by: Xin Wang <[email protected]>
Co-authored-by: Bogdan Pereanu <[email protected]>
Signed-off-by: Xin Wang <[email protected]>
Co-authored-by: Bogdan Pereanu <[email protected]>
Signed-off-by: Xin Wang <[email protected]>
Co-authored-by: Bogdan Pereanu <[email protected]>
Signed-off-by: Xin Wang <[email protected]>
Co-authored-by: Bogdan Pereanu <[email protected]>
Signed-off-by: Xin Wang <[email protected]>
Signed-off-by: Xin Wang <[email protected]>

Signed-off-by: Xin Wang <[email protected]>
Signed-off-by: Xin Wang <[email protected]>
@XinWangIntel XinWangIntel force-pushed the dynamic-pipeline-mlir-deps-v3 branch from 78063f4 to 69f323c Compare February 3, 2026 12:00
@XinWangIntel
Copy link
Contributor Author

@rkazants please help to review again, Thanks.

Signed-off-by: Xin Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: build OpenVINO cmake script / infra category: NPU OpenVINO NPU plugin do not merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants