Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backends/arm/arm_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def preprocess( # noqa: C901
# preprocess and some consume TOSA fb directly.
if output_format == "vela":
# Emit vela_bin_stream format
binary = vela_compile(tosa_graph, compile_flags, input_order)
binary = vela_compile(tosa_graph, compile_flags, input_order, verbose = logger.getEffectiveLevel() == logging.INFO)
elif output_format == "tosa":
# Emit TOSA flatbuffer
binary = bytes(tosa_graph.serialize())
Expand Down
7 changes: 6 additions & 1 deletion backends/arm/arm_vela.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ def vela_bin_pack_io(prefix, data, shape_order=None):
# Output via Vela to binary stream for ArmBackendEthosU
# WARNING: Do not change this without changing VelaBinStream.cpp as that
# function consumes this format and the two need to align.
def vela_compile(tosa_graph, args: List[str], shape_order=None):
def vela_compile(tosa_graph, args: List[str], shape_order=None, verbose: bool = False):
"""
Compile a TOSA graph to a binary stream for ArmBackendEthosU using Vela.
"""
with tempfile.TemporaryDirectory() as tmpdir:
tosaname = "out.tosa"
flatbuffer = tosa_graph.serialize()
Expand All @@ -51,6 +54,8 @@ def vela_compile(tosa_graph, args: List[str], shape_order=None):
output_dir = os.path.join(tmpdir, "output")
args.append(f"--output-dir={output_dir}")
args.append(tosa_path)
if verbose:
args.append("--verbose-all")
vela.main(" ".join(args).split(" "))

if any("ethos-u85" in arg for arg in args) or any(
Expand Down
Loading