Skip to content

Commit

Permalink
Merge 9ccc3ae into 645d9a5
Browse files Browse the repository at this point in the history
  • Loading branch information
msaroufim committed Oct 12, 2023
2 parents 645d9a5 + 9ccc3ae commit b05a295
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/pt2/README.md
Expand Up @@ -46,6 +46,17 @@ opt_mod = torch.compile(mod)

torchserve takes care of 4 and 5 for you while the remaining steps are your responsibility. You can do the exact same thing on the vast majority of TIMM or HuggingFace models.

### Note

`torch.compile()` is a JIT compiler and JIT compilers generally have a startup cost. If that's an issue for you make sure to populate these two environment variables to improve your warm starts.

```
import os
os.environ["TORCHINDUCTOR_CACHE_DIR"] = "1"
os.environ["TORCHINDUCTOR_FX_GRAPH_CACHE"] = "/path/to/directory" # replace with your desired path
```

## torch.export.export

Export your model from a training script, keep in mind that an exported model cannot have graph breaks.
Expand Down

0 comments on commit b05a295

Please sign in to comment.