From bb3480ff99f82729cfe72f1362df4526ded0120c Mon Sep 17 00:00:00 2001 From: dyastremsky <58150256+dyastremsky@users.noreply.github.com> Date: Sun, 8 Oct 2023 08:16:33 -0700 Subject: [PATCH 1/2] Update build.py to build vLLM backend (#6394) --- build.py | 76 ++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 65 insertions(+), 11 deletions(-) diff --git a/build.py b/build.py index 06859214ce..061aca06b7 100755 --- a/build.py +++ b/build.py @@ -80,6 +80,7 @@ "py310_23.1.0-1", # Conda version "9.1.0.1", # TRT version for building TRT-LLM backend "12.2", # CUDA version for building TRT-LLM backend + "0.2.0", # vLLM version ) } @@ -1332,6 +1333,16 @@ def dockerfile_prepare_container_linux(argmap, backends, enable_gpu, target_mach argmap["TRT_LLM_TRT_VERSION"], argmap["TRT_LLM_CUDA_VERSION"] ) + if "vllm" in backends: + # [DLIS-5606] Build Conda environment for vLLM backend + # Remove Pip install once vLLM backend moves to Conda environment. + df += """ +# vLLM needed for vLLM backend +RUN pip3 install vllm=={} +""".format( + TRITON_VERSION_MAP[FLAGS.version][9] + ) + df += """ WORKDIR /opt/tritonserver RUN rm -fr /opt/tritonserver/* @@ -1839,6 +1850,39 @@ def backend_build( cmake_script.blankln() +def backend_clone( + be, + clone_script, + tag, + build_dir, + install_dir, + github_organization, +): + clone_script.commentln(8) + clone_script.comment(f"'{be}' backend") + clone_script.comment("Delete this section to remove backend from build") + clone_script.comment() + clone_script.mkdir(build_dir) + clone_script.cwd(build_dir) + clone_script.gitclone(backend_repo(be), tag, be, github_organization) + + repo_target_dir = os.path.join(install_dir, "backends") + clone_script.mkdir(repo_target_dir) + backend_dir = os.path.join(repo_target_dir, be) + clone_script.rmdir(backend_dir) + clone_script.mkdir(backend_dir) + + clone_script.cp( + os.path.join(build_dir, be, "src", "model.py"), + backend_dir, + ) + + clone_script.comment() + clone_script.comment(f"end '{be}' backend") + clone_script.commentln(8) + clone_script.blankln() + + def repo_agent_build( ra, cmake_script, build_dir, install_dir, repoagent_repo, repoagents ): @@ -2691,17 +2735,27 @@ def enable_all(): else: github_organization = FLAGS.github_organization - backend_build( - be, - cmake_script, - backends[be], - script_build_dir, - script_install_dir, - github_organization, - images, - components, - library_paths, - ) + if be == "vllm": + backend_clone( + be, + cmake_script, + backends[be], + script_build_dir, + script_install_dir, + github_organization, + ) + else: + backend_build( + be, + cmake_script, + backends[be], + script_build_dir, + script_install_dir, + github_organization, + images, + components, + library_paths, + ) # Commands to build each repo agent... for ra in repoagents: From d5e5a782738df7aea11c142dbb32fd39dd924b35 Mon Sep 17 00:00:00 2001 From: dyastremsky <58150256+dyastremsky@users.noreply.github.com> Date: Sat, 7 Oct 2023 21:13:59 -0700 Subject: [PATCH 2/2] Add Python backend when vLLM backend built (#6397) --- build.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build.py b/build.py index 061aca06b7..b90197fb64 100755 --- a/build.py +++ b/build.py @@ -2548,6 +2548,15 @@ def enable_all(): log('backend "{}" at tag/branch "{}"'.format(parts[0], parts[1])) backends[parts[0]] = parts[1] + if "vllm" in backends: + if "python" not in backends: + log( + "vLLM backend requires Python backend, adding Python backend with tag {}".format( + backends["vllm"] + ) + ) + backends["python"] = backends["vllm"] + # Initialize map of repo agents to build and repo-tag for each. repoagents = {} for be in FLAGS.repoagent: