Skip to content

Commit 7869893

Browse files
s4ayubfacebook-github-bot
authored andcommitted
another torch deploy protection :( [guard import in torchrec train pipeline] (#2512)
Summary: Pull Request resolved: #2512 this import doesnt work in torch dceploy for whatever reason (we're getting rid of it all in 2 months so just bare with this for now) Differential Revision: D64830919 fbshipit-source-id: 8271244fef2697f85e361b4fd1b3937f549f0994
1 parent b34da0d commit 7869893

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

torchrec/distributed/train_pipeline/train_pipelines.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@
7474
except ImportError:
7575
logger.warning("torchrec_use_sync_collectives is not available")
7676

77-
torch.ops.import_module("fbgemm_gpu.sparse_ops")
77+
if not torch._running_with_deploy():
78+
torch.ops.import_module("fbgemm_gpu.sparse_ops")
7879

7980

8081
class ModelDetachedException(Exception):

0 commit comments

Comments
 (0)