Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Script MultiheadAttention (#1524) #681

Closed
wants to merge 1 commit into from

Conversation

cndn
Copy link
Contributor

@cndn cndn commented Jan 10, 2020

Summary:
Pull Request resolved: facebookresearch/fairseq#1524

Make fairseq MultiheadAttention scriptable. Looking for feedbacks.

  1. Add types
  2. Move incremental state management logic from util functions to initializers. TorchScript in general doesn't support global dict. As a result modules with multihead attention in it would assign itself fairseq_instance_id in the initializer.
  3. There might be opportunities to make assertions and annotations cleaner.

Differential Revision: D18772594

@facebook-github-bot
Copy link

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

cndn added a commit to cndn/translate that referenced this pull request Jan 14, 2020
Summary:
Pull Request resolved: pytorch#681

Pull Request resolved: facebookresearch/fairseq#1524

Make fairseq MultiheadAttention scriptable. Looking for feedbacks.

1. Add types
2. Move incremental state management logic from util functions to initializers. TorchScript in general doesn't support global dict. As a result modules with multihead attention in it would assign itself fairseq_instance_id in the initializer.
3. There might be opportunities to make assertions and annotations cleaner.

Differential Revision: D18772594

fbshipit-source-id: 4353d522d244b1508190d33ca5be6f2299e8442c
@cndn cndn force-pushed the export-D18772594 branch from 9c65372 to 0c86ec3 Compare January 14, 2020 23:39
@facebook-github-bot
Copy link

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

cndn added a commit to cndn/fairseq that referenced this pull request Jan 16, 2020
Summary:
Pull Request resolved: pytorch/translate#681

Pull Request resolved: facebookresearch#1524

Make fairseq MultiheadAttention scriptable. Looking for feedbacks.

1. Add types
2. Move incremental state management logic from util functions to initializers. TorchScript in general doesn't support global dict. As a result modules with multihead attention in it would assign itself fairseq_instance_id in the initializer.
3. There might be opportunities to make assertions and annotations cleaner.

Differential Revision: D18772594

fbshipit-source-id: 8b8b87f0e74f4afb863b15fc4172482b640f6197
Summary:
Pull Request resolved: pytorch#681

Pull Request resolved: facebookresearch/fairseq#1524

Make fairseq MultiheadAttention scriptable. Looking for feedbacks.

1. Add types
2. Move incremental state management logic from util functions to initializers. TorchScript in general doesn't support global dict. As a result modules with multihead attention in it would assign itself fairseq_instance_id in the initializer.
3. There might be opportunities to make assertions and annotations cleaner.

Differential Revision: D18772594

fbshipit-source-id: 5c21d7d84db1320201f486015bb91469006ffd95
@cndn cndn force-pushed the export-D18772594 branch from 0c86ec3 to b673ecd Compare January 16, 2020 18:11
@facebook-github-bot
Copy link

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

facebook-github-bot pushed a commit to facebookresearch/fairseq that referenced this pull request Jan 22, 2020
Summary:
Pull Request resolved: fairinternal/fairseq-py#1002

Pull Request resolved: pytorch/translate#681

Pull Request resolved: #1524

Make fairseq MultiheadAttention scriptable. Looking for feedbacks.

1. Add types
2. Move incremental state management logic from util functions to initializers. TorchScript in general doesn't support global dict. As a result modules with multihead attention in it would assign itself fairseq_instance_id in the initializer.
3. There might be opportunities to make assertions and annotations cleaner.

Reviewed By: myleott

Differential Revision: D18772594

fbshipit-source-id: 377aef4bbb7ef51da5b6bac9a87a6f7b03b16fe1
@facebook-github-bot
Copy link

This pull request has been merged in 23cedf7.

moussaKam pushed a commit to moussaKam/language-adaptive-pretraining that referenced this pull request Sep 29, 2020
Summary:
Pull Request resolved: fairinternal/fairseq-py#1002

Pull Request resolved: pytorch/translate#681

Pull Request resolved: facebookresearch#1524

Make fairseq MultiheadAttention scriptable. Looking for feedbacks.

1. Add types
2. Move incremental state management logic from util functions to initializers. TorchScript in general doesn't support global dict. As a result modules with multihead attention in it would assign itself fairseq_instance_id in the initializer.
3. There might be opportunities to make assertions and annotations cleaner.

Reviewed By: myleott

Differential Revision: D18772594

fbshipit-source-id: 377aef4bbb7ef51da5b6bac9a87a6f7b03b16fe1
yzpang pushed a commit to yzpang/gold-off-policy-text-gen-iclr21 that referenced this pull request Feb 19, 2021
Summary:
Pull Request resolved: fairinternal/fairseq-py#1002

Pull Request resolved: pytorch/translate#681

Pull Request resolved: facebookresearch/fairseq#1524

Make fairseq MultiheadAttention scriptable. Looking for feedbacks.

1. Add types
2. Move incremental state management logic from util functions to initializers. TorchScript in general doesn't support global dict. As a result modules with multihead attention in it would assign itself fairseq_instance_id in the initializer.
3. There might be opportunities to make assertions and annotations cleaner.

Reviewed By: myleott

Differential Revision: D18772594

fbshipit-source-id: 377aef4bbb7ef51da5b6bac9a87a6f7b03b16fe1
yzpang pushed a commit to yzpang/gold-off-policy-text-gen-iclr21 that referenced this pull request Feb 19, 2021
Summary:
Pull Request resolved: fairinternal/fairseq-py#1002

Pull Request resolved: pytorch/translate#681

Pull Request resolved: facebookresearch/fairseq#1524

Make fairseq MultiheadAttention scriptable. Looking for feedbacks.

1. Add types
2. Move incremental state management logic from util functions to initializers. TorchScript in general doesn't support global dict. As a result modules with multihead attention in it would assign itself fairseq_instance_id in the initializer.
3. There might be opportunities to make assertions and annotations cleaner.

Reviewed By: myleott

Differential Revision: D18772594

fbshipit-source-id: 377aef4bbb7ef51da5b6bac9a87a6f7b03b16fe1
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants