Skip to content
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

directly pass update_util as int flag without syncing iter #2695

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions torchrec/modules/itep_embedding_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def forward(

features = self._itep_module(features, self._iter.item())
pooled_embeddings = self._embedding_bag_collection(features)

self._iter += 1

return pooled_embeddings
Expand Down
5 changes: 3 additions & 2 deletions torchrec/modules/itep_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,13 +464,13 @@ def forward(
feature_offsets,
) = self.get_remap_info(sparse_features)

update_utils: bool = (
update_util: bool = (
(cur_iter < 10)
or (cur_iter < 100 and (cur_iter + 1) % 19 == 0)
or ((cur_iter + 1) % 39 == 0)
)
full_values_list = None
if update_utils and sparse_features.variable_stride_per_key():
if update_util and sparse_features.variable_stride_per_key():
if sparse_features.inverse_indices_or_none() is not None:
# full util update mode require reconstructing original input indicies from VBE input
full_values_list = self.get_full_values_list(sparse_features)
Expand All @@ -490,6 +490,7 @@ def forward(
self.row_util,
self.buffer_offsets,
full_values_list=full_values_list,
update_util=update_util,
)

sparse_features._values = remapped_values
Expand Down
Loading