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

support for rotary positional encoding to transformer modules. #1604

Merged
merged 4 commits into from
Apr 12, 2024

Conversation

ashdtu
Copy link
Contributor

@ashdtu ashdtu commented Apr 11, 2024

Pull Request Template

Checklist

  • Confirmed that run-checks all script has been executed.
  • Made sure the book is up to date with changes in this PR.

Related Issues/PRs

#1603

Changes

Implementation of Rotary positional encodings as an alternative to sinusoidal positional embeddings due to their ability to incorporate explicit relative position dependency. They are being used in recent LLM models such as Llama, Mistral etc.

Testing

Test cases to verify output against PyTorch implementations of Rotary embeddings (https://github.com/lucidrains/rotary-embedding-torch).

@ashdtu ashdtu requested review from antimora and louisfd April 11, 2024 20:07
Copy link

codecov bot commented Apr 11, 2024

Codecov Report

Attention: Patch coverage is 97.14286% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 86.33%. Comparing base (f3e0aa6) to head (3a4215e).
Report is 12 commits behind head on main.

Files Patch % Lines
crates/burn-core/src/nn/rope_encoding.rs 97.14% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1604       /-   ##
==========================================
- Coverage   86.39%   86.33%   -0.07%     
==========================================
  Files         688      691        3     
  Lines       78676    79368      692     
==========================================
  Hits        67974    68520      546     
- Misses      10702    10848      146     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@louisfd louisfd left a comment

Choose a reason for hiding this comment

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

LGTM, very well documented thanks

@louisfd louisfd merged commit fb1da53 into main Apr 12, 2024
15 checks passed
@louisfd louisfd deleted the feat/rotary_encoding branch April 12, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants