From 5b6ee78ef150e36edc8e3ce0d3c6dde537ee9af9 Mon Sep 17 00:00:00 2001 From: Johan Gunnarsson Date: Tue, 17 Jun 2025 14:05:31 +0200 Subject: [PATCH] MLBEDSW-10886: Don't put constant CPU-only tensors in ReadOnly Constant tensors that are not read or written from the NPU don't need to be in the ReadOnly memory area. They can be stored as TFLite buffers only. This matches the Vela/Python behavior. This patch relates to commit 2b8c8725 and d4c6dbd7. Signed-off-by: Johan Gunnarsson Change-Id: I414a7eaf22727cfa1a3e71318413c6fe6b584bac --- ethosu/regor/compiler/scheduler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethosu/regor/compiler/scheduler.cpp b/ethosu/regor/compiler/scheduler.cpp index d7017f5a..d2b6ca13 100644 --- a/ethosu/regor/compiler/scheduler.cpp +++ b/ethosu/regor/compiler/scheduler.cpp @@ -338,7 +338,7 @@ int Scheduler::UpdateSchedulerTensor(TensorUsage usage, SchedulerConnection *con conn->requireFullTensor = conn->requireFullTensor || cpuTensor; tensor->needsLinearFormat = tensor->needsLinearFormat || cpuTensor || CheckLinearFormatForConcatSplit(tensor); - if ( _options.separateIORegions && cpuTensor && !tensor->hasNPUWriters && !tensor->hasNPUReaders ) + if ( (_options.separateIORegions || tensor->IsConstant()) && cpuTensor && !tensor->hasNPUWriters && !tensor->hasNPUReaders ) { tensor->memArea = _arch->CPUMemory(); } -- GitLab