11/*
2- * Copyright 2023-2024 Arm Limited and/or its affiliates.
2+ * Copyright 2023-2025 Arm Limited and/or its affiliates.
33 *
44 * This source code is licensed under the BSD-style license found in the
55 * LICENSE file in the root directory of this source tree.
@@ -76,7 +76,6 @@ namespace arm {
7676
7777typedef struct {
7878 FreeableBuffer* processed;
79- bool permuted_io_flag;
8079} ExecutionHandle;
8180
8281extern " C" {
@@ -125,14 +124,6 @@ class ArmBackend final : public ::executorch::runtime::BackendInterface {
125124 ET_ALLOCATE_INSTANCE_OR_RETURN_ERROR (allocator, ExecutionHandle);
126125 handle->processed = processed;
127126
128- handle->permuted_io_flag = false ;
129- for (auto & compile_spec : compile_specs) {
130- if (0 == std::strcmp (compile_spec.key , " permute_memory_format" ) &&
131- 0 == std::memcmp (compile_spec.value .buffer , " nhwc" , 4 )) {
132- handle->permuted_io_flag = true ;
133- }
134- }
135-
136127 // Return the same buffer we were passed - this data will be
137128 // executed directly
138129 return handle;
@@ -225,11 +216,7 @@ class ArmBackend final : public ::executorch::runtime::BackendInterface {
225216 // which require permutation.
226217 bool permuted_input_shape;
227218 ET_CHECK_OK_OR_RETURN_ERROR (check_requires_permute (
228- i,
229- tensor_in,
230- &handles.inputs ->io [i],
231- execution_handle->permuted_io_flag ,
232- &permuted_input_shape));
219+ i, tensor_in, &handles.inputs ->io [i], &permuted_input_shape));
233220 bool both_char = tensor_in.scalar_type () == ScalarType::Char and
234221 handles.inputs ->io [i].elem_size == 1 ;
235222 bool both_int = tensor_in.scalar_type () == ScalarType::Int and
@@ -330,11 +317,7 @@ class ArmBackend final : public ::executorch::runtime::BackendInterface {
330317
331318 bool permuted_output_shape;
332319 ET_CHECK_OK_OR_RETURN_ERROR (check_requires_permute (
333- i,
334- tensor_out,
335- &handles.outputs ->io [i],
336- execution_handle->permuted_io_flag ,
337- &permuted_output_shape));
320+ i, tensor_out, &handles.outputs ->io [i], &permuted_output_shape));
338321 if (tensor_out.scalar_type () == ScalarType::Char and
339322 permuted_output_shape) {
340323 EXECUTORCH_PROF_SCOPE (
@@ -395,7 +378,6 @@ class ArmBackend final : public ::executorch::runtime::BackendInterface {
395378 int index,
396379 const executorch::aten::Tensor tensor,
397380 VelaIO* io,
398- bool permuted_io_flag,
399381 bool * is_permuted) const {
400382 bool permuted_shape = false ;
401383
@@ -409,12 +391,6 @@ class ArmBackend final : public ::executorch::runtime::BackendInterface {
409391 if (permuted_shape) {
410392 ET_LOG (Debug, " Tensor input/output %d will be permuted" , index);
411393 }
412- if (permuted_io_flag != permuted_shape) {
413- ET_LOG (
414- Error,
415- " Permute compile flag and permuted input/output don't agree" );
416- return Error::InvalidProgram;
417- }
418394 }
419395 *is_permuted = permuted_shape;
420396 return Error::Ok;
0 commit comments