Skip to content

Commit eb54728

Browse files
kausvfacebook-github-bot
authored andcommitted
Improve error message of pipeline (#3260)
Summary: Pull Request resolved: #3260 For https://fb.workplace.com/groups/260102303573409/permalink/737763939140574/ Clarifying that user should detach pipeline before no_grad or model forward call Reviewed By: jd7-tr Differential Revision: D79728704 fbshipit-source-id: ebcb418e56ee11d7b41a1aa730b49512a2507d43
1 parent 964f6be commit eb54728

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchrec/distributed/train_pipeline/runtime_forwards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def __call__(
121121
]:
122122
assert (
123123
self._name in self._context.embedding_a2a_requests
124-
), "Invalid EmbeddingPipelinedForward usage, please do not directly call model.forward()"
124+
), "Invalid EmbeddingPipelinedForward usage, please call pipeline.detach() before torch.no_grad() and/or model.forward()"
125125

126126
ctx = self._context.module_contexts.pop(self._name)
127127
cur_stream = torch.get_device_module(self._device).current_stream()

0 commit comments

Comments
 (0)