forked from mlcommons/cm4mlops
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mlperf-inference' into redhat_llama2
- Loading branch information
Showing
9 changed files
with
181 additions
and
15 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
uid: c3eff27c791048aa | ||
alias: run-vllm-server | ||
|
||
automation_alias: script | ||
automation_uid: 5b4e0237da074764 | ||
|
||
cache: false | ||
|
||
category: DevOps automation | ||
|
||
tags: | ||
- run | ||
- server | ||
- vllm | ||
- vllm-server | ||
|
||
input_mapping: | ||
model: CM_VLLM_SERVER_MODEL_NAME | ||
tp_size: CM_VLLM_SERVER_TP_SIZE | ||
pp_size: CM_VLLM_SERVER_PP_SIZE | ||
distributed-executor-backend: CM_VLLM_SERVER_DIST_EXEC_BACKEND | ||
api_key: CM_VLLM_SERVER_API_KEY | ||
|
||
deps: | ||
- tags: get,python3,get-python3 | ||
version_max: "3.11.999" | ||
version_max_usable: "3.11.0" | ||
|
||
- tags: get,ml-model,huggingface,zoo,_clone-repo | ||
update_tags_from_env_with_prefix: | ||
_model-stub.: | ||
- CM_VLLM_SERVER_MODEL_NAME | ||
enable_if_env: | ||
CM_VLLM_SERVER_MODEL_NAME: [ on ] | ||
- tags: get,generic-python-lib,_package.vllm |
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,49 @@ | ||
from cmind import utils | ||
import os, subprocess | ||
|
||
def preprocess(i): | ||
|
||
os_info = i['os_info'] | ||
|
||
env = i['env'] | ||
|
||
meta = i['meta'] | ||
|
||
automation = i['automation'] | ||
|
||
cmd_args = "" | ||
|
||
model_name = env.get("CM_VLLM_SERVER_MODEL_NAME", False) | ||
if not model_name: | ||
return {'return': 1, 'error': 'Model name not specified'} | ||
else: | ||
cmd_args += f" --model {env['CM_ML_MODEL_PATH']} --served-model-name {model_name}" | ||
|
||
tp_size = env.get("CM_VLLM_SERVER_TP_SIZE", False) | ||
if tp_size: | ||
cmd_args += f" --tensor-parallel-size {tp_size}" | ||
|
||
pp_size = env.get("CM_VLLM_SERVER_PP_SIZE", False) | ||
if pp_size: | ||
cmd_args += f" --pipeline-parallel-size {pp_size}" | ||
|
||
api_key = env.get("CM_VLLM_SERVER_API_KEY", "root") | ||
if pp_size: | ||
cmd_args += f" --api-key {api_key}" | ||
|
||
distributed_executor_backend = env.get("CM_VLLM_SERVER_DIST_EXEC_BACKEND", False) | ||
if distributed_executor_backend: | ||
cmd_args += f" --distributed-executor-backend {distributed_executor_backend}" | ||
|
||
cmd = f"{env['CM_PYTHON_BIN_WITH_PATH']} -m vllm.entrypoints.openai.api_server {cmd_args}" | ||
print(cmd) | ||
|
||
env['CM_VLLM_RUN_CMD'] = cmd | ||
|
||
return {'return':0} | ||
|
||
def postprocess(i): | ||
|
||
env = i['env'] | ||
|
||
return {'return':0} |
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,6 @@ | ||
#!/bin/bash | ||
|
||
echo ${CM_VLLM_RUN_CMD} | ||
|
||
${CM_VLLM_RUN_CMD} | ||
test $? -eq 0 || exit 1 |