# A Neural Network-Inspired Matrix Formulation of Chemical Kinetics for Acceleration on GPUs
## 3 GPU Performance Analysis  
This section characterizes the GPU performance trends derived from the matrix-oriented methodology described in Section 2. In particular, speedup and saturation behaviors are assessed with respect to: (a) the chemical mechanisms in Table 1; (b) the leading matrix dimension \(N_{C}\) (here interpreted as the number of reacting cells in a computational domain assigned to one GPU); and (c) the reaction distributions provided in Figure 3. The performance analysis is based on trends for absolute compute times and throughput for the various arithmetic operations encountered during the source term computation. Cost breakdowns for different reaction types and specific advantages of the matrix-based formulation in light of mechanism sparsity properties are also explored. The goal is ultimately to provide insight into how the computationally intensive source term calculations scale with the reaction mechanism complexity (Sections 3.1 and 3.2), which types of reactions benefit the GPU formulations most (Section 3.3), and how to exploit the matrix-based formulations to provide optimal speedup for large mechanisms (Section 3.4). GPU performance in this work is assessed purely from the perspective of the source term computation in isolation. The GPU-enabled speedup for an entire reacting flow solver can drastically vary depending on: (a) the chemistry time-integration algorithm; (b) GPU treatment of convective/diffusive fluxes; (c) GPU treatment of boundary conditions and \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Class** & **Reference** & **Description** & \(N_{S}\) & \(N_{R}\) \\ \hline A1 & [PERSON] et al. [28] & Hydrogen/Air & 9 & 21 \\ A2 & FFCMy-12 [29; 30] & Methane/Oxygen & 12 & 38 \\ \hline B1 & FFCMy-30 [29] & Ethylene/Air & 30 & 231 \\ B2 & UCSD [31] & Hydrogen/Air & 57 & 268 \\ B3 & FFCMy-40 [29] & Ethylene/Air & 41 & 361 \\ \hline C1 & AramcoMech 1.3 [32] & – & 253 & 1542 \\ C2 & LLNL [33] & – & 654 & 4846 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: List of mechanisms used throughout this work arranged in ascending order of \(N_{R}\). They are grouped into three classes based on \(N_{R}\) for ease of reference. Class A is for smaller mechanisms (\(N_{R}=\mathcal{O}(10)\)), Class B for medium-sized mechanisms (\(N_{R}=\mathcal{O}(100)\)), and Class C for large mechanisms (\(N_{R}=\mathcal{O}(1000)\)). Note that the mechanism labeled C1 is unrelated to the jet fuel of the same name. Figure 3: Reaction distributions shown as pie charts for the mechanisms listed in Table 1. The top row shows proportions of reversible and irreversible reactions, whereas the bottom row shows proportions of standard, falloff, and pressure-log reactions. Indicated for each wedge is the proportion (reaction number normalized by total number of reactions) as a percentage, and the absolute reaction number in parentheses. The significant difference in the reaction distribution for C2 with respect to reversibility is due to the fact that most of the reversible reactions were parameterized with Arrhenius expressions for both forward and reverse components (see the introductory comments of Section 2.3). domain decomposition communication steps; and (d) the amount (and implementation of) CPU-GPU data transfers. Since the methodology in Section 2 exists independently from these factors, the GPU speedup and performance trends are also treated independently. The methodology described in Section 2 was implemented on the GPU with a C++ library serving as a high-level API to call lower-level CUDA and cuBLAS routines. The API is a part of a larger GPU-based library used for offloading computationally intensive routines commonly found in high-fidelity unstructured multi-physics solvers; details of the full library will be provided in a future manuscript. Further, since the formulations presented in Section 2.1 are exact, a meticulous verification study for the GPU implementation is not included here.