-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NPU] Adding support for the remote tensor feature - [Part II - lefto…
…vers] (#25572) ### Details: - *Allocate a Host L0 buffer when the create host tensor method is used* - *Do not chain the mutable descriptor, call the update mutable command list after each descriptor instead* - *Do not throw an error if using an older ze_loader only if the unsupported functions are going to be called* - *Call updateMutableCommandList after set_tensor method is used* - *Add extra test cases for batching flow using MCL* ### Tickets: - *EISW-131915*
- Loading branch information
Showing
18 changed files
with
331 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/plugins/intel_npu/src/backend/include/zero_host_tensor.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright (C) 2018-2024 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include "intel_npu/al/config/config.hpp" | ||
#include "openvino/runtime/itensor.hpp" | ||
#include "zero_init.hpp" | ||
#include "zero_remote_tensor.hpp" | ||
|
||
namespace intel_npu { | ||
|
||
class ZeroHostTensor : public ov::ITensor { | ||
public: | ||
ZeroHostTensor(std::shared_ptr<ov::IRemoteContext> context, | ||
std::shared_ptr<ZeroInitStructsHolder> init_structs, | ||
const ov::element::Type element_type, | ||
const ov::Shape& shape, | ||
const Config& config); | ||
|
||
~ZeroHostTensor() override = default; | ||
|
||
void* data(const ov::element::Type& element_type) const override; | ||
const ov::element::Type& get_element_type() const override; | ||
|
||
const ov::Shape& get_shape() const override; | ||
|
||
const ov::Strides& get_strides() const override; | ||
|
||
void set_shape(ov::Shape new_shape) override; | ||
|
||
std::shared_ptr<ZeroRemoteTensor> get_impl() const; | ||
|
||
private: | ||
std::shared_ptr<ZeroRemoteTensor> m_impl; | ||
}; | ||
|
||
} // namespace intel_npu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/plugins/intel_npu/src/backend/src/zero_host_tensor.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright (C) 2018-2024 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include "zero_host_tensor.hpp" | ||
|
||
#include "openvino/runtime/intel_npu/remote_properties.hpp" | ||
|
||
namespace intel_npu { | ||
|
||
ZeroHostTensor::ZeroHostTensor(std::shared_ptr<ov::IRemoteContext> context, | ||
std::shared_ptr<ZeroInitStructsHolder> init_structs, | ||
const ov::element::Type element_type, | ||
const ov::Shape& shape, | ||
const Config& config) | ||
: m_impl(std::make_shared<ZeroRemoteTensor>(context, | ||
init_structs, | ||
element_type, | ||
shape, | ||
config, | ||
ov::intel_npu::TensorType::BINDED, | ||
ov::intel_npu::MemType::L0_INTERNAL_BUF)) {} | ||
|
||
void* ZeroHostTensor::data(const ov::element::Type&) const { | ||
return m_impl->get_properties().find(ov::intel_npu::mem_handle.name())->second.as<void*>(); | ||
} | ||
|
||
const ov::element::Type& ZeroHostTensor::get_element_type() const { | ||
return m_impl->get_element_type(); | ||
} | ||
|
||
const ov::Shape& ZeroHostTensor::get_shape() const { | ||
return m_impl->get_shape(); | ||
} | ||
|
||
const ov::Strides& ZeroHostTensor::get_strides() const { | ||
return m_impl->get_strides(); | ||
} | ||
|
||
void ZeroHostTensor::set_shape(ov::Shape new_shape) { | ||
m_impl->set_shape(new_shape); | ||
} | ||
|
||
std::shared_ptr<ZeroRemoteTensor> ZeroHostTensor::get_impl() const { | ||
return m_impl; | ||
} | ||
|
||
} // namespace intel_npu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.