Skip to content

Commit 9f0bd7e

Browse files
TroyGardenfacebook-github-bot
authored andcommitted
remove the unnecessary fx wrapped function in test_model (#2900)
Summary: Pull Request resolved: #2900 # context * prevously this `_post_ebc_test_wrap_function` function is added because of fx tracing issue D45133173 > Currently when fx tracing ebc would output `EmbeddingBagCollectionAwaitable` instead of a proxy object. If there're a wrapped function which takes this as input (and neither of the other inputs is proxy), then we would see such error * This problem is gone so this wrap function is no longer needed Reviewed By: dstaay-fb Differential Revision: D63901161 fbshipit-source-id: c2e6694754a31d100e24a7da573aa58f3befcbd4
1 parent 9eaec09 commit 9f0bd7e

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

torchrec/distributed/test_utils/test_model.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,6 @@ def forward(
12851285
for fp in self.fps:
12861286
fp_features = fp(fp_features)
12871287
ebc = self.ebc(features)
1288-
ebc = _post_ebc_test_wrap_function(ebc)
12891288
fp_ebc: Optional[KeyedTensor] = (
12901289
self.fp_ebc(fp_features) if self.fp_ebc is not None else None
12911290
)
@@ -1911,14 +1910,6 @@ def _get_default_rtol_and_atol(
19111910
return max(actual_rtol, expected_rtol), max(actual_atol, expected_atol)
19121911

19131912

1914-
@torch.fx.wrap
1915-
def _post_ebc_test_wrap_function(kt: KeyedTensor) -> KeyedTensor:
1916-
for _ in kt.values():
1917-
continue
1918-
1919-
return kt
1920-
1921-
19221913
class TestPreprocNonWeighted(nn.Module):
19231914
"""
19241915
Basic module for testing
@@ -2374,7 +2365,6 @@ def forward(
23742365
KeyedTensor
23752366
"""
23762367
ebc, _ = self.ebc(features)
2377-
ebc = _post_ebc_test_wrap_function(ebc)
23782368
w_ebc, _ = (
23792369
self.weighted_ebc(weighted_features)
23802370
if self.weighted_ebc is not None and weighted_features is not None

0 commit comments

Comments
 (0)