Skip to content

Commit 4470835

Browse files
committed
allow changing github org for individual backends
1 parent 2e0d632 commit 4470835

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

build.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import os.path
3333
import pathlib
3434
import platform
35+
import re
3536
import stat
3637
import subprocess
3738
import sys
@@ -2062,14 +2063,14 @@ def tensorrtllm_postbuild(cmake_script, repo_install_dir, tensorrtllm_be_dir):
20622063
def backend_build(
20632064
be,
20642065
cmake_script,
2065-
tag,
2066+
tag_org,
20662067
build_dir,
20672068
install_dir,
2068-
github_organization,
20692069
images,
20702070
components,
20712071
library_paths,
20722072
):
2073+
tag, github_organization = tag_org
20732074
repo_build_dir = os.path.join(build_dir, be, "build")
20742075
repo_install_dir = os.path.join(build_dir, be, "install")
20752076

@@ -2082,8 +2083,8 @@ def backend_build(
20822083
if be == "tensorrtllm":
20832084
github_organization = (
20842085
"https://github.com/NVIDIA"
2085-
if "triton-inference-server" in FLAGS.github_organization
2086-
else FLAGS.github_organization
2086+
if "triton-inference-server" in github_organization
2087+
else github_organization
20872088
)
20882089
repository_name = "TensorRT-LLM"
20892090
cmake_script.gitclone(repository_name, tag, be, github_organization)
@@ -2132,11 +2133,11 @@ def backend_build(
21322133
def backend_clone(
21332134
be,
21342135
clone_script,
2135-
tag,
2136+
tag_org,
21362137
build_dir,
21372138
install_dir,
2138-
github_organization,
21392139
):
2140+
tag, github_organization = tag_org
21402141
clone_script.commentln(8)
21412142
clone_script.comment(f"'{be}' backend")
21422143
clone_script.comment("Delete this section to remove backend from build")
@@ -2676,7 +2677,7 @@ def enable_all():
26762677
"--backend",
26772678
action="append",
26782679
required=False,
2679-
help='Include specified backend in build as <backend-name>[:<repo-tag>]. If <repo-tag> starts with "pull/" then it refers to a pull-request reference, otherwise <repo-tag> indicates the git tag/branch to use for the build. If the version is non-development then the default <repo-tag> is the release branch matching the container version (e.g. version YY.MM -> branch rYY.MM); otherwise the default <repo-tag> is "main" (e.g. version YY.MMdev -> branch main).',
2680+
help='Include specified backend in build as <backend-name>[:<repo-tag>][:<org>]. If <repo-tag> starts with "pull/" then it refers to a pull-request reference, otherwise <repo-tag> indicates the git tag/branch to use for the build. If the version is non-development then the default <repo-tag> is the release branch matching the container version (e.g. version YY.MM -> branch rYY.MM); otherwise the default <repo-tag> is "main" (e.g. version YY.MMdev -> branch main). <org> allows using a forked repository instead of the default --github-organization value.',
26802681
)
26812682
parser.add_argument(
26822683
"--repo-tag",
@@ -2899,11 +2900,14 @@ def enable_all():
28992900
# Initialize map of backends to build and repo-tag for each.
29002901
backends = {}
29012902
for be in FLAGS.backend:
2902-
parts = be.split(":")
2903+
pattern = r"(https?:\/\/[^\s:]+)|:"
2904+
parts = list(filter(None,re.split(pattern, be)))
29032905
if len(parts) == 1:
29042906
parts.append(default_repo_tag)
2905-
log('backend "{}" at tag/branch "{}"'.format(parts[0], parts[1]))
2906-
backends[parts[0]] = parts[1]
2907+
if len(parts) == 2:
2908+
parts.append(FLAGS.github_organization)
2909+
log('backend "{}" at tag/branch "{}" from org "{}"'.format(parts[0], parts[1], parts[2]))
2910+
backends[parts[0]] = parts[1:]
29072911

29082912
if "vllm" in backends:
29092913
if "python" not in backends:
@@ -3111,7 +3115,6 @@ def enable_all():
31113115
backends[be],
31123116
script_build_dir,
31133117
script_install_dir,
3114-
github_organization,
31153118
)
31163119
else:
31173120
backend_build(
@@ -3120,7 +3123,6 @@ def enable_all():
31203123
backends[be],
31213124
script_build_dir,
31223125
script_install_dir,
3123-
github_organization,
31243126
images,
31253127
components,
31263128
library_paths,

0 commit comments

Comments
 (0)