-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for vLLM containers #16
Conversation
This commit adds support for vLLM containers with some example documentation to support it. The schema has been updated to allow for the vLLM container. These changes help toward the migration to the v2.x architecture.
|
||
declare -a vars=("S3_BUCKET_MODELS" "LOCAL_MODEL_PATH" "MODEL_NAME" "S3_MOUNT_POINT" "THREADS") | ||
|
||
# Check the necessary environment variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these variables always apart of these base images? or is this something that we should make sure we add to the README?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are provided from the container build params within the typescript definition, so they should all be defined as part of this block:
LISA/lib/serve/ecs-model/index.ts
Lines 86 to 123 in 646e0fa
/** | |
* Generates environment variables for Docker at runtime based on the configuration. The environment variables | |
* include the local model path, S3 bucket for models, model name, and other variables depending on the model type. | |
* | |
* @param {Config} config - The application configuration. | |
* @param {ModelConfig} modelConfig - Configuration for the specific model. | |
* @returns {Object} An object containing the environment variables. The object has string keys and values, which | |
* represent the environment variables for Docker at runtime. | |
*/ | |
private getEnvironmentVariables(config: Config, modelConfig: ModelConfig): { [key: string]: string } { | |
const environment: { [key: string]: string } = { | |
LOCAL_MODEL_PATH: `${config.nvmeContainerMountPath}/model`, | |
S3_BUCKET_MODELS: config.s3BucketModels, | |
MODEL_NAME: modelConfig.modelName, | |
LOCAL_CODE_PATH: modelConfig.localModelCode, // Only needed when s5cmd is used, but just keep for now | |
AWS_REGION: config.region, // needed for s5cmd | |
}; | |
if (modelConfig.modelType === 'embedding') { | |
environment.SAGEMAKER_BASE_DIR = config.nvmeContainerMountPath; | |
} | |
if (config.mountS3DebUrl) { | |
environment.S3_MOUNT_POINT = 's3-models-mount'; | |
// More threads than files during S3 mount point copy to NVMe is fine; by default use half threads | |
environment.THREADS = Math.ceil(Ec2Metadata.get(modelConfig.instanceType).vCpus / 2).toString(); | |
} | |
if (modelConfig.containerConfig.environment) { | |
for (const [key, value] of Object.entries(modelConfig.containerConfig.environment)) { | |
if (value !== null) { | |
environment[key] = String(value); | |
} | |
} | |
} | |
return environment; | |
} |
This commit adds support for vLLM containers with some example documentation to support it. The schema has been updated to allow for the vLLM container. These changes help toward the migration to the v2.x architecture.
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.