Skip to content

Commit a117ae2

Browse files
Ivan Kobzarevfacebook-github-bot
Ivan Kobzarev
authored andcommittedJun 21, 2024
import fbgemm sparse_ops before compilation (pytorch#2144)
Summary: Pull Request resolved: pytorch#2144 Importing fbgemm.sparse_ops that are needed for torchrec compilation before model.compile call. The main concern is torch.package tests. Reviewed By: gnahzg, Microve Differential Revision: D58830081 fbshipit-source-id: 3497f996c881d9c05814e779e68153b7956dc316
1 parent 8446d88 commit a117ae2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎torchrec/distributed/train_pipeline/train_pipelines.py

+4
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ def progress(self, dataloader_iter: Iterator[In]) -> Out:
243243
torch._dynamo.config.force_unspec_int_unbacked_size_like_on_torchrec_kjt = (
244244
True
245245
)
246+
247+
# Importing only before compilation to not slow-done train_pipelines import
248+
torch.ops.import_module("fbgemm_gpu.sparse_ops")
249+
246250
self._model.compile(
247251
fullgraph=cc.fullgraph, dynamic=cc.dynamic, backend=cc.backend
248252
)

0 commit comments

Comments
 (0)
Please sign in to comment.