-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vllm)!: upgrade vllm backend and refactor deployment (#854)
### BREAKING CHANGES: - moves all ENV specific to LeapfrogAI SDK to a ConfigMap using `volumeMount` for runtime injection and modification - in local dev, this is defined via `config.yaml` - moves all ENV specific to vLLM to a ConfigMap, using `envFrom` for runtime injection and modification - in local dev, this is defined via `.env` - `ZARF_CONFIG` is used to define create-time and deploy-time variables for (e.g., `MODEL_REPO_ID`, `ENFORCE_EAGER`) - updates Make targets and workflows with new `ZARF_CONFIG` variable - updates UDS bundles with new Zarf deployment variable overrides - allows delivery engineer's declarative definition of the backend configs and model - re-introduces LFAI SDK `config.yaml` configuration method for local development and testing - MUST upgrade API and backends together due to `FinishReason` proto change
- Loading branch information
1 parent
432b380
commit fd3cbc4
Showing
25 changed files
with
610 additions
and
221 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
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 |
---|---|---|
@@ -1,13 +1,12 @@ | ||
export LAI_HF_HUB_ENABLE_HF_TRANSFER="1" | ||
export LAI_REPO_ID="TheBloke/Synthia-7B-v2.0-GPTQ" | ||
export LAI_REVISION="gptq-4bit-32g-actorder_True" | ||
export LAI_QUANTIZATION="gptq" | ||
export LAI_TENSOR_PARALLEL_SIZE=1 | ||
export LAI_MODEL_SOURCE=".model/" | ||
export LAI_MAX_CONTEXT_LENGTH=32768 | ||
export LAI_STOP_TOKENS='["</s>","<|endoftext|>","<|im_end|>"]' | ||
export LAI_PROMPT_FORMAT_CHAT_SYSTEM="SYSTEM: {}\n" | ||
export LAI_PROMPT_FORMAT_CHAT_ASSISTANT="ASSISTANT: {}\n" | ||
export LAI_PROMPT_FORMAT_CHAT_USER="USER: {}\n" | ||
export LAI_PROMPT_FORMAT_DEFAULTS_TOP_P=1.0 | ||
export LAI_PROMPT_FORMAT_DEFAULTS_TOP_K=0 | ||
LFAI_REPO_ID="TheBloke/SynthIA-7B-v2.0-GPTQ" | ||
LFAI_REVISION="gptq-4bit-32g-actorder_True" | ||
|
||
VLLM_TENSOR_PARALLEL_SIZE=1 | ||
VLLM_TRUST_REMOTE_CODE=True | ||
VLLM_MAX_CONTEXT_LENGTH=32768 | ||
VLLM_ENFORCE_EAGER=False | ||
VLLM_GPU_MEMORY_UTILIZATION=0.90 | ||
VLLM_WORKER_USE_RAY=True | ||
VLLM_ENGINE_USE_RAY=True | ||
VLLM_QUANTIZATION=None | ||
VLLM_LOAD_FORMAT=auto |
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 |
---|---|---|
@@ -1,6 +1,27 @@ | ||
ARCH ?= amd64 | ||
LOCAL_VERSION ?= $(shell git rev-parse --short HEAD) | ||
DOCKER_FLAGS := | ||
|
||
install: | ||
python -m pip install ../../src/leapfrogai_sdk | ||
python -m pip install -e ".[dev]" | ||
|
||
dev: | ||
python -m leapfrogai_sdk.cli --app-dir=src/ main:Model | ||
download: | ||
@env $$(cat .env | xargs) python src/model_download.py | ||
|
||
dev: download | ||
@env $$(cat .env | xargs) python -m leapfrogai_sdk.cli --app-dir=src/ main:Model | ||
|
||
docker: download | ||
docker build ${DOCKER_FLAGS} \ | ||
--platform=linux/${ARCH} \ | ||
--build-arg LOCAL_VERSION=${LOCAL_VERSION} \ | ||
--build-arg COMPONENT_DIRECTORY="./" \ | ||
-t ghcr.io/defenseunicorns/leapfrogai/vllm:${LOCAL_VERSION} \ | ||
-f ./Dockerfile . | ||
|
||
docker run -it --rm \ | ||
--env-file ./.env \ | ||
-v $(PWD)/config.yaml:/home/leapfrogai/config.yaml \ | ||
-v $(PWD)/.model:/home/leapfrogai/.model \ | ||
ghcr.io/defenseunicorns/leapfrogai/vllm:${LOCAL_VERSION} |
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.