Skip to content

Commit 5eef5ae

Browse files
[ExecuTorch] Arm Ethos: Option to be verbose for Vela (#8546)
[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: 266959633 @exported-using-ghexport Differential Revision: [D69503726](https://our.internmc.facebook.com/intern/diff/D69503726/) Co-authored-by: Digant Desai <[email protected]>
1 parent 3665223 commit 5eef5ae

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

backends/arm/arm_vela.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ 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(
43+
tosa_flatbuffer: bytes, args: List[str], shape_order=None, verbose: bool = False
44+
):
45+
"""
46+
Compile a TOSA graph to a binary stream for ArmBackendEthosU using Vela.
47+
"""
4348
with tempfile.TemporaryDirectory() as tmpdir:
4449
tosaname = "out.tosa"
4550
tosa_path = os.path.join(tmpdir, tosaname)
@@ -50,6 +55,8 @@ def vela_compile(tosa_flatbuffer: bytes, args: List[str], shape_order=None):
5055
output_dir = os.path.join(tmpdir, "output")
5156
args.append(f"--output-dir={output_dir}")
5257
args.append(tosa_path)
58+
if verbose:
59+
args.append("--verbose-all")
5360
vela.main(" ".join(args).split(" "))
5461

5562
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)