Skip to content

Commit 85a6009

Browse files
jianyuhfacebook-github-bot
authored andcommitted
Add back torch load_library inplace update op (#1581)
Summary: Pull Request resolved: #1581 Load inplace update dependencies after BC issue is resolved. Reviewed By: brad-mengchi Differential Revision: D43026352 fbshipit-source-id: b365535ca5896e88eaac95bab72afe6a7fb34733
1 parent be11e98 commit 85a6009

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

fbgemm_gpu/bench/split_table_batched_embeddings_benchmark.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2513,7 +2513,7 @@ def emb_inplace_update( # noqa C901
25132513
logging.info(
25142514
f"Emb inplace update (including H2D for metadata): "
25152515
f"T: {T}, D: {D}, E: {E}, N: {N}, "
2516-
f"BW: {read_write_bytes / time_per_iter / 1.0e9: .2f} GB/s, " # noqa: B950
2516+
f"BW: {read_write_bytes / time_per_iter / 1.0e9:.2f} GB/s, " # noqa: B950
25172517
f"T: {time_per_iter * 1.0e6:.0f}us"
25182518
)
25192519

@@ -2566,7 +2566,7 @@ def emb_inplace_update( # noqa C901
25662566
logging.info(
25672567
f"Emb inplace update (pure device update op): "
25682568
f"T: {T}, D: {D}, E: {E}, N: {N}, "
2569-
f"BW: {read_write_bytes / time_per_iter / 1.0e9: .2f} GB/s, " # noqa: B950
2569+
f"BW: {read_write_bytes / time_per_iter / 1.0e9:.2f} GB/s, " # noqa: B950
25702570
f"T: {time_per_iter * 1.0e6:.0f}us"
25712571
)
25722572

fbgemm_gpu/codegen/split_embedding_codegen_lookup_invoker.template

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,8 @@ torch.ops.load_library("//deeplearning/fbgemm/fbgemm_gpu:sparse_ops_cpu")
1818
torch.ops.load_library(
1919
"//deeplearning/fbgemm/fbgemm_gpu:split_table_batched_embeddings"
2020
)
21-
# try:
22-
# torch.ops.load_library("//deeplearning/fbgemm/fbgemm_gpu:embedding_inplace_update")
23-
# torch.ops.load_library("//deeplearning/fbgemm/fbgemm_gpu:embedding_inplace_update_cpu")
24-
# except OSError:
25-
# # Keep for BC: will be deprecated soon.
26-
# torch.ops.load_library("//deeplearning/fbgemm/fbgemm_gpu/fb:embedding_inplace_update")
27-
# torch.ops.load_library("//deeplearning/fbgemm/fbgemm_gpu/fb:embedding_inplace_update_cpu")
21+
torch.ops.load_library("//deeplearning/fbgemm/fbgemm_gpu:embedding_inplace_update")
22+
torch.ops.load_library("//deeplearning/fbgemm/fbgemm_gpu:embedding_inplace_update_cpu")
2823

2924
{% else %}
3025
#import os

fbgemm_gpu/test/split_table_batched_embeddings_test.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4905,9 +4905,8 @@ def test_embedding_inplace_update(
49054905
)
49064906

49074907
weights_ty_list = [weights_ty] * T
4908-
# if open_source:
4909-
# test_internal = False
4910-
test_internal = False
4908+
if open_source:
4909+
test_internal = False
49114910

49124911
# create two embedding bag op with random weights
49134912
locations = [location] * T

0 commit comments

Comments
 (0)