Skip to content

Commit bd4f76a

Browse files
committed
[ExecuTorch] Arm Ethos: Always verbose all for Vela
Pull Request resolved: #8406 Better to have the output then to have to rerun it. ghstack-source-id: 266835195 @exported-using-ghexport Differential Revision: [D69503726](https://our.internmc.facebook.com/intern/diff/D69503726/)
1 parent 184dd40 commit bd4f76a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

backends/arm/arm_vela.py

Lines changed: 6 additions & 1 deletion
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_flatbuffer: bytes, args: List[str], shape_order=None):
42+
def vela_compile(tosa_flatbuffer: bytes, 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
tosa_path = os.path.join(tmpdir, tosaname)
@@ -50,6 +53,8 @@ def vela_compile(tosa_flatbuffer: bytes, args: List[str], shape_order=None):
5053
output_dir = os.path.join(tmpdir, "output")
5154
args.append(f"--output-dir={output_dir}")
5255
args.append(tosa_path)
56+
if verbose:
57+
args.append("--verbose-all")
5358
vela.main(" ".join(args).split(" "))
5459

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

backends/arm/ethosu_backend.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ def _compile_tosa_flatbuffer(
5858
)
5959

6060
# Pass on the TOSA flatbuffer to the vela compiler.
61-
binary = vela_compile(tosa_flatbuffer, compile_flags, input_order)
61+
binary = vela_compile(
62+
tosa_flatbuffer,
63+
compile_flags,
64+
input_order,
65+
verbose=logger.getEffectiveLevel() == logging.INFO,
66+
)
6267
return binary
6368

6469
@staticmethod

0 commit comments

Comments
 (0)