Compare commits

..
99 Commits
Author SHA1 Message Date
Marut PandyaandGitHub 2a4eaf0356 Merge pull request #182 from runpod-workers/up-0.8.5
update vllm
2025-05-08 11:40:23 -07:00
pandyamarut ba19cc97bf update vllm
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2025-05-08 11:34:58 -07:00
Marut PandyaandGitHub 6075f2c590 Merge pull request #181 from runpod-workers/revert-177-main
Revert "fix: added back limit_mm_per_prompt to engine args"
2025-05-07 12:31:15 -07:00
Marut PandyaandGitHub a9786a2481 Revert "fix: added back limit_mm_per_prompt to engine args" 2025-05-07 12:29:33 -07:00
Marut PandyaandGitHub 0b6bc7a2be Update tests.json 2025-05-07 11:14:50 -07:00
Marut PandyaandGitHub d0ab58ee17 Merge pull request #180 from muhsinking/patch-1
Update README.md table to fix table of contents links
2025-05-03 21:02:37 -07:00
Marut PandyaandGitHub 4e474c41c8 Merge pull request #177 from aleksandar-babic/main
fix: added back limit_mm_per_prompt to engine args
2025-05-03 21:01:58 -07:00
Mo KingandGitHub e9d13c155e Update README.md to fix table of contents links to environment variable sections
Separates environment variables into multiple tables, so that the table of contents will correctly jump to the appropriate section when clicked.
2025-04-30 12:45:54 -04:00
Marut PandyaandGitHub e807342e90 Merge pull request #178 from runpod-workers/up-0.8.4
update vllm
2025-04-21 13:15:03 -07:00
pandyamarut f33e8d2bcd update vllm
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2025-04-21 13:14:32 -07:00
Marut PandyaandGitHub 6b64bb93bd Merge pull request #147 from mohamednaji7/BitsAndBytes
completing the "bitsandbytes" option - based on  https://docs.vllm.ai/en/stable/quantization/bnb.html
2025-04-21 11:39:53 -07:00
Aleksandar Babic a53cf777ff chore: added limit_mm_per_prompt to worker config 2025-04-21 10:14:05 -04:00
Aleksandar Babic cfc258674b chore: added trailing comma to the final arg 2025-04-21 10:06:08 -04:00
Aleksandar Babic 8beafed06b fix: added back limit_mm_per_prompt to engine args 2025-04-21 10:02:46 -04:00
Marut PandyaandGitHub d77c53c3b7 Merge pull request #175 from runpod-workers/up-0.8.3
update vllm
2025-04-07 11:58:03 -07:00
pandyamarut 3d067cd472 update vllm
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2025-04-07 11:54:57 -07:00
Marut PandyaandGitHub f1360ccae7 Merge pull request #173 from KAJdev/patch-1
Update hub.json
2025-04-03 14:52:06 -07:00
Marut PandyaandGitHub 96f1b86126 Merge pull request #174 from KAJdev/patch-2
Update tests.json
2025-04-03 10:14:49 -07:00
Ezekiel WotringandGitHub 3a095f3e10 Update tests.json 2025-04-03 09:10:01 -08:00
Ezekiel WotringandGitHub 7cf7f3e4e6 Update hub.json 2025-04-03 09:04:28 -08:00
Marut PandyaandGitHub 4395d0c67b Update hub.json 2025-04-03 08:10:28 -07:00
Marut PandyaandGitHub 5864fa6843 Update hub.json 2025-03-31 15:55:35 -07:00
Marut PandyaandGitHub 067f0bc173 Update tests.json 2025-03-31 15:49:31 -07:00
Marut PandyaandGitHub 0869068e7c Create tests.json 2025-03-31 15:32:06 -07:00
Marut PandyaandGitHub 19f25b17de Update hub.json 2025-03-31 15:14:40 -07:00
Marut PandyaandGitHub 70aa748c30 Update hub.json 2025-03-31 15:14:24 -07:00
Marut PandyaandGitHub da3e5f524b Merge pull request #171 from runpod-workers/update
update vllm 0.8.2
2025-03-26 15:56:04 -07:00
pandyamarut acbdf63de8 update vllm 0.8.2
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2025-03-26 15:55:30 -07:00
Hailong YangandGitHub fa31d9663d Update README.md 2025-03-11 22:24:22 -04:00
Marut PandyaandGitHub b8fb313483 Merge pull request #168 from runpod-workers/wc-up
update worker config
2025-03-11 12:23:22 -07:00
pandyamarut 9635daf336 update worker config
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2025-03-11 12:22:53 -07:00
Marut PandyaandGitHub fb4e700090 Merge pull request #166 from KAJdev/patch-1
Create hub.json
2025-03-10 12:14:47 -07:00
Marut PandyaandGitHub d4872ed9c8 Merge pull request #167 from runpod-workers/rachfop-patch-1
Update requirements.txt
2025-03-10 12:13:47 -07:00
Patrick RachfordandGitHub b2eef50c3b Update requirements.txt
Use the latest runpod version from here:
https://github.com/runpod/runpod-python/releases/tag/1.7.7
2025-03-10 08:46:28 -07:00
Ezekiel WotringandGitHub 8005bcc1a8 fix description 2025-03-07 13:22:34 -09:00
Ezekiel WotringandGitHub aa7b00ddda Create hub.json 2025-03-07 13:20:52 -09:00
Marut PandyaandGitHub dc6f3239bd Update README.md 2025-02-24 18:39:14 -08:00
Marut PandyaandGitHub f9d0fcb78c Merge pull request #165 from runpod-workers/hfix
[HF]: set default max_token size
2025-02-24 17:24:50 -08:00
pandyamarut 99b952e55e set default max_token size
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2025-02-24 17:22:44 -08:00
Marut PandyaandGitHub 389fad7952 Merge pull request #164 from runpod-workers/up-0.7.3
update vllm
2025-02-24 15:08:02 -08:00
pandyamarut 56dc4ad075 update vllm
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2025-02-24 15:01:45 -08:00
Marut PandyaandGitHub 6dcf39e159 Merge pull request #161 from runpod-workers/revert-157-m-c
Revert "Enabling model caching."
2025-02-18 14:33:27 -08:00
Marut PandyaandGitHub 2b1d618287 Revert "Enabling model caching." 2025-02-18 10:45:47 -08:00
Marut PandyaandGitHub d7e9c49fe4 Merge pull request #160 from runpod-workers/up-0.7.2
update vllm
2025-02-11 13:59:18 -08:00
pandyamarut c9791f1163 update vllm
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2025-02-11 13:27:57 -08:00
Marut PandyaandGitHub 6fc770415d Merge pull request #157 from runpod-workers/m-c
Enabling model caching.
2025-02-06 11:52:19 -08:00
Mohamed NagyandGitHub 04288240f6 updating the . in ['awq', 'squeezellm', 'gptq'. 'bitsandbytes'] for the QUNATIZATION row 2025-02-02 14:58:48 +02:00
Marut PandyaandGitHub 9e8d9196b0 Merge pull request #154 from runpod-workers/fx-eng
update engine.py
2025-01-28 21:40:26 -08:00
pandyamarut 30dd7c1eb5 update engine.py
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2025-01-28 21:40:00 -08:00
Marut PandyaandGitHub aa7c37ffb0 Merge pull request #152 from runpod-workers/fix0.7.0-1
update oai serving classes
2025-01-28 20:58:40 -08:00
pandyamarut dc8c88027a update serving classes
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2025-01-28 20:58:07 -08:00
Marut PandyaandGitHub a948e90caa Merge pull request #151 from runpod-workers/fix0.7.0
dynamic lora loading
2025-01-28 19:02:59 -08:00
pandyamarut c703254f71 dynamic lora loading
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2025-01-28 19:00:57 -08:00
Marut PandyaandGitHub 2747106403 Merge pull request #150 from runpod-workers/up-0.7.0
update vllm 0.7.0
2025-01-28 14:27:37 -08:00
pandyamarut 91ed30e9a2 update readme
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2025-01-28 14:21:33 -08:00
pandyamarut fcbfe84f63 update vllm 0.7.0
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2025-01-28 14:18:10 -08:00
Marut PandyaandGitHub 610429df23 Merge pull request #143 from sihamouda/main
Add limit_mm_per_prompt engine argument for multimodels input
2025-01-27 16:41:47 -08:00
Hailong Yang a578c6df23 update docker file 2025-01-26 23:28:27 -05:00
Mohamed NagyandGitHub 9299f43b8b solving "typing_extensions" compatibility with "bitsandbytes"
```
2025-01-22 18:04:01 [INFO] > [stage-0 5/8] RUN --mount=type=cache,target=/root/.cache/pip python3 -m pip install --upgrade pip && python3 -m pip install --upgrade -r /requirements.txt:
2025-01-22 18:04:01 [INFO] #13 8.904
2025-01-22 18:04:01 [INFO] #13 8.904 The conflict is caused by:
2025-01-22 18:04:01 [INFO] #13 8.904 The user requested typing-extensions==4.7.1
2025-01-22 18:04:01 [INFO] #13 8.904 bitsandbytes 0.45.0 depends on typing_extensions>=4.8.0
```
2025-01-22 18:06:46 +02:00
mohamednaji7 131c17569f correct access to "args" dictionary 2025-01-21 22:33:28 +02:00
mohamednaji7 8882f6d50b adding 'bitsandbytes' to QUANTIZATION 2025-01-21 14:46:40 +02:00
mohamednaji7 331bc30101 adding 'bitsandbytes' option 2025-01-21 14:08:37 +02:00
mohamednaji7 a27f72a33a inforce args.quantization for bnb load_froamt 2025-01-21 14:01:32 +02:00
mohamednaji7 7167985f23 including bitsandbytes "src:https://docs.vllm.ai/en/stable/quantization/bnb.html" 2025-01-21 13:49:36 +02:00
sihamouda 0e3359a70e add engine argument for multimodels input 2025-01-19 02:44:39 +01:00
Marut PandyaandGitHub 3f0a20d28e Merge pull request #141 from runpod-workers/main
Rebase
2025-01-02 20:49:48 -08:00
pandyamarut 8e3c26be14 update worker-config
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2024-12-30 17:41:10 -08:00
pandyamarut 66ea8b1110 update engine
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2024-12-30 17:13:03 -08:00
Marut PandyaandGitHub a3d432afdf Merge pull request #140 from runpod-workers/nw-updte
upgrade vllm version
2024-12-30 15:23:44 -08:00
pandyamarut 06c2bb1715 upgrade vllm version
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2024-12-30 15:20:11 -08:00
Marut PandyaandGitHub d2e355eae9 Merge pull request #137 from kldzj/fix-tool-calling
fix: openai tool calling
2024-12-15 20:50:47 -08:00
kldzj b7787d8ca8 fix: remove unused import 2024-12-06 16:29:06 +01:00
kldzj b1fca5d257 fix: move tool flags away from engine args 2024-12-06 16:07:23 +01:00
kldzj 3e86d16892 fix: openai tool calling 2024-12-06 13:08:48 +01:00
Marut PandyaandGitHub d9f54ce76a Update README.md 2024-11-29 16:30:45 -08:00
Marut PandyaandGitHub 149da95cd0 Merge pull request #133 from kldzj/tool-calling
feat: add tool calling flags
2024-11-29 16:29:56 -08:00
Marut PandyaandGitHub 0a89394f1d Update worker-config.json 2024-11-29 16:29:33 -08:00
Nikolai Kolodziej 8df7f41f1d fix: set empty tool_call_parser to None 2024-11-24 06:55:43 +01:00
Nikolai Kolodziej 4d7b8c03c0 feat: tool calling flags 2024-11-24 06:51:41 +01:00
pandyamarut 6c6bf50379 update env
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2024-11-22 15:14:57 -08:00
pandyamarut 27a2ee5754 add model cache
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2024-11-22 13:11:12 -08:00
Marut PandyaandGitHub 2df915a145 Merge pull request #132 from runpod-workers/wc-uo
update worker-config
2024-11-20 14:54:45 -08:00
pandyamarut aadc025849 update worker-config
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2024-11-20 14:42:56 -08:00
Marut PandyaandGitHub 8b4a49073d Merge pull request #131 from runpod-workers/up-0.6.4
[Core]Update vllm-0.6.4
2024-11-20 10:37:46 -08:00
pandyamarut 4e10641d69 update vllm
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2024-11-19 12:14:04 -08:00
Marut PandyaandGitHub 6e8696c12a Merge pull request #121 from sven-knoblauch/lora-modules
add changes for lora adapter support and /v1/models endpoint
2024-10-31 15:07:02 -04:00
Marut PandyaandGitHub b49e81a75a Merge pull request #126 from runpod-workers/up-wc-1
update worker-config
2024-10-15 17:52:13 -07:00
pandyamarut 65932f85e1 update worker-config
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2024-10-15 17:47:58 -07:00
Marut PandyaandGitHub 94840cfbbb Update README.md 2024-10-15 17:38:31 -07:00
Marut PandyaandGitHub ce47c41f4a Merge pull request #125 from runpod-workers/up-0.6.3
update vllm
2024-10-15 17:04:20 -07:00
pandyamarut c03ecc42fe update vllm
Signed-off-by: pandyamarut <pandyamarut@gmail.com>
2024-10-15 16:49:41 -07:00
Dean QuiñanolaandGitHub ae56b9f43d Merge pull request #123 from runpod-workers/dependency-update-refactored 2024-10-13 20:23:33 -07:00
Dean QuiñanolaandGitHub 891699be1e Merge pull request #124 from runpod-workers/readme-correction 2024-10-13 20:23:05 -07:00
Dean QuiñanolaandGitHub c28aa02576 Update README.md
v1.5.0 not v15
2024-10-12 17:11:59 -07:00
Dean QuiñanolaandGitHub eba20c0704 Update CI-runpod_dep.yml
Dependency has changed to `runpod~=<version>` and not `runpod==<version>`
2024-10-12 16:47:31 -07:00
Sven Knoblauch 677a01e8f3 update code for case of no lora adapter 2024-10-09 14:51:33 +02:00
Sven Knoblauch 5cd12ba331 add changes for lora adapter support and /v1/models endpoint 2024-10-09 11:01:12 +02:00
Dean QuiñanolaandGitHub 850c686538 Merge pull request #120 from runpod-workers/runpod-v1.7-and-up
Update requirements.txt to support runpod-python 1.7.*
2024-10-08 10:52:20 -07:00
Dean QuiñanolaandGitHub de2876e659 Update requirements.txt 2024-10-08 10:48:10 -07:00
11 changed files with 2559 additions and 958 deletions
+27 -10
View File
@@ -19,32 +19,49 @@ jobs:
- name: Check for new package version and update
run: |
# Get current version
current_version=$(grep -oP 'runpod==\K[^"]+' ./builder/requirements.txt)
echo "Fetching the current runpod version from requirements.txt..."
# Get current version, allowing both == and ~= in the search pattern
current_version=$(grep -oP 'runpod[~=]{1,2}\K[^"]+' ./builder/requirements.txt)
echo "Current version: $current_version"
# Get new version
# Extract major and minor from current version
current_major_minor=$(echo $current_version | cut -d. -f1,2)
echo "Current major.minor: $current_major_minor"
echo "Fetching the latest runpod version from PyPI..."
# Get new version from PyPI
new_version=$(curl -s https://pypi.org/pypi/runpod/json | jq -r .info.version)
echo "NEW_VERSION_ENV=$new_version" >> $GITHUB_ENV
echo "New version: $new_version"
# Extract major and minor from new version
new_major_minor=$(echo $new_version | cut -d. -f1,2)
echo "New major.minor: $new_major_minor"
if [ -z "$new_version" ]; then
echo "Failed to fetch the new version."
echo "ERROR: Failed to fetch the new version from PyPI."
exit 1
fi
# Check if the version is already up-to-date
if [ "$current_version" = "$new_version" ]; then
echo "The package version is already up-to-date."
# Check if the major or minor version is different
if [ "$current_major_minor" = "$new_major_minor" ]; then
echo "No update needed. The new version ($new_major_minor) is within the allowed range (~= $current_major_minor)."
exit 0
fi
# Update requirements.txt
sed -i "s/runpod==.*/runpod==$new_version/" ./builder/requirements.txt
echo "New major/minor detected ($new_major_minor). Updating requirements.txt..."
# Update requirements.txt, preserving the existing constraint type (~= or ==)
sed -i "s/runpod[~=][^ ]*/runpod~=$new_version/" ./builder/requirements.txt
echo "requirements.txt has been updated."
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update package version
commit-message: Update runpod package version
title: Update runpod package version
body: The package version has been updated to ${{ env.NEW_VERSION_ENV }}
branch: runpod-package-update
+1016
View File
File diff suppressed because it is too large Load Diff
+40
View File
@@ -0,0 +1,40 @@
{
"tests": [
{
"name": "basic_inference_test",
"input": {
"prompt": "Write a short poem about artificial intelligence."
},
"timeout": 30000
}
],
"config": {
"gpuTypeId": "NVIDIA GeForce RTX 4090",
"gpuCount": 1,
"env": [
{
"key": "MODEL_NAME",
"value": "facebook/opt-350m"
},
{
"key": "MAX_MODEL_LEN",
"value": "8192"
},
{
"key": "GPU_MEMORY_UTILIZATION",
"value": "0.95"
}
],
"allowedCudaVersions": [
"12.7",
"12.6",
"12.5",
"12.4",
"12.3",
"12.2",
"12.1",
"12.0",
"11.7"
]
}
}
+4 -4
View File
@@ -12,7 +12,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \
python3 -m pip install --upgrade -r /requirements.txt
# Install vLLM (switching back to pip installs since issues that required building fork are fixed and space optimization is not as important since caching) and FlashInfer
RUN python3 -m pip install vllm==0.6.2 && \
RUN python3 -m pip install vllm==0.8.4 && \
python3 -m pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.3
# Setup for Option 2: Building the Image with the Model included
@@ -32,7 +32,7 @@ ENV MODEL_NAME=$MODEL_NAME \
HF_DATASETS_CACHE="${BASE_PATH}/huggingface-cache/datasets" \
HUGGINGFACE_HUB_CACHE="${BASE_PATH}/huggingface-cache/hub" \
HF_HOME="${BASE_PATH}/huggingface-cache/hub" \
HF_HUB_ENABLE_HF_TRANSFER=1
HF_HUB_ENABLE_HF_TRANSFER=0
ENV PYTHONPATH="/:/vllm-workspace"
@@ -40,10 +40,10 @@ ENV PYTHONPATH="/:/vllm-workspace"
COPY src /src
RUN --mount=type=secret,id=HF_TOKEN,required=false \
if [ -f /run/secrets/HF_TOKEN ]; then \
export HF_TOKEN=$(cat /run/secrets/HF_TOKEN); \
export HF_TOKEN=$(cat /run/secrets/HF_TOKEN); \
fi && \
if [ -n "$MODEL_NAME" ]; then \
python3 /src/download_model.py; \
python3 /src/download_model.py; \
fi
# Start the handler
+68 -28
View File
@@ -18,9 +18,9 @@ Deploy OpenAI-Compatible Blazing-Fast LLM Endpoints powered by the [vLLM](https:
### 1. UI for Deploying vLLM Worker on RunPod console:
![Demo of Deploying vLLM Worker on RunPod console with new UI](media/ui_demo.gif)
### 2. Worker vLLM `v1.5.0` with vLLM `0.6.2` now available under `stable` tags
### 2. Worker vLLM `v2.5.0` with vLLM `0.8.5` now available under `stable` tags
Update v1.5.0 is now available, use the image tag `runpod/worker-v1-vllm:v1.5.0stable-cuda12.1.0`.
Update v2.5.0 is now available, use the image tag `runpod/worker-v1-vllm:v2.5.0stable-cuda12.1.0`.
### 3. OpenAI-Compatible [Embedding Worker](https://github.com/runpod-workers/worker-infinity-embedding) Released
Deploy your own OpenAI-compatible Serverless Endpoint on RunPod with multiple embedding models and fast inference for RAG and more!
@@ -38,9 +38,8 @@ Worker vLLM is now cached on all RunPod machines, resulting in near-instant depl
- [Environment Variables](#environment-variables)
- [LLM Settings](#llm-settings)
- [Tokenizer Settings](#tokenizer-settings)
- [Tensor Parallelism (Multi-GPU) Settings](#tensor-parallelism-multi-gpu-settings)
- [System Settings](#system-settings)
- [Streaming Batch Size](#streaming-batch-size)
- [System and Parallelism Settings](#system-and-parallelism-settings)
- [Streaming Batch Size Settings](#streaming-batch-size-settings)
- [OpenAI Settings](#openai-settings)
- [Serverless Settings](#serverless-settings)
- [Option 2: Build Docker Image with Model Inside](#option-2-build-docker-image-with-model-inside)
@@ -82,7 +81,7 @@ Below is a summary of the available RunPod Worker images, categorized by image s
| CUDA Version | Stable Image Tag | Development Image Tag | Note |
|--------------|-----------------------------------|-----------------------------------|----------------------------------------------------------------------|
| 12.1.0 | `runpod/worker-v1-vllm:v15.0stable-cuda12.1.0` | `runpod/worker-v1-vllm:v1.5.0dev-cuda12.1.0` | When creating an Endpoint, select CUDA Version 12.3, 12.2 and 12.1 in the filter. |
| 12.1.0 | `runpod/worker-v1-vllm:v2.5.0stable-cuda12.1.0` | `runpod/worker-v1-vllm:v2.5.0dev-cuda12.1.0` | When creating an Endpoint, select CUDA Version 12.3, 12.2 and 12.1 in the filter. |
@@ -91,9 +90,10 @@ Below is a summary of the available RunPod Worker images, categorized by image s
#### Prerequisites
- RunPod Account
#### Environment Variables/Settings
#### Environment Variables
> Note: `0` is equivalent to `False` and `1` is equivalent to `True` for boolean as int values.
#### LLM Settings
| `Name` | `Default` | `Type/Choices` | `Description` |
|-------------------------------------------|-----------------------|--------------------------------------------|---------------|
| `MODEL_NAME` | 'facebook/opt-125m' | `str` | Name or path of the Hugging Face model to use. |
@@ -125,7 +125,7 @@ Below is a summary of the available RunPod Worker images, categorized by image s
| `MAX_NUM_SEQS` | 256 | `int` | Maximum number of sequences per iteration. |
| `MAX_LOGPROBS` | 20 | `int` | Max number of log probs to return when logprobs is specified in SamplingParams. |
| `DISABLE_LOG_STATS` | False | `bool` | Disable logging statistics. |
| `QUANTIZATION` | None | ['awq', 'squeezellm', 'gptq'] | Method used to quantize the weights. |
| `QUANTIZATION` | None | ['awq', 'squeezellm', 'gptq', 'bitsandbytes'] | Method used to quantize the weights. |
| `ROPE_SCALING` | None | `dict` | RoPE scaling configuration in JSON format. |
| `ROPE_THETA` | None | `float` | RoPE theta. Use with rope_scaling. |
| `TOKENIZER_POOL_SIZE` | 0 | `int` | Size of tokenizer pool to use for asynchronous tokenization. |
@@ -157,11 +157,20 @@ Below is a summary of the available RunPod Worker images, categorized by image s
| `PREEMPTION_CPU_CAPACITY` | 2 | `float` | The percentage of CPU memory used for the saved activations. |
| `DISABLE_LOGGING_REQUEST` | False | `bool` | Disable logging requests. |
| `MAX_LOG_LEN` | None | `int` | Max number of prompt characters or prompt ID numbers being printed in log. |
**Tokenizer Settings**
#### Tokenizer Settings
| `Name` | `Default` | `Type/Choices` | `Description` |
|-------------------------------------------|-----------------------|--------------------------------------------|---------------|
| `TOKENIZER_NAME` | `None` | `str` |Tokenizer repository to use a different tokenizer than the model's default. |
| `TOKENIZER_REVISION` | `None` | `str` |Tokenizer revision to load. |
| `CUSTOM_CHAT_TEMPLATE` | `None` | `str` of single-line jinja template |Custom chat jinja template. [More Info](https://huggingface.co/docs/transformers/chat_templating) |
**System, GPU, and Tensor Parallelism(Multi-GPU) Settings**
#### System and Parallelism Settings
| `Name` | `Default` | `Type/Choices` | `Description` |
|-------------------------------------------|-----------------------|--------------------------------------------|---------------|
| `GPU_MEMORY_UTILIZATION` | `0.95` | `float` |Sets GPU VRAM utilization. |
| `MAX_PARALLEL_LOADING_WORKERS` | `None` | `int` |Load model sequentially in multiple batches, to avoid RAM OOM when using tensor parallel and large models. |
| `BLOCK_SIZE` | `16` | `8`, `16`, `32` |Token block size for contiguous chunks of tokens. |
@@ -169,16 +178,31 @@ Below is a summary of the available RunPod Worker images, categorized by image s
| `ENFORCE_EAGER` | False | `bool` |Always use eager-mode PyTorch. If False(`0`), will use eager mode and CUDA graph in hybrid for maximal performance and flexibility. |
| `MAX_SEQ_LEN_TO_CAPTURE` | `8192` | `int` |Maximum context length covered by CUDA graphs. When a sequence has context length larger than this, we fall back to eager mode.|
| `DISABLE_CUSTOM_ALL_REDUCE` | `0` | `int` |Enables or disables custom all reduce. |
**Streaming Batch Size Settings**:
#### Streaming Batch Size Settings
The way this works is that the first request will have a batch size of `DEFAULT_MIN_BATCH_SIZE`, and each subsequent request will have a batch size of `previous_batch_size * DEFAULT_BATCH_SIZE_GROWTH_FACTOR`. This will continue until the batch size reaches `DEFAULT_BATCH_SIZE`. E.g. for the default values, the batch sizes will be `1, 3, 9, 27, 50, 50, 50, ...`. You can also specify this per request, with inputs `max_batch_size`, `min_batch_size`, and `batch_size_growth_factor`. This has nothing to do with vLLM's internal batching, but rather the number of tokens sent in each HTTP request from the worker
| `Name` | `Default` | `Type/Choices` | `Description` |
|-------------------------------------------|-----------------------|--------------------------------------------|---------------|
| `DEFAULT_BATCH_SIZE` | `50` | `int` |Default and Maximum batch size for token streaming to reduce HTTP calls. |
| `DEFAULT_MIN_BATCH_SIZE` | `1` | `int` |Batch size for the first request, which will be multiplied by the growth factor every subsequent request. |
| `DEFAULT_BATCH_SIZE_GROWTH_FACTOR` | `3` | `float` |Growth factor for dynamic batch size. |
The way this works is that the first request will have a batch size of `DEFAULT_MIN_BATCH_SIZE`, and each subsequent request will have a batch size of `previous_batch_size * DEFAULT_BATCH_SIZE_GROWTH_FACTOR`. This will continue until the batch size reaches `DEFAULT_BATCH_SIZE`. E.g. for the default values, the batch sizes will be `1, 3, 9, 27, 50, 50, 50, ...`. You can also specify this per request, with inputs `max_batch_size`, `min_batch_size`, and `batch_size_growth_factor`. This has nothing to do with vLLM's internal batching, but rather the number of tokens sent in each HTTP request from the worker |
**OpenAI Settings**
#### OpenAI Settings
| `Name` | `Default` | `Type/Choices` | `Description` |
|-------------------------------------------|-----------------------|--------------------------------------------|---------------|
| `RAW_OPENAI_OUTPUT` | `1` | boolean as `int` |Enables raw OpenAI SSE format string output when streaming. **Required** to be enabled (which it is by default) for OpenAI compatibility. |
| `OPENAI_SERVED_MODEL_NAME_OVERRIDE` | `None` | `str` |Overrides the name of the served model from model repo/path to specified name, which you will then be able to use the value for the `model` parameter when making OpenAI requests |
| `OPENAI_RESPONSE_ROLE` | `assistant` | `str` |Role of the LLM's Response in OpenAI Chat Completions. |
**Serverless Settings**
#### Serverless Settings
| `Name` | `Default` | `Type/Choices` | `Description` |
|-------------------------------------------|-----------------------|--------------------------------------------|---------------|
| `MAX_CONCURRENCY` | `300` | `int` |Max concurrent requests per worker. vLLM has an internal queue, so you don't have to worry about limiting by VRAM, this is for improving scaling/load balancing efficiency |
| `DISABLE_LOG_STATS` | False | `bool` |Enables or disables vLLM stats logging. |
| `DISABLE_LOG_REQUESTS` | False | `bool` |Enables or disables vLLM request logging. |
@@ -488,7 +512,15 @@ The prompt string can be any string, and the model's chat template will not be a
Example:
```json
"prompt": "..."
{
"input": {
"prompt": "why sky is blue?",
"sampling_params": {
"temperature": 0.7,
"max_tokens": 100
}
}
}
```
2. `messages`
Your list can contain any number of messages, and each message usually can have any role from the following list:
@@ -502,20 +534,28 @@ Your list can contain any number of messages, and each message usually can have
Example:
```json
"messages": [
{
"role": "system",
"content": "..."
},
{
"role": "user",
"content": "..."
},
{
"role": "assistant",
"content": "..."
{
"input": {
"messages": [
{
"role": "system",
"content": "You are a helpful AI assistant that provides clear and concise responses."
},
{
"role": "user",
"content": "Can you explain the difference between supervised and unsupervised learning?"
},
{
"role": "assistant",
"content": "Sure! Supervised learning uses labeled data, meaning each input has a corresponding correct output. The model learns by mapping inputs to known outputs. In contrast, unsupervised learning works with unlabeled data, where the model identifies patterns, structures, or clusters without predefined answers."
}
],
"sampling_params": {
"temperature": 0.7,
"max_tokens": 100
}
]
}
}
```
</details>
+4 -3
View File
@@ -1,11 +1,12 @@
ray
pandas
pyarrow
runpod==1.7.1
runpod~=1.7.7
huggingface-hub
packaging
typing-extensions==4.7.1
typing-extensions>=4.8.0
pydantic
pydantic-settings
hf-transfer
transformers
transformers
bitsandbytes>=0.45.0
+1 -1
View File
@@ -7,7 +7,7 @@ variable "REPOSITORY" {
}
variable "BASE_IMAGE_VERSION" {
default = "stable"
default = "v2.4.0stable"
}
group "all" {
+34 -14
View File
@@ -4,14 +4,16 @@ import json
import asyncio
from dotenv import load_dotenv
from typing import AsyncGenerator
from typing import AsyncGenerator, Optional
import time
from vllm import AsyncLLMEngine
from vllm.entrypoints.logger import RequestLogger
from vllm.entrypoints.openai.serving_chat import OpenAIServingChat
from vllm.entrypoints.openai.serving_completion import OpenAIServingCompletion
from vllm.entrypoints.openai.protocol import ChatCompletionRequest, CompletionRequest, ErrorResponse
from vllm.entrypoints.openai.serving_engine import BaseModelPath
from vllm.entrypoints.openai.serving_models import BaseModelPath, LoRAModulePath, OpenAIServingModels
from utils import DummyRequest, JobInput, BatchSize, create_error_response
from constants import DEFAULT_MAX_CONCURRENCY, DEFAULT_BATCH_SIZE, DEFAULT_BATCH_SIZE_GROWTH_FACTOR, DEFAULT_MIN_BATCH_SIZE
@@ -128,23 +130,44 @@ class OpenAIvLLMEngine(vLLMEngine):
self.base_model_paths = [
BaseModelPath(name=self.engine_args.model, model_path=self.engine_args.model)
]
lora_modules = os.getenv('LORA_MODULES', None)
if lora_modules is not None:
try:
lora_modules = json.loads(lora_modules)
lora_modules = [LoRAModulePath(**lora_modules)]
except:
lora_modules = None
self.serving_models = OpenAIServingModels(
engine_client=self.llm,
model_config=self.model_config,
base_model_paths=self.base_model_paths,
lora_modules=None,
prompt_adapters=None,
)
self.chat_engine = OpenAIServingChat(
engine_client=self.llm,
model_config=self.model_config,
base_model_paths=self.base_model_paths,
models=self.serving_models,
response_role=self.response_role,
request_logger=None,
chat_template=self.tokenizer.tokenizer.chat_template,
lora_modules=None,
prompt_adapters=None,
request_logger=None
chat_template_content_format="auto",
# enable_reasoning=os.getenv('ENABLE_REASONING', 'false').lower() == 'true',
# reasoning_parser=None,
# return_token_as_token_ids=False,
enable_auto_tools=os.getenv('ENABLE_AUTO_TOOL_CHOICE', 'false').lower() == 'true',
tool_parser=os.getenv('TOOL_CALL_PARSER', "") or None,
enable_prompt_tokens_details=False
)
self.completion_engine = OpenAIServingCompletion(
engine_client=self.llm,
model_config=self.model_config,
base_model_paths=self.base_model_paths,
lora_modules=[],
prompt_adapters=None,
request_logger=None
models=self.serving_models,
request_logger=None,
# return_token_as_token_ids=False,
)
async def generate(self, openai_request: JobInput):
@@ -157,10 +180,7 @@ class OpenAIvLLMEngine(vLLMEngine):
yield create_error_response("Invalid route").model_dump()
async def _handle_model_request(self):
models = await self.chat_engine.show_available_models()
fixed_model = models.data[0]
fixed_model.id = self.served_model_name
models.data = [fixed_model]
models = await self.serving_models.show_available_models()
return models.model_dump()
async def _handle_chat_or_completion_request(self, openai_request: JobInput):
+6 -1
View File
@@ -4,6 +4,7 @@ import logging
from torch.cuda import device_count
from vllm import AsyncEngineArgs
from vllm.model_executor.model_loader.tensorizer import TensorizerConfig
from src.utils import convert_limit_mm_per_prompt
RENAME_ARGS_MAP = {
"MODEL_NAME": "model",
@@ -88,7 +89,8 @@ DEFAULT_ARGS = {
"typical_acceptance_sampler_posterior_alpha": float(os.getenv('TYPICAL_ACCEPTANCE_SAMPLER_POSTERIOR_ALPHA', 0)) or None,
"qlora_adapter_name_or_path": os.getenv('QLORA_ADAPTER_NAME_OR_PATH', None),
"disable_logprobs_during_spec_decoding": os.getenv('DISABLE_LOGPROBS_DURING_SPEC_DECODING', None),
"otlp_traces_endpoint": os.getenv('OTLP_TRACES_ENDPOINT', None)
"otlp_traces_endpoint": os.getenv('OTLP_TRACES_ENDPOINT', None),
"use_v2_block_manager": os.getenv('USE_V2_BLOCK_MANAGER', 'true'),
}
def match_vllm_args(args):
@@ -145,6 +147,9 @@ def get_engine_args():
# Rename and match to vllm args
args = match_vllm_args(args)
if args.get("load_format") == "bitsandbytes":
args["quantization"] = args["load_format"]
# Set tensor parallel size and max parallel loading workers if more than 1 GPU is available
num_gpus = device_count()
+9 -1
View File
@@ -15,6 +15,10 @@ except ImportError:
logging.basicConfig(level=logging.INFO)
def convert_limit_mm_per_prompt(input_string: str):
key, value = input_string.split('=')
return {key: int(value)}
def count_physical_cores():
with open('/proc/cpuinfo') as f:
content = f.readlines()
@@ -40,7 +44,11 @@ class JobInput:
self.max_batch_size = job.get("max_batch_size")
self.apply_chat_template = job.get("apply_chat_template", False)
self.use_openai_format = job.get("use_openai_format", False)
self.sampling_params = SamplingParams(**job.get("sampling_params", {}))
samp_param = job.get("sampling_params", {})
if "max_tokens" not in samp_param:
samp_param["max_tokens"] = 100
self.sampling_params = SamplingParams(**samp_param)
# self.sampling_params = SamplingParams(max_tokens=100, **job.get("sampling_params", {}))
self.request_id = random_uuid()
batch_size_growth_factor = job.get("batch_size_growth_factor")
self.batch_size_growth_factor = float(batch_size_growth_factor) if batch_size_growth_factor else None
+1350 -896
View File
File diff suppressed because it is too large Load Diff