-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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 cpu-only
- Loading branch information
Showing
112 changed files
with
4,488 additions
and
1,538 deletions.
There are no files selected for viewing
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,17 @@ | ||
.. _adding_multimodal_plugin: | ||
|
||
Adding a Multimodal Plugin | ||
========================== | ||
|
||
This document teaches you how to add a new modality to vLLM. | ||
|
||
Each modality in vLLM is represented by a :class:`~vllm.multimodal.MultiModalPlugin` and registered to :data:`~vllm.multimodal.MULTIMODAL_REGISTRY`. | ||
For vLLM to recognize a new modality type, you have to create a new plugin and then pass it to :meth:`~vllm.multimodal.MultiModalRegistry.register_plugin`. | ||
|
||
The remainder of this document details how to define custom :class:`~vllm.multimodal.MultiModalPlugin` s. | ||
|
||
.. note:: | ||
This article is a work in progress. | ||
|
||
.. | ||
TODO: Add more instructions on how to add new plugins once embeddings is in. |
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
Oops, something went wrong.