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

RoPE: model-agnostic RoPE refactor #31999

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open

Commits on May 20, 2024

  1. Add YaRN and Dynamic-YaRN RoPE Scaling Methods

    YaRN (Yet another RoPE extension method) combines the NTK-By-Parts
    Interpolation and Attention Scaling methods, improving upon existing
    RoPE interpolation methods for longer context window sizes.
    
    Fine-tuned models maintain their original performance across benchmarks
    while enabling efficient extrapolation and transfer learning for
    quicker convergence, especially in compute-limited environments.
    
    We implement YaRN and Dynamic-YaRN for the following list of models:
    
     - LLaMA
     - Falcon
     - GPT-NeoX
     - Olmo
     - Persimmon
     - Phi
     - StableLM
     - OpenLLaMA
    
    New unit tests are added to assert YaRN's correct behavior on both
    short and long sequence inputs.
    
    For more details, please refer to https://arxiv.org/abs/2309.00071.
    
    Co-authored-by: Miguel Almeida <[email protected]>
    mig-mfreitas and miguelm-almeida committed May 20, 2024
    Configuration menu
    Copy the full SHA
    cc9b82e View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2024

  1. Configuration menu
    Copy the full SHA
    fc161dd View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2024

  1. Configuration menu
    Copy the full SHA
    1044c7b View commit details
    Browse the repository at this point in the history
  2. Refactor YaRN implementation for LLaMA

    Iterate on YaRN implementation for LLaMA and remove diff from remaining
    models for increased PR modularity.
    
    This commit includes the following changes:
    - Merge 'yarn_rope_scaling' and 'rope_scaling' dictionaries
    - Remove unnecessary attributes ('extrapolation_factor' and 'finetuned')
      from YaRN classes
    - Inherit 'forward' method in YaRN classes from superclass
    - Rename 'yarn' method to 'compute_yarn_scaling'
    - Extend YaRN tests with further assertions
    - Fix style inconsistencies
    
    Co-authored-by: Miguel Monte e Freitas <[email protected]>
    miguelm-almeida and mig-mfreitas committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    85552b3 View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2024

  1. Refactor Tensor Building Logic for YaRN

    - Comply with the the tensor building logic introduced in huggingface#30743
    - Add referencing to the optimized Attention Factor equation
    - Remove Dynamic YaRN for a more agile deployment
    
    Co-authored-by: mig-mfreitas <[email protected]>
    miguelm-almeida and mig-mfreitas committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    d84baa9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fdea000 View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2024

  1. remove unwanted file

    gante committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    a555034 View commit details
    Browse the repository at this point in the history
  2. tmp commit

    gante committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    472b168 View commit details
    Browse the repository at this point in the history
  3. mvp?

    gante committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    26fd6e9 View commit details
    Browse the repository at this point in the history
  4. rm yarn class

    gante committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    6ea2d3c View commit details
    Browse the repository at this point in the history
  5. can set attention_factor

    gante committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    9df8a43 View commit details
    Browse the repository at this point in the history
  6. a few optims

    gante committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    10dc891 View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2024

  1. single rope layer

    gante committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    e446e64 View commit details
    Browse the repository at this point in the history
  2. better config

    gante committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    cc6af77 View commit details
    Browse the repository at this point in the history
  3. push

    gante committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    9914572 View commit details
    Browse the repository at this point in the history
  4. push more logic to the rope fns

    gante committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    8befb00 View commit details
    Browse the repository at this point in the history
  5. dynamic can scale back

    gante committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    20962d8 View commit details
    Browse the repository at this point in the history
  6. position_embeddings last

    gante committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    0595968 View commit details
    Browse the repository at this point in the history
  7. rename new rope stuff

    gante committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    748a318 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    99305b4 View commit details
    Browse the repository at this point in the history
  9. make fixup

    gante committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    2f10261 View commit details
    Browse the repository at this point in the history
  10. chameleon

    gante committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    c34ffff View commit details
    Browse the repository at this point in the history
  11. cohere

    gante committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    6dae958 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2024

  1. fix gated imports

    gante committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    0bcd2c1 View commit details
    Browse the repository at this point in the history
  2. missing this one

    gante committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    0ec8ddb View commit details
    Browse the repository at this point in the history
  3. gemma (and cousins)

    gante committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    1e41bfc View commit details
    Browse the repository at this point in the history
  4. nits

    gante committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    dffad0d View commit details
    Browse the repository at this point in the history
  5. gemma 2

    gante committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    5eb821b View commit details
    Browse the repository at this point in the history
  6. mistral

    gante committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    61eaf7c View commit details
    Browse the repository at this point in the history
  7. Olmo

    gante committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    c720514 View commit details
    Browse the repository at this point in the history
  8. add longrope

    gante committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    d28add5 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2024

  1. phi3 (but not fully working)

    gante committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    032f662 View commit details
    Browse the repository at this point in the history
  2. last model D: D: D:

    gante committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    2cba857 View commit details
    Browse the repository at this point in the history
  3. moe out

    gante committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    205c740 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5d19465 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    909b247 View commit details
    Browse the repository at this point in the history
  6. fix olmo

    gante committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    441eabb View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b10fee4 View commit details
    Browse the repository at this point in the history
  8. cohere config

    gante committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    961e6ad View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2024

  1. lysandre's PR comments

    gante committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    0604c44 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    556e140 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9c5a40e View commit details
    Browse the repository at this point in the history