49
49
# information.
50
50
#
51
51
# The TRITON_VERSION file indicates the Triton version and
52
- # TRITON_VERSION_MAP is used to determine the corresponding container
52
+ # DEFAULT_TRITON_VERSION_MAP is used to determine the corresponding container
53
53
# version and upstream container version (upstream containers are
54
54
# dependencies required by Triton). These versions may be overridden.
55
55
69
69
# different versions are used then one backend or the other will
70
70
# incorrectly load the other version of the openvino libraries.
71
71
#
72
- TRITON_VERSION_MAP = {
73
- "2.53.0dev" : (
74
- "24.12dev" , # triton container
75
- "24.10" , # upstream container
76
- "1.19.2" , # ORT
77
- "2024.4.0" , # ORT OpenVINO
78
- "2024.4.0" , # Standalone OpenVINO
79
- "3.2.6" , # DCGM version
80
- "0.5.5" , # vLLM version
81
- "3.12.3" , # RHEL Python version
82
- )
72
+
73
+ DEFAULT_TRITON_VERSION_MAP = {
74
+ "release_version" : "2.53.0dev" ,
75
+ "triton_container_version" : "24.12dev" ,
76
+ "upstream_container_version" : "24.10" ,
77
+ "ort_version" : "1.19.2" ,
78
+ "ort_openvino_version" : "2024.4.0" ,
79
+ "standalone_openvino_version" : "2024.4.0" ,
80
+ "dcgm_version" : "3.2.6" ,
81
+ "vllm_version" : "0.5.5" ,
82
+ "rhel_py_version" : "3.12.3" ,
83
83
}
84
84
85
85
CORE_BACKENDS = ["ensemble" ]
@@ -142,13 +142,9 @@ def target_machine():
142
142
143
143
def container_versions (version , container_version , upstream_container_version ):
144
144
if container_version is None :
145
- if version not in TRITON_VERSION_MAP :
146
- fail ("container version not known for {}" .format (version ))
147
- container_version = TRITON_VERSION_MAP [version ][0 ]
145
+ container_version = FLAGS .triton_container_version
148
146
if upstream_container_version is None :
149
- if version not in TRITON_VERSION_MAP :
150
- fail ("upstream container version not known for {}" .format (version ))
151
- upstream_container_version = TRITON_VERSION_MAP [version ][1 ]
147
+ upstream_container_version = FLAGS .upstream_container_version
152
148
return container_version , upstream_container_version
153
149
154
150
@@ -665,7 +661,7 @@ def onnxruntime_cmake_args(images, library_paths):
665
661
None ,
666
662
os .getenv ("TRITON_BUILD_ONNXRUNTIME_VERSION" )
667
663
if os .getenv ("TRITON_BUILD_ONNXRUNTIME_VERSION" )
668
- else TRITON_VERSION_MAP [ FLAGS .version ][ 2 ] ,
664
+ else FLAGS .ort_version ,
669
665
)
670
666
]
671
667
@@ -701,15 +697,15 @@ def onnxruntime_cmake_args(images, library_paths):
701
697
"onnxruntime" ,
702
698
"TRITON_BUILD_CONTAINER_VERSION" ,
703
699
None ,
704
- TRITON_VERSION_MAP [ FLAGS .version ][ 1 ] ,
700
+ FLAGS .triton_container_version ,
705
701
)
706
702
)
707
703
708
704
# TODO: TPRD-333 OpenVino extension is not currently supported by our manylinux build
709
705
if (
710
706
(target_machine () != "aarch64" )
711
707
and (target_platform () != "rhel" )
712
- and (TRITON_VERSION_MAP [ FLAGS .version ][ 3 ] is not None )
708
+ and (FLAGS .ort_openvino_version is not None )
713
709
):
714
710
cargs .append (
715
711
cmake_backend_enable (
@@ -721,7 +717,7 @@ def onnxruntime_cmake_args(images, library_paths):
721
717
"onnxruntime" ,
722
718
"TRITON_BUILD_ONNXRUNTIME_OPENVINO_VERSION" ,
723
719
None ,
724
- TRITON_VERSION_MAP [ FLAGS .version ][ 3 ] ,
720
+ FLAGS .ort_openvino_version ,
725
721
)
726
722
)
727
723
@@ -744,7 +740,7 @@ def openvino_cmake_args():
744
740
"openvino" ,
745
741
"TRITON_BUILD_OPENVINO_VERSION" ,
746
742
None ,
747
- TRITON_VERSION_MAP [ FLAGS .version ][ 4 ] ,
743
+ FLAGS .standalone_openvino_version ,
748
744
)
749
745
]
750
746
if target_platform () == "windows" :
@@ -767,7 +763,7 @@ def openvino_cmake_args():
767
763
"openvino" ,
768
764
"TRITON_BUILD_CONTAINER_VERSION" ,
769
765
None ,
770
- TRITON_VERSION_MAP [ FLAGS .version ][ 1 ] ,
766
+ FLAGS .upstream_container_version ,
771
767
)
772
768
)
773
769
return cargs
@@ -822,7 +818,7 @@ def fil_cmake_args(images):
822
818
"fil" ,
823
819
"TRITON_BUILD_CONTAINER_VERSION" ,
824
820
None ,
825
- TRITON_VERSION_MAP [ FLAGS .version ][ 1 ] ,
821
+ FLAGS .upstream_container_version ,
826
822
)
827
823
)
828
824
@@ -968,7 +964,7 @@ def create_dockerfile_buildbase_rhel(ddir, dockerfile_name, argmap):
968
964
wget
969
965
"""
970
966
# Requires openssl-devel to be installed first for pyenv build to be successful
971
- df += change_default_python_version_rhel (TRITON_VERSION_MAP [ FLAGS .version ][ 7 ] )
967
+ df += change_default_python_version_rhel (FLAGS .rhel_py_version )
972
968
df += """
973
969
974
970
RUN pip3 install --upgrade pip \\
@@ -1230,7 +1226,6 @@ def create_dockerfile_linux(
1230
1226
LABEL com.amazonaws.sagemaker.capabilities.multi-models=true
1231
1227
COPY --chown=1000:1000 docker/sagemaker/serve /usr/bin/.
1232
1228
"""
1233
-
1234
1229
# This is required since libcublasLt.so is not present during the build
1235
1230
# stage of the PyTorch backend
1236
1231
if not FLAGS .enable_gpu and ("pytorch" in backends ):
@@ -1414,9 +1409,7 @@ def dockerfile_prepare_container_linux(argmap, backends, enable_gpu, target_mach
1414
1409
readline-devel
1415
1410
"""
1416
1411
# Requires openssl-devel to be installed first for pyenv build to be successful
1417
- df += change_default_python_version_rhel (
1418
- TRITON_VERSION_MAP [FLAGS .version ][7 ]
1419
- )
1412
+ df += change_default_python_version_rhel (FLAGS .rhel_py_version )
1420
1413
df += """
1421
1414
RUN pip3 install --upgrade pip \\
1422
1415
&& pip3 install --upgrade \\
@@ -1455,7 +1448,7 @@ def dockerfile_prepare_container_linux(argmap, backends, enable_gpu, target_mach
1455
1448
# vLLM needed for vLLM backend
1456
1449
RUN pip3 install vllm=={}
1457
1450
""" .format (
1458
- TRITON_VERSION_MAP [ FLAGS .version ][ 6 ]
1451
+ FLAGS .vllm_version
1459
1452
)
1460
1453
1461
1454
if "dali" in backends :
@@ -1487,7 +1480,6 @@ def dockerfile_prepare_container_linux(argmap, backends, enable_gpu, target_mach
1487
1480
""" .format (
1488
1481
argmap ["NVIDIA_BUILD_ID" ], argmap ["NVIDIA_BUILD_ID" ], argmap ["NVIDIA_BUILD_REF" ]
1489
1482
)
1490
-
1491
1483
return df
1492
1484
1493
1485
@@ -1647,9 +1639,7 @@ def create_build_dockerfiles(
1647
1639
"TRITON_VERSION" : FLAGS .version ,
1648
1640
"TRITON_CONTAINER_VERSION" : FLAGS .container_version ,
1649
1641
"BASE_IMAGE" : base_image ,
1650
- "DCGM_VERSION" : ""
1651
- if FLAGS .version is None or FLAGS .version not in TRITON_VERSION_MAP
1652
- else TRITON_VERSION_MAP [FLAGS .version ][5 ],
1642
+ "DCGM_VERSION" : FLAGS .dcgm_version ,
1653
1643
}
1654
1644
1655
1645
# For CPU-only image we need to copy some cuda libraries and dependencies
@@ -2027,9 +2017,7 @@ def backend_build(
2027
2017
# installed within the container will not be picked up by the python backend stub process pybind
2028
2018
# bindings. It must instead must be installed via pyenv. We package it here for better usability.
2029
2019
if target_platform () == "rhel" and be == "python" :
2030
- major_minor_version = "." .join (
2031
- (TRITON_VERSION_MAP [FLAGS .version ][7 ]).split ("." )[:2 ]
2032
- )
2020
+ major_minor_version = "." .join ((FLAGS .rhel_py_version ).split ("." )[:2 ])
2033
2021
version_matched_files = "/usr/lib64/libpython" + major_minor_version + "*"
2034
2022
cmake_script .cp (
2035
2023
version_matched_files , os .path .join (repo_install_dir , "backends" , be )
@@ -2479,12 +2467,6 @@ def enable_all():
2479
2467
required = False ,
2480
2468
help = "The Triton container version to build. If not specified the container version will be chosen automatically based on --version value." ,
2481
2469
)
2482
- parser .add_argument (
2483
- "--upstream-container-version" ,
2484
- type = str ,
2485
- required = False ,
2486
- help = "The upstream container version to use for the build. If not specified the upstream container version will be chosen automatically based on --version value." ,
2487
- )
2488
2470
parser .add_argument (
2489
2471
"--container-prebuild-command" ,
2490
2472
type = str ,
@@ -2632,7 +2614,60 @@ def enable_all():
2632
2614
required = False ,
2633
2615
help = "Override specified backend CMake argument in the build as <backend>:<name>=<value>. The argument is passed to CMake as -D<name>=<value>. This flag only impacts CMake arguments that are used by build.py. To unconditionally add a CMake argument to the backend build use --extra-backend-cmake-arg." ,
2634
2616
)
2635
-
2617
+ parser .add_argument (
2618
+ "--release-version" ,
2619
+ required = False ,
2620
+ default = DEFAULT_TRITON_VERSION_MAP ["release_version" ],
2621
+ help = "This flag sets the release version for Triton Inference Server to be built. Default: the latest released version." ,
2622
+ )
2623
+ parser .add_argument (
2624
+ "--triton-container-version" ,
2625
+ required = False ,
2626
+ default = DEFAULT_TRITON_VERSION_MAP ["triton_container_version" ],
2627
+ help = "This flag sets the container version for Triton Inference Server to be built. Default: the latest released version." ,
2628
+ )
2629
+ parser .add_argument (
2630
+ "--upstream-container-version" ,
2631
+ required = False ,
2632
+ default = DEFAULT_TRITON_VERSION_MAP ["upstream_container_version" ],
2633
+ help = "This flag sets the upstream container version for Triton Inference Server to be built. Default: the latest released version." ,
2634
+ )
2635
+ parser .add_argument (
2636
+ "--ort-version" ,
2637
+ required = False ,
2638
+ default = DEFAULT_TRITON_VERSION_MAP ["ort_version" ],
2639
+ help = "This flag sets the ORT version for Triton Inference Server to be built. Default: the latest supported version." ,
2640
+ )
2641
+ parser .add_argument (
2642
+ "--ort-openvino-version" ,
2643
+ required = False ,
2644
+ default = DEFAULT_TRITON_VERSION_MAP ["ort_openvino_version" ],
2645
+ help = "This flag sets the OpenVino version for Triton Inference Server to be built. Default: the latest supported version." ,
2646
+ )
2647
+ parser .add_argument (
2648
+ "--standalone-openvino-version" ,
2649
+ required = False ,
2650
+ default = DEFAULT_TRITON_VERSION_MAP ["standalone_openvino_version" ],
2651
+ help = "This flag sets the standalon OpenVino version for Triton Inference Server to be built. Default: the latest supported version." ,
2652
+ )
2653
+ parser .add_argument (
2654
+ "--dcgm-version" ,
2655
+ required = False ,
2656
+ default = DEFAULT_TRITON_VERSION_MAP ["dcgm_version" ],
2657
+ help = "This flag sets the DCGM version for Triton Inference Server to be built. Default: the latest supported version." ,
2658
+ )
2659
+ parser .add_argument (
2660
+ "--vllm-version" ,
2661
+ required = False ,
2662
+ default = DEFAULT_TRITON_VERSION_MAP ["vllm_version" ],
2663
+ help = "This flag sets the vLLM version for Triton Inference Server to be built. Default: the latest supported version." ,
2664
+ )
2665
+ parser .add_argument (
2666
+ "--rhel-py-version" ,
2667
+ required = False ,
2668
+ default = DEFAULT_TRITON_VERSION_MAP ["rhel_py_version" ],
2669
+ help = "This flag sets the Python version for RHEL platform of Triton Inference Server to be built. Default: the latest supported version." ,
2670
+ )
2636
2671
FLAGS = parser .parse_args ()
2637
2672
2638
2673
if FLAGS .image is None :
@@ -2689,8 +2724,7 @@ def enable_all():
2689
2724
# Determine the versions. Start with Triton version, if --version
2690
2725
# is not explicitly specified read from TRITON_VERSION file.
2691
2726
if FLAGS .version is None :
2692
- with open (os .path .join (THIS_SCRIPT_DIR , "TRITON_VERSION" ), "r" ) as vfile :
2693
- FLAGS .version = vfile .readline ().strip ()
2727
+ FLAGS .version = DEFAULT_TRITON_VERSION_MAP ["release_version" ]
2694
2728
2695
2729
if FLAGS .build_parallel is None :
2696
2730
FLAGS .build_parallel = multiprocessing .cpu_count () * 2
@@ -2708,15 +2742,9 @@ def enable_all():
2708
2742
# explicitly. For release branches we use the release branch as
2709
2743
# the default, otherwise we use 'main'.
2710
2744
default_repo_tag = "main"
2711
- cver = FLAGS .container_version
2745
+ cver = FLAGS .upstream_container_version
2712
2746
if cver is None :
2713
- if FLAGS .version not in TRITON_VERSION_MAP :
2714
- fail (
2715
- "unable to determine default repo-tag, container version not known for {}" .format (
2716
- FLAGS .version
2717
- )
2718
- )
2719
- cver = TRITON_VERSION_MAP [FLAGS .version ][0 ]
2747
+ cver = FLAGS .triton_container_version
2720
2748
if not cver .endswith ("dev" ):
2721
2749
default_repo_tag = "r" + cver
2722
2750
log ("default repo-tag: {}" .format (default_repo_tag ))
0 commit comments