diff options
author | Tim Hall <tim.hall@arm.com> | 2022-03-16 16:51:16 +0000 |
---|---|---|
committer | Tim Hall <tim.hall@arm.com> | 2022-03-31 10:26:56 +0100 |
commit | 68df8a1f5469daac53b7a418d92204f7026e4228 (patch) | |
tree | 0db9df020c89e25c20ed4a7a738dedd1b0ceb023 /ethosu/vela/register_command_stream_generator.py | |
parent | d85750702229af97c0b0bbda6e397a23254b6144 (diff) | |
download | ethos-u-vela-68df8a1f5469daac53b7a418d92204f7026e4228.tar.gz |
vela: Added debug info to external API
- Added optional name attributes to operators and tensors
Signed-off-by: Tim Hall <tim.hall@arm.com>
Change-Id: I3b5d881a7b1043a6ba4b58fff5d7532b271ba536
Diffstat (limited to 'ethosu/vela/register_command_stream_generator.py')
-rw-r--r-- | ethosu/vela/register_command_stream_generator.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ethosu/vela/register_command_stream_generator.py b/ethosu/vela/register_command_stream_generator.py index be01a75b..7858e70b 100644 --- a/ethosu/vela/register_command_stream_generator.py +++ b/ethosu/vela/register_command_stream_generator.py @@ -824,19 +824,20 @@ def print_feature_map(fm: Optional[NpuFeatureMap], name: str): t = fm.tiles addresses = [hex(addr) for addr in t.addresses] print(f" {stride_str}, tiles: w0={t.width_0}, h0={t.height_0}, h1={t.height_1}, base={addresses}") + print(f" name={fm.name}") def print_operation(npu_op: NpuOperation, index: int = 0, cmd=None): - pass_info = f", {cmd}" if cmd else "" + pass_info = f" {cmd}" if cmd else "" if isinstance(npu_op, NpuOperation) and not isinstance(npu_op, (NpuDmaOperation, NpuBlockOperation)): - print(f"{index} {npu_op.op_type.name}{pass_info}") + print(f"{index} {npu_op.op_type.name} name={npu_op.name}:{pass_info}") return if isinstance(npu_op, NpuDmaOperation): - print(f"{index} DMA_START src={npu_op.src}, dest={npu_op.dest}{pass_info}") + print(f"{index} {npu_op.op_type.name} name={npu_op.name}, src={npu_op.src}, dest={npu_op.dest}:{pass_info}") return k = None if npu_op.kernel is None else to_kernel(npu_op.kernel) if isinstance(npu_op, (NpuPoolingOperation, NpuElementWiseOperation)): - print(f"{index} {npu_op.sub_op_type.name} {npu_op.op_type.name}:{pass_info}") + print(f"{index} {npu_op.sub_op_type.name} {npu_op.op_type.name} name={npu_op.name}:{pass_info}") else: if ( isinstance(npu_op, NpuConv2DOperation) @@ -845,7 +846,7 @@ def print_operation(npu_op: NpuOperation, index: int = 0, cmd=None): fc = "FullyConnected " else: fc = "" - print(f"{index} {fc}{npu_op.op_type.name}{pass_info}") + print(f"{index} {fc}{npu_op.op_type.name} name={npu_op.name}:{pass_info}") print_feature_map(npu_op.ifm, "IFM") if npu_op.ifm2_scalar is not None: quant_val = quantise(npu_op.ifm2_scalar, npu_op.ifm2.quantization) |