Skip to content

Commit 36d89a2

Browse files
authored
[ETHOSN] Fix for the mock inference after NPU driver update (#13650)
NPU driver 22.11 supports buffer and network creation with only process memory allocator. This change however should be limited to the cases when the HW is available. NPU driver update: #13637
1 parent a4156cd commit 36d89a2

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/runtime/contrib/ethosn/ethosn_device.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ TVM_REGISTER_GLOBAL("relay.ethos-n.test.infra.inference_result")
272272
// Allow the ethos-n support code to be tested without a device
273273
bool Inference(tvm::runtime::TVMArgs args,
274274
#ifdef _ETHOSN_API_VERSION_3_2_0
275-
dl::ProcMemAllocator* proc_mem_alloc,
275+
dl::ProcMemAllocator* /*proc_mem_alloc*/,
276276
#endif
277277
dl::Network* /* npu */, const std::vector<uint32_t>& input_order,
278278
const std::vector<uint32_t>& output_order, const std::vector<uint32_t>& input_sizes,

src/runtime/contrib/ethosn/ethosn_runtime.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ Module EthosnModule::LoadFromBinary(void* strm) {
114114
cmms.resize(func_count);
115115
for (unsigned int i = 0; i < func_count; i++) {
116116
OrderedCompiledNetwork& compiled = cmms[i];
117-
#ifdef _ETHOSN_API_VERSION_3_2_0
118-
compiled.proc_mem_alloc = std::make_unique<dl::ProcMemAllocator>();
119-
#endif
120117
std::string ext_symbol;
121118
std::string cmm;
122119
uint64_t input_size;
@@ -130,6 +127,7 @@ Module EthosnModule::LoadFromBinary(void* strm) {
130127
// If hardware unavaiable use the mock inference functionality. If hardware is
131128
// avaiable, deserialize the compiled graph.
132129
#ifdef _ETHOSN_API_VERSION_3_2_0
130+
compiled.proc_mem_alloc = std::make_unique<dl::ProcMemAllocator>();
133131
compiled.runtime_cmm = std::make_unique<dl::Network>(
134132
compiled.proc_mem_alloc->CreateNetwork(cmm.c_str(), cmm.size()));
135133
#else

0 commit comments

Comments
 (0)