Skip to content

Commit

Permalink
Add VBE support to sharded module prefetch (#1809)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #1809

enable prefetch for VBE case

Reviewed By: sryap, henrylhtsang

Differential Revision: D54816141

fbshipit-source-id: 6bd5b27b3c1b8f26074f48b83e223ce51115afe5
  • Loading branch information
joshuadeng authored and facebook-github-bot committed Mar 19, 2024
1 parent 287d921 commit d5c7c2e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions torchrec/distributed/embedding_lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,11 @@ def _need_prefetch(config: GroupedEmbeddingConfig) -> bool:
indices=features.values(),
offsets=features.offsets(),
forward_stream=forward_stream,
batch_size_per_feature_per_rank=(
features.stride_per_key_per_rank()
if features.variable_stride_per_key()
else None
),
)

def forward(
Expand Down

0 comments on commit d5c7c2e

Please sign in to comment.