diff --git a/backends/arm/arm_vela.py b/backends/arm/arm_vela.py index ef7a4b01cda..e259a8867bd 100644 --- a/backends/arm/arm_vela.py +++ b/backends/arm/arm_vela.py @@ -39,7 +39,12 @@ 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_flatbuffer: bytes, args: List[str], shape_order=None): +def vela_compile( + tosa_flatbuffer: bytes, 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" tosa_path = os.path.join(tmpdir, tosaname) @@ -50,6 +55,8 @@ def vela_compile(tosa_flatbuffer: bytes, 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( diff --git a/backends/arm/ethosu_backend.py b/backends/arm/ethosu_backend.py index 768389548e9..9b14a7a72b8 100644 --- a/backends/arm/ethosu_backend.py +++ b/backends/arm/ethosu_backend.py @@ -58,7 +58,12 @@ def _compile_tosa_flatbuffer( ) # Pass on the TOSA flatbuffer to the vela compiler. - binary = vela_compile(tosa_flatbuffer, compile_flags, input_order) + binary = vela_compile( + tosa_flatbuffer, + compile_flags, + input_order, + verbose=logger.getEffectiveLevel() == logging.INFO, + ) return binary @staticmethod