PygmalionAI's large-scale inference engine
pygmalion.chat
It is designed to serve as the inference endpoint for the PygmalionAI website, and to allow serving the Pygmalion models to a large number of users with blazing fast speeds (thanks to vLLM's Paged Attention).
AlpinDale 9183c13b5b add gumbel softmax | 11 months ago | |
---|---|---|
.github | 11 months ago | |
aphrodite | 11 months ago | |
assets | 1 year ago | |
docker | 1 year ago | |
examples | 1 year ago | |
kernels | 11 months ago | |
rocm_patch | 1 year ago | |
tests | 11 months ago | |
.gitignore | 1 year ago | |
.pylintrc | 1 year ago | |
LICENSE | 1 year ago | |
MANIFEST.in | 1 year ago | |
README.md | 11 months ago | |
build-linux-wheel.sh | 11 months ago | |
environment.yaml | 11 months ago | |
formatting.sh | 1 year ago | |
mypy.ini | 1 year ago | |
patch_xformers-0.0.22.post7.rocm.sh | 1 year ago | |
pyproject.toml | 11 months ago | |
requirements-dev.txt | 1 year ago | |
requirements-rocm.txt | 1 year ago | |
requirements.txt | 11 months ago | |
runtime.sh | 1 year ago | |
setup.py | 11 months ago | |
update-runtime.sh | 1 year ago |
Aphrodite is the official backend engine for PygmalionAI. It is designed to serve as the inference endpoint for the PygmalionAI website, and to allow serving the Pygmalion models to a large number of users with blazing fast speeds (thanks to FasterTransformer and vLLM).
Aphrodite builds upon and integrates the exceptional work from various projects.
The compute necessary for Aphrodite's development is provided by Arc Compute.
pip install aphrodite-engine
python -m aphrodite.endpoints.openai.api_server --model PygmalionAI/pygmalion-2-7b
This will create a OpenAI-compatible API server that can be accessed at port 2242 of the localhost. You can plug in the API into a UI that supports Kobold, such as SillyTavern.
Speeds vary with different GPUs, model sizes, quantization schemes, batch sizes, etc. Here are some baseline benchmarks conducted by requesting as many completions as possible from the API server. Keep in mind that these are the theoritical peak throughput with parallel decoding, with as high a batch size as possible. Per-request generation speed is a fraction of this, at 30-40 t/s.
[!NOTE]
16bit models can achieve much higher throughput if they have access to more VRAM, either by using larger GPUs, or tensor parallelism over many GPUs. The numbers below are purely for output tokens.
Model | Quantization | GPU | Throughput (output t/s) |
---|---|---|---|
Llama-2 7B | None | RTX 4090 | 2576.2 |
AWQ | RTX 4090 | 3551.3 | |
GPTQ | RTX 4090 | 2919.1 | |
SqueezeLLM | RTX 4090 | 580.3 | |
Mistral 7B | None | RTX 4090 | 5489.3 |
AWQ | RTX 4090 | 4078.8 | |
GPTQ | RTX 4090 | 4516.2 | |
SqueezeLLM | RTX 4090 | 549.5 |
For supported GPUs, see here.
For usage, please refer to the wiki page for detailed instructions. Aphrodite provides many different options for LLM inference, so please read through the list of options here.
By design, Aphrodite takes up 90% of your GPU's VRAM. If you're not serving an LLM at scale, you may want to limit the amount of memory it takes up. You can do this in the API example by launching the server with the --gpu-memory-utilization 0.6
(0.6 means 60%).
You can view the full list of commands by running python -m aphrodite.endpoints.openai.api_server --help
.
Context Length extension via the RoPE method is supported for most models. Use the command-line flag --max-model-len
to specify a desired context length and the engine will adjust the RoPE scaling accordingly.
Please refer to the FAQ & Issues if you run into problems. If you don't find an answer there, please make an issue.
Aphrodite Engine would have not been possible without the phenomenal work of other open-source projects. Credits go to:
Everyone is welcome to contribute. You can support the project by opening Pull Requests for new features, fixes, or general UX improvements.