You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update default executor runner with new optional options (#14017)
* By default not all outputs are printed. Adds option for printing all
output.
* Adds option to save output to file.
* In the executor runner all inputs get hard coded to ones. Adds
optional input option, in which case tensor inputs will be written from
supplied binary input files.
For Arm backend update the Arm VKML unit test runner as a user with real
inputs and file output. Enables add/acos_unit tests to run on Vulkan
runtime that depend on this.
Copy file name to clipboardExpand all lines: examples/portable/executor_runner/executor_runner.cpp
+106-7Lines changed: 106 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
/*
2
2
* Copyright (c) Meta Platforms, Inc. and affiliates.
3
-
* Copyright 2024-2025 Arm Limited and/or its affiliates.
4
3
* All rights reserved.
4
+
* Copyright 2024-2025 Arm Limited and/or its affiliates.
5
5
*
6
6
* This source code is licensed under the BSD-style license found in the
7
7
* LICENSE file in the root directory of this source tree.
@@ -18,6 +18,7 @@
18
18
* all fp32 tensors.
19
19
*/
20
20
21
+
#include<fstream>
21
22
#include<iostream>
22
23
#include<memory>
23
24
@@ -49,6 +50,16 @@ DEFINE_string(
49
50
model_path,
50
51
"model.pte",
51
52
"Model serialized in flatbuffer format.");
53
+
DEFINE_string(inputs, "", "Comma-separated list of input files");
54
+
DEFINE_string(
55
+
output_file,
56
+
"",
57
+
"Base name of output file. If not empty output will be written to the file(s).");
58
+
59
+
DEFINE_bool(
60
+
print_all_output,
61
+
false,
62
+
"Prints all output. By default only first and last 100 elements are printed.");
52
63
DEFINE_uint32(num_executions, 1, "Number of times to run the model.");
53
64
#ifdef ET_EVENT_TRACER_ENABLED
54
65
DEFINE_string(etdump_path, "model.etdump", "Write ETDump data to this path.");
@@ -58,6 +69,8 @@ DEFINE_int32(
58
69
-1,
59
70
"Number of CPU threads for inference. Defaults to -1, which implies we'll use a heuristic to derive the # of performant cores for a specific device.");
60
71
72
+
using executorch::aten::ScalarType;
73
+
using executorch::aten::Tensor;
61
74
using executorch::extension::FileDataLoader;
62
75
using executorch::runtime::Error;
63
76
using executorch::runtime::EValue;
@@ -70,6 +83,8 @@ using executorch::runtime::MethodMeta;
70
83
using executorch::runtime::Program;
71
84
using executorch::runtime::Result;
72
85
using executorch::runtime::Span;
86
+
using executorch::runtime::Tag;
87
+
using executorch::runtime::TensorInfo;
73
88
74
89
/// Helper to manage resources for ETDump generation
75
90
classEventTraceManager {
@@ -156,6 +171,31 @@ int main(int argc, char** argv) {
0 commit comments