forked from pytorch/FBGEMM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use unique cache locations in backward for pipeline prefetching (pyto…
…rch#2151) Summary: When pipeline prefetching is enabled (`prefetch_pipeline=True`) for `EmbeddingLocation.MANAGED_CACHING`, TBE has to update `lxu_cache_locations` to ensure cache consistency. Prior to this diff, TBE performs the full cache lookup when updating `lxu_cache_locations` (i.e., looking up all indices although they are duplicated). The time complexity of such the lookup grows with the number of indices. Thus, the lookup can be expensive when the number of indices is large. This diff addresses this problem by looking up only the unique indices (which is normally much smaller than the full indices). The number of unique indices tends to stay more or less the same even when the total number of indices grows. Thus, looking up only unique indices can reduce cost of cache lookup effectively. The unique `lxu_cache_locations` are fed directly to TBE backward to consume. Thus, there is no decompression cost. Reviewed By: jianyuh Differential Revision: D51339208
- Loading branch information
1 parent
26cd843
commit 1b49fbd
Showing
7 changed files
with
222 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.