-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'vllm-project:main' into main
- Loading branch information
Showing
113 changed files
with
6,651 additions
and
1,121 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
.buildkite/lm-eval-harness/configs/Meta-Llama-3-8B-Instruct-FP8-compressed-tensors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# bash .buildkite/lm-eval-harness/run-lm-eval-gsm-vllm-baseline.sh -m nm-testing/Meta-Llama-3-8B-FP8-compressed-tensors-test -b 32 -l 250 -f 5 -t 1 | ||
model_name: "nm-testing/Meta-Llama-3-8B-FP8-compressed-tensors-test" | ||
tasks: | ||
- name: "gsm8k" | ||
metrics: | ||
- name: "exact_match,strict-match" | ||
value: 0.752 | ||
- name: "exact_match,flexible-extract" | ||
value: 0.752 | ||
limit: 250 | ||
num_fewshot: 5 |
2 changes: 1 addition & 1 deletion
2
.buildkite/lm-eval-harness/configs/Meta-Llama-3-8B-Instruct-FP8.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
.buildkite/lm-eval-harness/configs/Meta-Llama-3-8B-Instruct-INT8-compressed-tensors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# bash .buildkite/lm-eval-harness/run-lm-eval-gsm-vllm-baseline.sh -m nm-testing/Meta-Llama-3-8B-Instruct-W8-Channel-A8-Dynamic-Per-Token-Test -b "auto" -l 250 -f 5 -t 1 | ||
model_name: "nm-testing/Meta-Llama-3-8B-Instruct-W8-Channel-A8-Dynamic-Per-Token-Test" | ||
tasks: | ||
- name: "gsm8k" | ||
metrics: | ||
- name: "exact_match,strict-match" | ||
value: 0.728 | ||
- name: "exact_match,flexible-extract" | ||
value: 0.728 | ||
limit: 250 | ||
num_fewshot: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
Meta-Llama-3-8B-Instruct.yaml | ||
Meta-Llama-3-8B-Instruct-FP8.yaml | ||
Meta-Llama-3-8B-Instruct-FP8-compressed-tensors.yaml | ||
Meta-Llama-3-8B-Instruct-INT8-compressed-tensors.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/bash | ||
|
||
set -euox pipefail | ||
|
||
if [[ $# -lt 3 ]]; then | ||
echo "Please provide the number of nodes and GPU per node." | ||
exit 1 | ||
fi | ||
|
||
NUM_NODES=$1 | ||
NUM_GPUS=$2 | ||
DOCKER_IMAGE=$3 | ||
|
||
shift 3 | ||
COMMANDS=("$@") | ||
if [ ${#COMMANDS[@]} -ne $NUM_NODES ]; then | ||
echo "The number of commands must be equal to the number of nodes." | ||
echo "Number of nodes: $NUM_NODES" | ||
echo "Number of commands: ${#COMMANDS[@]}" | ||
exit 1 | ||
fi | ||
|
||
echo "List of commands" | ||
for command in "${COMMANDS[@]}"; do | ||
echo $command | ||
done | ||
|
||
start_network() { | ||
docker network create --subnet=192.168.10.0/24 docker-net | ||
} | ||
|
||
start_nodes() { | ||
for node in $(seq 0 $(($NUM_NODES-1))); do | ||
GPU_DEVICES='"device=' | ||
for node_gpu in $(seq 0 $(($NUM_GPUS - 1))); do | ||
DEVICE_NUM=$(($node * $NUM_GPUS + $node_gpu)) | ||
GPU_DEVICES+=$(($DEVICE_NUM)) | ||
if [ $node_gpu -lt $(($NUM_GPUS - 1)) ]; then | ||
GPU_DEVICES+=',' | ||
fi | ||
done | ||
GPU_DEVICES+='"' | ||
# echo "Starting node$node with GPU devices: $GPU_DEVICES" | ||
docker run -d --gpus "$GPU_DEVICES" --name node$node --network docker-net --ip 192.168.10.$((10 + $node)) --rm $DOCKER_IMAGE tail -f /dev/null | ||
done | ||
} | ||
|
||
run_nodes() { | ||
for node in $(seq 0 $(($NUM_NODES-1))); do | ||
GPU_DEVICES='"device=' | ||
for node_gpu in $(seq 0 $(($NUM_GPUS - 1))); do | ||
DEVICE_NUM=$(($node * $NUM_GPUS + $node_gpu)) | ||
GPU_DEVICES+=$(($DEVICE_NUM)) | ||
if [ $node_gpu -lt $(($NUM_GPUS - 1)) ]; then | ||
GPU_DEVICES+=',' | ||
fi | ||
done | ||
GPU_DEVICES+='"' | ||
echo "Running node$node with GPU devices: $GPU_DEVICES" | ||
if [ $node -lt $(($NUM_NODES - 1)) ]; then | ||
docker exec -d node$node /bin/bash -c "${COMMANDS[$node]}" | ||
else | ||
docker exec node$node /bin/bash -c "${COMMANDS[$node]}" | ||
fi | ||
done | ||
} | ||
cleanup() { | ||
for node in $(seq 0 $(($NUM_NODES-1))); do | ||
docker stop node$node | ||
done | ||
docker network rm docker-net | ||
} | ||
trap cleanup EXIT | ||
start_network | ||
start_nodes | ||
run_nodes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import os | ||
import subprocess | ||
|
||
from PIL import Image | ||
|
||
from vllm import LLM | ||
|
||
# The assets are located at `s3://air-example-data-2/vllm_opensource_llava/`. | ||
# You can use `.buildkite/download-images.sh` to download them | ||
|
||
|
||
def run_paligemma(): | ||
llm = LLM(model="google/paligemma-3b-mix-224") | ||
|
||
prompt = "caption es" | ||
|
||
image = Image.open("images/stop_sign.jpg") | ||
|
||
outputs = llm.generate({ | ||
"prompt": prompt, | ||
"multi_modal_data": { | ||
"image": image | ||
}, | ||
}) | ||
|
||
for o in outputs: | ||
generated_text = o.outputs[0].text | ||
print(generated_text) | ||
|
||
|
||
def main(): | ||
run_paligemma() | ||
|
||
|
||
if __name__ == "__main__": | ||
# Download from s3 | ||
s3_bucket_path = "s3://air-example-data-2/vllm_opensource_llava/" | ||
local_directory = "images" | ||
|
||
# Make sure the local directory exists or create it | ||
os.makedirs(local_directory, exist_ok=True) | ||
|
||
# Use AWS CLI to sync the directory, assume anonymous access | ||
subprocess.check_call([ | ||
"aws", | ||
"s3", | ||
"sync", | ||
s3_bucket_path, | ||
local_directory, | ||
"--no-sign-request", | ||
]) | ||
main() |
Oops, something went wrong.