Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Conversation

@pmabbo13 pmabbo13 requested a review from Nayef211 July 13, 2022 18:15
Copy link
Contributor

@Nayef211 Nayef211 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's highlight what the modifications are with the use of a PR comment

@pmabbo13
Copy link
Contributor Author

Let's highlight what the modifications are with the use of a PR comment

updated!

@pmabbo13
Copy link
Contributor Author

Description

The T5Layer implementation is very similar to the nn.TransformerEncoderLayer and nn.TransformerDecoderLayer implementations. The main differences are that:

  1. T5Layer generalizes to be used as either an encoder or decoder layer. For the encoder we perform self-attention + feed-forward. For the decoder we perform self-attention + cross-attention + feed-forward. If the boolean parameter is_decoder = True, the forward method will perform cross-attention after performing self-attention. Otherwise, it will skip the cross-attention step and go directly to the feed-forward step.
  2. T5Layer takes in parameters relative_attention_num_buckets, relative_attention_max_distance, compute_relative_attention and relative_attention_bias. This is information passed into the self-attention block so that it can include a relative attention bias term when computing attention scores.

@pmabbo13 pmabbo13 requested review from abhinavarora and parmeet July 15, 2022 15:58
Copy link
Contributor

@parmeet parmeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM!

Copy link
Contributor

@Nayef211 Nayef211 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pmabbo13 pmabbo13 merged commit f2d9a47 into gh/pmabbo13/7/base Jul 18, 2022
@facebook-github-bot facebook-github-bot deleted the gh/pmabbo13/7/head branch August 18, 2022 14:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants