Skip to content

Commit 424994a

Browse files
rkindifacebook-github-bot
authored andcommitted
Add try/except OSError guard for torchrec/quant/embedding_modules.py torch.ops.load_library call.
Summary: Everywhere else (torchrec/sparse/jagged_tensor.py, torchrec/distributed/comm_ops.py, torchrec/distributed/dist_data.py) we have a try except guard. Reviewed By: colin2328 Differential Revision: D32814873 fbshipit-source-id: 467a0c5ed13b1ae059f8c42aa1e33549da785ef3
1 parent a7d595f commit 424994a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

torchrec/quant/embedding_modules.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
KeyedTensor,
2929
)
3030

31-
torch.ops.load_library("//deeplearning/fbgemm/fbgemm_gpu:sparse_ops")
31+
try:
32+
torch.ops.load_library("//deeplearning/fbgemm/fbgemm_gpu:sparse_ops")
33+
except OSError:
34+
pass
3235

3336

3437
class EmbeddingBagCollection(EmbeddingBagCollectionInterface):

0 commit comments

Comments
 (0)