Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add embedding projector for encoder and decoder #247

Merged
merged 7 commits into from
Mar 28, 2022
Merged

Add embedding projector for encoder and decoder #247

merged 7 commits into from
Mar 28, 2022

Conversation

stephantul
Copy link
Contributor

What does this PR do?

Fixes #244 .

Before submitting

  • Did you have fun?
    • Make sure you had fun coding 🙃
  • Did you read the contributor guideline?
  • Was this discussed/approved via a Github issue? (no need for typos, doc improvements)
    • N/A
  • Did you make sure to update the docs?
    • N/A
  • Did you write any new necessary tests?
    • N/A
  • Did you update the changelog? (if needed)
    • N/A

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

@facebook-github-bot
Copy link
Contributor

Hi @stephantul!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 23, 2022
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Expose bias flag for feedforwards, same default as Timm [#220]
- Update eps value for layernormm, same default as torch [#221]
- PreNorm bugfix, only one input was normalized [#233]
- Fix bug where embedding dimensions that did not match model dim would lead to a crash [#244]
Copy link
Contributor

Choose a reason for hiding this comment

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

this would need to be moved up, it would be part of the next release ? I'm kind of on the fence as of whether this is a "bug" (there are plenty of settings which you can pass which will "crash", in that they will tell you down the line that the dimensions mismatch), but as you see fit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yeah, not a bug, sorry! Feel free to rename it as you see fit.

@blefaudeux
Copy link
Contributor

looks good to me except for minor remarks, thanks a lot @stephantul ! I can fix this and the linting if you'd like, else feel free to update the PR anytime

@blefaudeux
Copy link
Contributor

now mypy :] it helps installing pre-commit, we should explain it a bit better, more info here. Thanks already, getting there !

@blefaudeux
Copy link
Contributor

(doc build broke at some point, rebasing on master will fix that, sorry about that @stephantul )

@blefaudeux
Copy link
Contributor

@stephantul see https://github.com/stephantul/xformers/pull/1 for a proposed fix

lintfix suggestion to be able to #247
@stephantul
Copy link
Contributor Author

Thanks for the fix! I was offline during the weekend, and was planning to fix it today, but I'm glad you took care of it 😄

@codecov-commenter
Copy link

Codecov Report

Merging #247 (7a0f7fb) into main (286b39e) will decrease coverage by 0.13%.
The diff coverage is 73.91%.

@@            Coverage Diff             @@
##             main     #247      +/-   ##
==========================================
- Coverage   92.21%   92.07%   -0.14%     
==========================================
  Files          60       60              
  Lines        3312     3331      +19     
==========================================
+ Hits         3054     3067      +13     
- Misses        258      264       +6     
Flag Coverage Δ
Python 92.07% <73.91%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
xformers/factory/block_factory.py 91.54% <73.91%> (-2.42%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 286b39e...7a0f7fb. Read the comment docs.

@blefaudeux
Copy link
Contributor

LGTM @stephantul, thank you ! One last thing would be to unit test this case, it can be just a matter of adding another case here. I can do that later on if you prefer, I understand that there are a lot of steps to contributing and wouldn't want to wear you down :)

Copy link
Contributor

@blefaudeux blefaudeux left a comment

Choose a reason for hiding this comment

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

LGTM, as you prefer unit test wise, I can follow up on that ! Thanks a bunch @stephantul

@blefaudeux blefaudeux merged commit 0f915fc into facebookresearch:main Mar 28, 2022
@blefaudeux
Copy link
Contributor

landing that, adding more unit tests in a seperate PR, easy follow up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Config does not support model_dim that does not match attention model_dim
4 participants