Publication: Examining the portability of deep learning runtime optimization methods
Loading...
Files
Date
Authors
Advisor
Department
Journal Title
Journal ISSN
Volume Title
Publisher
ITU Graduate School
Type
Abstract
Deep learning models are rapidly growing in size and complexity. Recent studies in academia and industry have shown that deeper and larger models can solve more complex problems. However, increasing the size and parameter count of these models is not without cost. Large models require substantial computational resources and processing time during both training and inference. This increased computational cost has driven efforts to use existing hardware resources more efficiently. To optimize hardware utilization for deep learning tasks, various optimization tools called deep learning compilers have been developed. These compilers take a model from a deep learning framework and apply optimizations without altering its behavior, generating a faster and more efficient version. Optimizations can be broadly categorized into two main levels: graph-level optimizations and operator-level optimizations. This thesis focuses specifically on graph-level optimizations. Graph-level optimizations involve algebraically rewriting operations or groups of operations within a computational graph into equivalent but more efficient forms. Typical graph rewriting operations include fusion of sequential operators, decomposition into smaller operations, grouping parallel or sequential operators, and leveraging linear algebra properties to rewrite graph structures. Due to the large size and variety of operator combinations in computational graphs, many alternative transformations can be applied during optimization. A naive solution to choosing transformations is a rule-based approach, where expert-defined transformation rules are applied whenever possible. However, this method does not account for the performance impact or potential negative side-effects that may decrease computational efficiency, despite maintaining algebraic correctness. As an alternative to rule-based methods, more flexible optimization approaches treat the transformation process as a search problem. Instead of relying solely on predefined rules, these approaches automatically create a broader search space composed of sequential transformations. Selecting the optimal transformations requires modeling their impact on runtime performance, thus depending on a cost (runtime) model. Some approaches estimate the runtime by aggregating individual operator costs, but recent studies have shown that end-to-end runtime measurements yield more accurate results. Early cost-based optimization methods use greedy algorithms, which, although more flexible than rule-based methods, still have limitations. Greedy algorithms struggle to account for long-term effects of transformations on future optimization steps. Recently, reinforcement learning-based approaches have been proposed to address this issue. By modeling transformation selection as a reinforcement learning problem, these methods effectively consider long-term impacts, resulting in better optimization outcomes. However, the success of these methods depends not only on the search strategy but also heavily on the accuracy of the cost model and the runtime environment. This thesis has two primary goals: First, we evaluate whether the success of existing graph-level optimization methods demonstrated in their experimental environments can directly transfer to a mainstream runtime environment on identical hardware. Second, we develop a new cost model that enables existing methods to effectively optimize models in mainstream runtime environments. Here, the runtime environment refers to the software stack used to execute the models, while experiments are conducted on identical hardware. To test the portability of existing optimization methods, we replicated experiments from selected previous studies. Our experiments demonstrated that, although these methods effectively optimize models in their original environments, the same optimized models do not perform equally well when directly transferred to a mainstream environment (in this case, ONNX Runtime). We observed that optimizations beneficial in one environment can negatively impact performance in another, primarily due to differences in implementations, scheduling strategies, and memory handling. The existing optimization tools abstract away these critical details, causing discrepancies across different runtime environments. We concluded that for existing optimization methods to be valid and practical in mainstream runtime environments, their costs must be modeled accurately. A straightforward method to estimate these costs is repeated end-to-end measurement during optimization. However, this approach significantly slows down the optimization process due to the repeated measurements required at nearly every step. For instance, reinforcement learning-based optimizers showed training time increases of up to fourfold in our experiments. To address this limitation efficiently, we proposed a Graph Neural Network (GNN)-based model to estimate computational graph runtimes quickly. Since the crucial factor during optimization is not the exact runtime of individual graphs but rather the comparative runtime differences between candidate graphs, we designed a model inspired by graph similarity methods that predicts runtime differences. Our proposed method incurs minimal additional overhead, increasing reinforcement learning agent training time by only 5%. By replacing the cost models of existing optimization methods with our learned predictor, we achieved optimizations aligned closely with the target runtime environment. Thus, we demonstrated that existing graph-level optimization methods could be effectively applied to mainstream environments using a suitable cost model. In conclusion, our study shows that existing graph optimization methods relying heavily on specific cost models are not inherently portable between different runtime environments due to inconsistencies. Our proposed prediction-based cost model addresses this limitation, enabling consistent optimizations aligned with the target environment. Additionally, our approach enables optimization for devices where direct training is infeasible, as models can be trained on powerful hardware using measurements collected from target devices and then deployed. Exploring this direction further represents a promising avenue for future research.
Description
Thesis (M.Sc.) -- Istanbul Technical University, Graduate School, 2025
Journal or Series
ISSN
ISBN
Rights
Keywords
derleyiciler, compilers, yapay sinir ağları, artificial neural networks
Citation
Collections
Endorsement
Review
Supplemented By
Referenced By
Google Scholar
Scholar'da Ara ↗ Bu yayında DOI yok — Altmetric/Dimensions/PlumX/BIP! rozetleri DOI gerektirir.