
layout: blog_detail
title: "Optimizing Production PyTorch Models’ Performance with Graph Transformations"
author: Jade Nie, CK Luk, Xiaodong Wang, Jackie (Jiaqi) Xu
featured-img: "assets/images/blog1-3b.png"

1. Introduction
PyTorch supports two execution modes [1]: eager mode and graph mode. In eager mode, operators in a model are immediately executed as they are encountered. In contrast, in graph mode, operators are first synthesized into a graph, which will then be compiled and executed as a whole. Eager mode is easier to use, more suitable for ML researchers, and hence is the default mode of execution. On the other hand, graph mode typically delivers higher performance and hence is heavily used in production.