facebookresearch / mmf

A modular framework for vision & language multimodal research from Facebook AI Research (FAIR)
https://mmf.sh/
Other
5.46k stars 932 forks source link

[fix] set self.p_attn as local variable during inference #1183

Closed apsdehal closed 2 years ago

apsdehal commented 2 years ago

Summary: During inference, the field modification makes the model not thread safe causing T109002515. Q297197 recommends to remove this field. I have set the field self.p_attn to be updated during training only. Also initializing self.p_attn = None caused issues during torchscript, hence initializing as torch.tensor(float("nan")) would fix this.

Differential Revision: D33480478

facebook-github-bot commented 2 years ago

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