Skip to content

Commit 7b6f81a

Browse files
Investigate refactoring opportunities for batch management in Plugin and Compiler - no metadata changes - fix static tests
1 parent dfac8c5 commit 7b6f81a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/plugins/intel_npu/src/backend/src/zero_infer_request.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,13 @@ std::optional<size_t> determine_dynamic_batch_size(const IODescriptor& desc,
8181
return std::nullopt;
8282
}
8383

84-
if (batchSize.has_value()) {
85-
return batchSize.value();
84+
// Make sure that PLUGIN batch mode is currently active
85+
if (*desc.shapeFromCompiler.begin() != intel_npu::utils::DEFAULT_BATCH_SIZE) {
86+
return std::nullopt;
8687
}
8788

88-
if (tensor->get_shape().empty() || *desc.shapeFromCompiler.begin() != intel_npu::utils::DEFAULT_BATCH_SIZE) {
89-
return std::nullopt;
89+
if (batchSize.has_value()) {
90+
return batchSize.value();
9091
}
9192

9293
return tensor->get_shape()[intel_npu::utils::BATCH_AXIS];

0 commit comments

Comments
 (0)