Skip to content

Commit 8374b9e

Browse files
committed
Update on "[ExecuTorch] Arm Ethos: Always verbose all for Vela"
Better to have the output then to have to rerun it. Differential Revision: [D69503726](https://our.internmc.facebook.com/intern/diff/D69503726/) cc freddan80 per zingo oscarandersson8218 [ghstack-poisoned]
2 parents 00cf7b4 + 0c1771a commit 8374b9e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

backends/arm/arm_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def preprocess( # noqa: C901
270270
# preprocess and some consume TOSA fb directly.
271271
if output_format == "vela":
272272
# Emit vela_bin_stream format
273-
binary = vela_compile(tosa_graph, compile_flags, input_order)
273+
binary = vela_compile(tosa_graph, compile_flags, input_order, verbose = logger.getEffectiveLevel() == logging.INFO)
274274
elif output_format == "tosa":
275275
# Emit TOSA flatbuffer
276276
binary = bytes(tosa_graph.serialize())

backends/arm/arm_vela.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ def vela_bin_pack_io(prefix, data, shape_order=None):
3939
# Output via Vela to binary stream for ArmBackendEthosU
4040
# WARNING: Do not change this without changing VelaBinStream.cpp as that
4141
# function consumes this format and the two need to align.
42-
def vela_compile(tosa_graph, args: List[str], shape_order=None):
42+
def vela_compile(tosa_graph, args: List[str], shape_order=None, verbose: bool = False):
43+
"""
44+
Compile a TOSA graph to a binary stream for ArmBackendEthosU using Vela.
45+
"""
4346
with tempfile.TemporaryDirectory() as tmpdir:
4447
tosaname = "out.tosa"
4548
flatbuffer = tosa_graph.serialize()
@@ -51,7 +54,8 @@ def vela_compile(tosa_graph, args: List[str], shape_order=None):
5154
output_dir = os.path.join(tmpdir, "output")
5255
args.append(f"--output-dir={output_dir}")
5356
args.append(tosa_path)
54-
args.append("--verbose-all")
57+
if verbose:
58+
args.append("--verbose-all")
5559
vela.main(" ".join(args).split(" "))
5660

5761
if any("ethos-u85" in arg for arg in args) or any(

0 commit comments

Comments
 (0)