diff --git a/src/plugins/intel_npu/src/common/include/intel_npu/common/blob_container.hpp b/src/plugins/intel_npu/src/common/include/intel_npu/common/blob_container.hpp index fbceccb26824e0..9193b540678d30 100644 --- a/src/plugins/intel_npu/src/common/include/intel_npu/common/blob_container.hpp +++ b/src/plugins/intel_npu/src/common/include/intel_npu/common/blob_container.hpp @@ -46,16 +46,18 @@ class BlobContainerVector : public BlobContainer { class BlobContainerAlignedBuffer : public BlobContainer { public: - BlobContainerAlignedBuffer(const std::shared_ptr& blobSO, size_t offset) + BlobContainerAlignedBuffer(const std::shared_ptr& blobSO, size_t ovHeaderOffset, size_t metadataSize) : _ownershipBlob(blobSO), - _offset(offset) {} + _ovHeaderOffset(ovHeaderOffset), + _metadataSize(metadataSize) {} void* get_ptr() override { - return _ownershipBlob->get_ptr(_offset); + return _ownershipBlob->get_ptr(_ovHeaderOffset); } size_t size() const override { - return _ownershipBlob->size(); + // remove OV header offset and metadata from blob size + return _ownershipBlob->size() - _ovHeaderOffset - _metadataSize; } bool release_from_memory() override { @@ -64,7 +66,8 @@ class BlobContainerAlignedBuffer : public BlobContainer { private: std::shared_ptr _ownershipBlob; - size_t _offset; + size_t _ovHeaderOffset; + size_t _metadataSize; }; } // namespace intel_npu diff --git a/src/plugins/intel_npu/src/plugin/src/plugin.cpp b/src/plugins/intel_npu/src/plugin/src/plugin.cpp index a721f7b55914b5..f1e991aef1030f 100644 --- a/src/plugins/intel_npu/src/plugin/src/plugin.cpp +++ b/src/plugins/intel_npu/src/plugin/src/plugin.cpp @@ -796,7 +796,7 @@ std::shared_ptr Plugin::import_model(std::istream& stream, c blobPtr = std::make_unique(std::move(blob)); } else { - blobPtr = std::make_unique(modelBuffer, stream.tellg()); + blobPtr = std::make_unique(modelBuffer, stream.tellg(), 0); } auto graph = compiler->parse(std::move(blobPtr), localConfig);