text-generation-inference/server
Daniël de Kok 27a5d6b5f9 Add GPT-2 with flash attention (#1889)
# What does this PR do?

<!--
Congratulations! You've made it this far! You're not quite done yet
though.

Once merged, your PR is going to appear in the release notes with the
title you set, so make sure it's a great title that fully reflects the
extent of your awesome contribution.

Then, please replace this with a description of the change and which
issue is fixed (if applicable). Please also include relevant motivation
and context. List any dependencies (if any) that are required for this
change.

Once you're done, someone will review your PR shortly (see the section
"Who can review?" below to tag some potential reviewers). They may
suggest changes to make the code even better. If no one reviewed your PR
after a week has passed, don't hesitate to post a new comment
@-mentioning the same persons---sometimes notifications get lost.
-->

This change adds `FlashGPT2ForCausalLM` and wires it up. The model
itself is pretty straightforward, the main difference from other models
is that it uses trained position embeddings and that all weight matrices
are transposed compared to other models (due to the use of Conv1D in the
upstream model).

<!-- Remove if not applicable -->

Fixes # (issue)

## Before submitting
- [x] This PR fixes a typo or improves the docs (you can dismiss the
other checks if that's the case).
- [x] Did you read the [contributor
guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the
[forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [x] Did you make sure to update the documentation with your changes?
Here are the
[documentation
guidelines](https://github.com/huggingface/transformers/tree/main/docs),
and
[here are tips on formatting
docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?

## Who can review?

Anyone in the community is free to review the PR once the tests have
passed. Feel free to tag
members/contributors who may be interested in your PR.

@Narsil

<!-- Your PR will be replied to more quickly if you can figure out the
right person to tag with @

@OlivierDehaene OR @Narsil

 -->
2024-07-17 05:36:58 +00:00
..
custom_kernels chore: add pre-commit (#1569) 2024-04-24 15:32:02 +03:00
exllama_kernels chore: add pre-commit (#1569) 2024-04-24 15:32:02 +03:00
exllamav2_kernels chore: add pre-commit (#1569) 2024-04-24 15:32:02 +03:00
tests Refactor layers. (#1866) 2024-07-17 05:36:58 +00:00
text_generation_server Add GPT-2 with flash attention (#1889) 2024-07-17 05:36:58 +00:00
.gitignore Impl simple mamba model (#1480) 2024-04-23 11:45:11 +03:00
dill-0.3.7-patch.sh Hgraph dill patch (#131) 2024-04-26 11:08:15 +02:00
dill-0.3.8-patch.sh A patch to address HPU Graphs issue with DILL 2024-05-06 09:15:46 +03:00
Makefile fix: fix CohereForAI/c4ai-command-r-plus (#1707) 2024-04-25 17:51:35 +03:00
Makefile-awq chore: add pre-commit (#1569) 2024-04-24 15:32:02 +03:00
Makefile-eetq Upgrade EETQ (Fixes the cuda graphs). (#1729) 2024-04-25 17:58:27 +03:00
Makefile-flash-att chore: add pre-commit (#1569) 2024-04-24 15:32:02 +03:00
Makefile-flash-att-v2 fix: fix CohereForAI/c4ai-command-r-plus (#1707) 2024-04-25 17:51:35 +03:00
Makefile-selective-scan chore: add pre-commit (#1569) 2024-04-24 15:32:02 +03:00
Makefile-vllm (chore): torch 2.3.0 (#1833) 2024-06-10 14:12:46 +03:00
poetry.lock Granite support? (#1882) 2024-07-17 05:36:58 +00:00
pyproject.toml Update to SynapseAI 1.16.0 (#167) 2024-07-03 11:08:56 +02:00
README.md chore: add pre-commit (#1569) 2024-04-24 15:32:02 +03:00
requirements_cuda.txt Granite support? (#1882) 2024-07-17 05:36:58 +00:00
requirements_rocm.txt Granite support? (#1882) 2024-07-17 05:36:58 +00:00
requirements.txt Update to SynapseAI 1.16.0 (#167) 2024-07-03 11:08:56 +02:00

Text Generation Inference Python gRPC Server

A Python gRPC server for Text Generation Inference

Install

make install

Run

make run-dev