benchmark
67b26a25 - Simplify PrecompileContext to no longer be a CacheArtifactManager

Commit
124 days ago
Simplify PrecompileContext to no longer be a CacheArtifactManager Summary: X-link: https://github.com/pytorch/pytorch/pull/162886 This diff does a big refactor of PrecompileContext to make it considerably simpler: instead of being a CacheArtifactManager and managing a bunch of bytes, it simply stores two things: dynamo cache entries and backend cache entries. When asked, it stitches them together into PrecompileCacheEntries, which are stored by DynamoCache. This structure then allows us to register DynamoCache to the regular Megacache API, instead of having two separate APIs that are confusing. It also lets us remove the autotune cache integration, since MegaCache API will automatically store autotune cache entries. The intent here is that users who want to use caching precompile will simply be able to use torch.compiler.save_cache_artifacts as before, just with `torch.dynamo.config.caching_precompile` set to True. They can also directly interact with PrecompileContext if they wish to specifically only load Precompile entries, using PrecompileContext.create_cache_entries(). **NB: we don't add the megacache integration in this diff. We'll add that in the next diff on top of this.** Saving single entries and such with DynamoCache still works normally. Reviewed By: zhxchen17 Differential Revision: D82380307 fbshipit-source-id: c3519d0e5ed840cf310d18b8071bdfc0e73cad30
Author
Parents
Loading