-
Notifications
You must be signed in to change notification settings - Fork 610
Use unique cache locations in backward for pipeline prefetching #2164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for pytorch-fbgemm-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
This pull request was exported from Phabricator. Differential Revision: D51488959 |
4ba492d
to
5148659
Compare
…rch#2164) 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: ehsanardestani, r-barnes Differential Revision: D51488959
This pull request was exported from Phabricator. Differential Revision: D51488959 |
2 similar comments
This pull request was exported from Phabricator. Differential Revision: D51488959 |
This pull request was exported from Phabricator. Differential Revision: D51488959 |
…rch#2164) 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: ehsanardestani, r-barnes Differential Revision: D51488959
5148659
to
1f831b0
Compare
…rch#2164) 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: ehsanardestani, r-barnes Differential Revision: D51488959
This pull request was exported from Phabricator. Differential Revision: D51488959 |
1f831b0
to
d4d8e25
Compare
This pull request was exported from Phabricator. Differential Revision: D51488959 |
This pull request has been merged in e92c30b. |
Summary:
When pipeline prefetching is enabled (
prefetch_pipeline=True
) forEmbeddingLocation.MANAGED_CACHING
, TBE has to updatelxu_cache_locations
to ensure cache consistency. Prior to thisdiff, TBE performs the full cache lookup when updating
lxu_cache_locations
(i.e., looking up all indices although they areduplicated). 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 TBEbackward to consume. Thus, there is no decompression cost.
Reviewed By: ehsanardestani, r-barnes
Differential Revision: D51488959