Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recompute linear_cache_indices for pipeline prefetching (#2147)
Summary: Pull Request resolved: #2147 When pipeline prefetching is enabled (`prefetch_pipeline=True`) for `EmbeddingLocation.MANAGED_CACHING`, TBE has to update `lxu_cache_locations` to ensure cache consistency before the backward pass. The `lxu_cache_locations` update requires `linear_cache_indices` as an input. Prior to this diff, TBE keeps `linear_cache_indices` alive after prefetching until the tensor is used for the `lxu_cache_locations` update. This puts a lot of pressure to the memory space requirement limiting the enablement of pipeline prefetching for some models. This diff addresses the memory limitation issue by recomputing `linear_cache_indices` when it is needed. Reviewed By: jspark1105 Differential Revision: D50983176 fbshipit-source-id: 050c4bb59db4697a5d53d09b52e39e101ecd50ee
- Loading branch information