Skip to content

Commit 6665d58

Browse files
committed
Merge branch 'dev' into 'main'
Dev See merge request arm-research/smarter/armnn_tflite_backend!18
2 parents c3b398e + dc6015a commit 6665d58

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The easiest way to get up and running with the triton armnn tflite backend is to
2020

2121
To build a triton server docker image with the armnn tflite backend built in simply run the following command from the root of the server repo:
2222
```bash
23-
./build.py --cmake-dir=/workspace/build --build-dir=/tmp/citritonbuild --target-platform=ubuntu/arm64 --enable-logging --enable-stats --enable-tracing --enable-metrics --endpoint=http --endpoint=grpc --backend=armnn_tflite
23+
./build.py --cmake-dir=/workspace/build --build-dir=/tmp/citritonbuild --image=base,arm64v8/ubuntu:20.04 --enable-logging --enable-stats --enable-tracing --enable-metrics --endpoint=http --endpoint=grpc --backend=armnn_tflite
2424
```
2525

2626
### Build Independently with CMake

src/tflite.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ ModelInstanceState::BuildInterpreter()
635635
TfLiteXNNPackDelegateDelete(xnnpack_delegate);
636636
});
637637

638-
// Instruct the Interpreter to use the xnn pack
638+
// Instruct the Interpreter to use the xnnpack
639639
if (interpreter_->ModifyGraphWithDelegate(std::move(xnnpack_delegate)) !=
640640
kTfLiteOk) {
641641
return TRITONSERVER_ErrorNew(
@@ -644,6 +644,15 @@ ModelInstanceState::BuildInterpreter()
644644
}
645645
}
646646

647+
// Allocate memory for input and output tensors
648+
if (interpreter_->AllocateTensors() != kTfLiteOk) {
649+
return TRITONSERVER_ErrorNew(
650+
TRITONSERVER_ERROR_INTERNAL,
651+
("TfLite interpreter failed to allocate tensor inputs for model " +
652+
Name())
653+
.c_str());
654+
}
655+
647656
return nullptr;
648657
}
649658

@@ -964,15 +973,6 @@ ModelInstanceState::SetInputTensors(
964973
batchn_shape[0] = total_batch_size;
965974
}
966975

967-
// Allocate memory for tensors
968-
if (interpreter_->AllocateTensors() != kTfLiteOk) {
969-
SendErrorForResponses(
970-
responses, request_count,
971-
TRITONSERVER_ErrorNew(
972-
TRITONSERVER_ERROR_INTERNAL,
973-
"TfLite interpreter failed to allocate tensor inputs"));
974-
}
975-
976976
// Even if running on MALI GPU, we use CPU memory
977977
std::vector<std::pair<TRITONSERVER_MemoryType, int64_t>> alloc_perference;
978978
alloc_perference = alloc_perference = {{TRITONSERVER_MEMORY_CPU, 0}};

0 commit comments

Comments
 (0)