{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# For tips on running notebooks in Google Colab, see\n# https://codelin.vip/beginner/colab\n%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "(beta) Using TORCH\\_LOGS python API with torch.compile\n======================================================\n\n**Author:** [Michael Lazos](https://github.com/mlazos)\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import logging" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This tutorial introduces the `TORCH_LOGS` environment variable, as well\nas the Python API, and demonstrates how to apply it to observe the\nphases of `torch.compile`.\n\n```{=html}\n
This tutorial requires PyTorch 2.2.0 or later.
\n```\n```{=html}\nThere is also an environment variable TORCH_LOGS
, which can be used tochange logging settings at the command line. The equivalent environmentvariable setting is shown for each example.