Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ab9eff2

Browse files
committedJan 14, 2025·
Fix offsets mismatch for HETERO plugin blob headers
1 parent 6be7805 commit ab9eff2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎src/plugins/intel_npu/src/plugin/src/metadata.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ std::streampos getFileSize(std::istream& stream) {
2222
}
2323

2424
if (dynamic_cast<ov::OwningSharedStreamBuffer*>(stream.rdbuf()) != nullptr) {
25-
return stream.rdbuf()->in_avail() + stream.tellg();
25+
return stream.rdbuf()->in_avail();
2626
}
2727

2828
const std::streampos streamStart = stream.tellg();
@@ -123,7 +123,7 @@ std::unique_ptr<MetadataBase> read_metadata_from(std::istream& stream) {
123123
blobMagicBytes.resize(magicBytesSize);
124124

125125
std::streampos currentStreamPos = stream.tellg(), streamSize = getFileSize(stream);
126-
stream.seekg(-currentStreamPos + streamSize - magicBytesSize, std::ios::cur);
126+
stream.seekg(streamSize - std::streampos(magicBytesSize), std::ios::cur);
127127
stream.read(blobMagicBytes.data(), magicBytesSize);
128128
if (MAGIC_BYTES != blobMagicBytes) {
129129
OPENVINO_THROW("Blob is missing NPU metadata!");

‎src/plugins/intel_npu/src/plugin/src/plugin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ std::shared_ptr<ov::ICompiledModel> Plugin::import_model(std::istream& stream, c
766766
npu_plugin_properties.erase(ov::internal::cached_model_buffer.name());
767767
}
768768

769-
const std::map<std::string, std::string> propertiesMap = any_copy(npu_plugin_properties);
769+
const auto propertiesMap = any_copy(npu_plugin_properties);
770770

771771
auto localConfig = merge_configs(_globalConfig, propertiesMap, OptionMode::RunTime);
772772
_logger.setLevel(localConfig.get<LOG_LEVEL>());

0 commit comments

Comments
 (0)
Please sign in to comment.