# 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.