Skip to content

Commit

Permalink
Open source inplace update operators (#1482)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #1482

Reviewed By: jspark1105

Differential Revision: D41562775

fbshipit-source-id: 9bc3397c7ba8ad53d3aefa52609f84f297318a6b
  • Loading branch information
jianyuh authored and facebook-github-bot committed Dec 4, 2022
1 parent 6120f21 commit 4cd267c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ torch.ops.load_library("//deeplearning/fbgemm/fbgemm_gpu:sparse_ops_cpu")
torch.ops.load_library(
"//deeplearning/fbgemm/fbgemm_gpu:split_table_batched_embeddings"
)
try:
torch.ops.load_library("//deeplearning/fbgemm/fbgemm_gpu:embedding_inplace_update")
torch.ops.load_library("//deeplearning/fbgemm/fbgemm_gpu:embedding_inplace_update_cpu")
except OSError:
# Keep for BC: will be deprecated soon.
torch.ops.load_library("//deeplearning/fbgemm/fbgemm_gpu/fb:embedding_inplace_update")
torch.ops.load_library("//deeplearning/fbgemm/fbgemm_gpu/fb:embedding_inplace_update_cpu")

{% else %}
#import os
#torch.ops.load_library(os.path.join(os.path.join(os.path.dirname(os.path.dirname(__file__)), "fbgemm_gpu_py.so")))
Expand Down
5 changes: 2 additions & 3 deletions fbgemm_gpu/test/split_table_batched_embeddings_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4685,9 +4685,8 @@ def test_embedding_inplace_update(
)

weights_ty_list = [weights_ty] * T
# if open_source:
# test_internal = False
test_internal = False
if open_source:
test_internal = False

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

0 comments on commit 4cd267c

Please sign in to comment.