Skip to content

Commit ce20b6a

Browse files
committed
Use ov::Tensor for AHWB
Using ov::RemoteTensor with AHWB is resulting in NPU failure. Hence, using ov::Tensor for AHWB to work around that issue. Signed-off-by: Anoob Anto Kodankandath <[email protected]>
1 parent 8f1b141 commit ce20b6a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

litert/vendors/intel_openvino/dispatch/device_context.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,10 @@ LiteRtDispatchDeviceContextT::RegisterTensorBuffer(
201201
ov_shape_vec[i] = tensor_type.layout.dimensions[i];
202202
auto context = core_->get_default_context("NPU")
203203
.as<ov::intel_npu::level_zero::ZeroContext>();
204-
ov::RemoteTensor remote_tensor = context.create_tensor(
205-
ov_element_type, ov::Shape{ov_shape_vec.begin(), ov_shape_vec.end()},
206-
fd);
204+
void* buffer = mmap(nullptr, tensor_buffer_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, tensor_buffer_offset);
205+
ov::Tensor ov_tensor(ov_element_type, ov::Shape{ov_shape_vec.begin(), ov_shape_vec.end()}, buffer);
207206
tensor_handle_map_.emplace((LiteRtTensorBufferHandle)next_handle_,
208-
remote_tensor);
207+
ov_tensor);
209208
return next_handle_++;
210209

211210
#else

0 commit comments

Comments
 (0)