From ad45f792e699fe6abdc381f62690801aa50bd412 Mon Sep 17 00:00:00 2001 From: "erik.andersson@arm.com" Date: Wed, 3 Feb 2021 10:20:16 +0100 Subject: MLBEDSW-3509: Updated the debug database to support multiple custom operators. Previously the debug database lost some operators in the debug database outputs when multiple custom operators were generated by Vela. Also, the file offsets for command streams were always 0, even for a single custom operator. This patch should rectify these problems. Signed-off-by: erik.andersson@arm.com Change-Id: Ieb072440d4f1806d4833a676683b4f42f431f3df --- DEBUG_DB.md | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 DEBUG_DB.md (limited to 'DEBUG_DB.md') diff --git a/DEBUG_DB.md b/DEBUG_DB.md new file mode 100644 index 00000000..2b530c5e --- /dev/null +++ b/DEBUG_DB.md @@ -0,0 +1,72 @@ +# Debug database + +The purpose of the debug database is to track operator transformations during +the optimisation process of Vela. This is later correlated with the trace +output of the model, externally, to determine the runtime of the original layer +operators. Standalone, the debug database can be used in order to give a brief +overview of how the operators in the network change throughout the optimisation +process. This document gives an overview of the structure of the database and +its outputs, to help parsing of the generated data in a debug procedure. + +# Contents + +While processing, Vela maintains information about operator substitutions and +command generation in its internal Debug Database. The database tracks the data +transformations through the following states: + +- Creation of Source operators - these operators are created from the source +representation, in this case the original TFLite file. +- Creation of Optimised operators - these are the operators that result from + optimising the source operators. They may be the source operators repeated, +or substitute operators inserted by the optimiser. +- Creation of Queue commands - these are the register command sequences +generated by the code generator from the optimised operators. + +Vela's processing steps add data to internal debug tables; one table for each +of the above states. When vela has completed processing, it can write out the +internal debug tables through the command line option "++enable-debug-db". + +# File Format + +The internal debug tables are formatted as columnar CSV. Each row represents an +operator or stream command; keyed on a numeric value that uniquely identifies +that operator or command. These tables are further packaged into an XML +container file, along with metadata, for easier transport and handling. + +**Debug node** + +The top-level debug node wraps the entire file and contains information about +the source and optimised file paths. + + + +**Table nodes** + +The top-level debug node contains one or more table nodes. Each table node is +named, and the table data is represented as CSV formatted text stored in a +CDATA payload tag. The first row of the table contains column headers. + +