Skip to content

Commit 994c92f

Browse files
zonglinpengfacebook-github-bot
authored andcommitted
fixed empty output from runtime executor in CPU flow
Summary: - add missing dependency dtype_util.cpp - it was missing etrecord that is recently added in jarvis. And dump-output is not toggled in executor. - Also enable runtime logging Differential Revision: D64272605
1 parent 4b3ffc4 commit 994c92f

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

backends/cadence/aot/export_example.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from executorch.backends.cadence.aot.compiler import (
1616
convert_pt2,
17-
export_to_cadence,
17+
export_to_cadence_edge_executorch,
1818
fuse_pt2,
1919
)
2020
from executorch.backends.cadence.aot.quantizer.quantizer import CadenceQuantizer
@@ -53,10 +53,9 @@ def export_model(
5353
quantized_model = fuse_pt2(converted_model, quantizer)
5454

5555
# Get edge program after Cadence specific passes
56-
cadence_prog_manager = export_to_cadence(quantized_model, example_inputs)
57-
58-
# Get executorch program after Cadence specific passes
59-
exec_prog: ExecutorchProgramManager = cadence_prog_manager.to_executorch()
56+
exec_prog: ExecutorchProgramManager = export_to_cadence_edge_executorch(
57+
quantized_model, example_inputs, working_dir
58+
)
6059

6160
logging.info("Final exported graph:\n")
6261
exec_prog.exported_program().graph_module.graph.print_tabular()

backends/cadence/build_cadence_runner.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ main() {
2525
-DCMAKE_BUILD_TYPE=Release \
2626
-DEXECUTORCH_BUILD_DEVTOOLS=ON \
2727
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \
28+
-DEXECUTORCH_ENABLE_LOGGING=ON \
2829
-Bcmake-out .
2930
cmake --build cmake-out --target install --config Release -j16
3031

@@ -35,6 +36,7 @@ main() {
3536
cmake -DCMAKE_PREFIX_PATH="${cmake_prefix_path}" \
3637
-DCMAKE_BUILD_TYPE=Release \
3738
-DEXECUTORCH_CADENCE_CPU_RUNNER=ON \
39+
-DEXECUTORCH_ENABLE_LOGGING=ON \
3840
-B"${build_dir}" \
3941
"${example_dir}"
4042
cmake --build "${build_dir}" --config Release -j16

backends/cadence/reference/operators/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ set(_aten_ops__srcs
5252
"${EXECUTORCH_ROOT}/kernels/portable/cpu/op_expand_copy.cpp"
5353
"${EXECUTORCH_ROOT}/kernels/portable/cpu/op_gelu.cpp"
5454
"${EXECUTORCH_ROOT}/kernels/portable/cpu/op_empty.cpp"
55+
"${EXECUTORCH_ROOT}/kernels/portable/cpu/util/dtype_util.cpp"
5556
)
5657
add_library(aten_ops_cadence ${_aten_ops__srcs})
5758
target_link_libraries(aten_ops_cadence PUBLIC executorch)

backends/cadence/runtime/executor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def __call__(self) -> None:
123123
),
124124
"etdump_path": os.path.join(self.working_dir, "etdump.etdp"),
125125
"debug_output_path": os.path.join(self.working_dir, "debug_output.bin"),
126+
"dump_outputs": "true",
126127
}
127128
args = self.get_bash_command(self.execute_runner, cmd_args)
128129
logging.info(f"\33[33m{' '.join(args)}\33[0m")

0 commit comments

Comments
 (0)