ClassyVision icon indicating copy to clipboard operation
ClassyVision copied to clipboard

Make models immutable for inference and pass state explicitly

Open dzhulgakov opened this issue 5 years ago • 1 comments

Summary: Usual prediction setup assumes that there's a single instance of nn.Module (scripted) and it gets invoked from multiple threads concurrently to serve prediction requests. It means that the execution of the model can't modify the module itself.

ClassyVision used to save the intermediate block outputs in module attributes violating the above assumption. This diff tries to fix it by passing the block states explicitly.

Differential Revision: D19207155

dzhulgakov avatar Dec 21 '19 04:12 dzhulgakov

This pull request was exported from Phabricator. Differential Revision: D19207155

facebook-github-bot avatar Dec 21 '19 04:12 facebook-github-bot