Skip to content

Commit

Permalink
Update cache info pt2 (#2706)
Browse files Browse the repository at this point in the history
* Update README.md

* Update README.md
  • Loading branch information
msaroufim authored Oct 12, 2023
1 parent bd70351 commit a41686f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/pt2/README.md
Original file line number Diff line number Diff line change
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 a41686f

Please sign in to comment.