Skip to content

Commit

Permalink
Fix offsets mismatch for HETERO plugin blob headers
Browse files Browse the repository at this point in the history
  • Loading branch information
MirceaDan99 committed Jan 14, 2025
1 parent 6be7805 commit ab9eff2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/plugins/intel_npu/src/plugin/src/metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ std::streampos getFileSize(std::istream& stream) {
}

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

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

std::streampos currentStreamPos = stream.tellg(), streamSize = getFileSize(stream);
stream.seekg(-currentStreamPos + streamSize - magicBytesSize, std::ios::cur);
stream.seekg(streamSize - std::streampos(magicBytesSize), std::ios::cur);
stream.read(blobMagicBytes.data(), magicBytesSize);
if (MAGIC_BYTES != blobMagicBytes) {
OPENVINO_THROW("Blob is missing NPU metadata!");
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/intel_npu/src/plugin/src/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ std::shared_ptr<ov::ICompiledModel> Plugin::import_model(std::istream& stream, c
npu_plugin_properties.erase(ov::internal::cached_model_buffer.name());
}

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

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

0 comments on commit ab9eff2

Please sign in to comment.