Skip to content

[Fuyu and Persimmon] Add FA2 and fused kernels#27622

Closed
jzhang38 wants to merge 4 commits intohuggingface:mainfrom
jzhang38:add_FA2_and_fused_kernels
Closed

[Fuyu and Persimmon] Add FA2 and fused kernels#27622
jzhang38 wants to merge 4 commits intohuggingface:mainfrom
jzhang38:add_FA2_and_fused_kernels

Conversation

@jzhang38
Copy link
Copy Markdown

@jzhang38 jzhang38 commented Nov 21, 2023

What does this PR do?

  • Add FA2 to Fuyu and Persimmon(just like it has been done to Llama through use_flash_attention_2=True)
  • Add other fused kernels from the FA2 repo
  • Add a working finetuning script.

1 and 2 are what's implemented in OtterHD. I am not sure if you want to have 2 (fused kernels of rotary embed and layernorm) added into transformers main because that means adding cuda kernel dependecies (see here)
3 is related to #26997
The goal is to accelerate the fine-tuning process for Fuyu.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

@ArthurZucker @molbap

@jzhang38 jzhang38 marked this pull request as draft November 21, 2023 08:08
@jeromeku
Copy link
Copy Markdown

@jzhang38

I'm close to finishing the FA2 implementation for Persimmon -- see #27052. Also am developing a separate package for loading cuda kernels dynamically that would allow for incorporating fused kernels (including FA's fused ops / layers).

@github-actions
Copy link
Copy Markdown
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions Bot closed this Dec 30, 2023
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.

2 participants