Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .github/scripts/filter-matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
# jetpack 6.2 only officially supports python 3.10 and cu126
jetpack_python_versions: List[str] = ["3.10"]
jetpack_cuda_versions: List[str] = ["cu126"]
rtx_cuda_versions: List[str] = ["cu130", "cu132"]
trt_cuda_versions: List[str] = ["cu130", "cu132"]
# CUDA 12.6 wheels are published for x86_64 only. Keep the Arm matrices on
# CUDA 13, including Windows Arm/AArch64.
x86_cuda_versions: List[str] = ["cu126", "cu130", "cu132"]
arm_cuda_versions: List[str] = ["cu130", "cu132"]

# For PRs we build/test a single representative config to keep cycle time short.
# Full matrix runs on main / nightly / release branches.
Expand Down Expand Up @@ -74,12 +76,16 @@ def filter_matrix_item(
return True
return False
else:
cuda_versions = (
arm_cuda_versions
if item["gpu_arch_type"] in {"cuda-aarch64", "cuda-arm64"}
else x86_cuda_versions
)
if use_rtx:
if item["desired_cuda"] not in rtx_cuda_versions:
return False
else:
if item["desired_cuda"] not in trt_cuda_versions:
if item["desired_cuda"] not in cuda_versions:
return False
elif item["desired_cuda"] not in cuda_versions:
return False
if item["gpu_arch_type"] == "cuda-aarch64":
# pytorch image:pytorch/manylinuxaarch64-builder:cuda12.8 comes with glibc2.28
# however, TensorRT requires glibc2.31 on aarch64 platform
Expand Down
11 changes: 9 additions & 2 deletions .github/scripts/generate-release-matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import sys

RELEASE_CUDA_VERSION = {
"wheel": ["cu130", "cu132"],
"tarball": ["cu130", "cu132"],
"wheel": ["cu126", "cu130", "cu132"],
"tarball": ["cu126", "cu130", "cu132"],
}
RELEASE_PYTHON_VERSION = {
"wheel": ["3.10", "3.11", "3.12", "3.13", "3.14"],
Expand Down Expand Up @@ -49,6 +49,13 @@ def main(args: list[str]) -> None:
includes = matrix_dict["include"]
filtered_includes = []
for item in includes:
# CUDA 12.6 release artifacts are available only for x86_64. This
# excludes both Linux AArch64 and Windows Arm/AArch64 matrix entries.
if item["desired_cuda"] == "cu126" and item["gpu_arch_type"] in {
"cuda-aarch64",
"cuda-arm64",
}:
continue
if (
item["desired_cuda"] in cuda_versions
and item["python_version"] in python_versions
Expand Down
23 changes: 22 additions & 1 deletion .github/workflows/release-linux-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,27 @@ jobs:
smoke-test-script: ${{ matrix.smoke-test-script }}
trigger-event: ${{ github.event_name }}
is-release-wheel: true

release-executorch-runtime-wheel-artifacts:
name: Release x86_64 torch-tensorrt-executorch-runtime wheel artifacts
needs: [generate-release-wheel-matrix]
uses: ./.github/workflows/build_linux.yml
with:
repository: pytorch/tensorrt
ref: ""
test-infra-repository: pytorch/test-infra
test-infra-ref: main
build-matrix: ${{ needs.generate-release-wheel-matrix.outputs.matrix }}
pre-script: packaging/pre_build_script.sh
package-name: torch_tensorrt_executorch_runtime
build-platform: python-build-package
build-command: >-
bash -c 'python -m pip install pyyaml "executorch==1.4.1" && python -m pip wheel --no-build-isolation --no-deps --wheel-dir dist py/torch-tensorrt-executorch-runtime'
artifact-name-prefix: torch-tensorrt-executorch-runtime
trigger-event: ${{ github.event_name }}
is-release-wheel: true
run-smoke-test: false

concurrency:
group: ${{ github.workflow }}-x86_64-release-${{ github.event.pull_request.number || github.ref_name }}-${{ inputs.repository }}-${{ github.event_name == 'workflow_dispatch' }}-${{ inputs.job-name }}
cancel-in-progress: true
cancel-in-progress: true
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
bazel
/node_modules/
/package.json
bazel-bazel-test
bazel-bin
bazel-genfiles
Expand Down Expand Up @@ -95,4 +97,4 @@ CLAUDE.md
/external/
build-executorch/
py/torch-tensorrt-executorch-runtime/build/
py/torch-tensorrt-executorch-runtime/dist/
py/torch-tensorrt-executorch-runtime/dist/
195 changes: 194 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions packaging/pre_build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,23 @@ if [[ ! -d "${TORCH_INSTALL_PATH}/include/c10" ]]; then
exit 1
fi

# TensorRT archives have different CUDA compatibility ceilings. CI provides
# CU_VERSION in the PyTorch wheel format (for example, cu132).
case "${CU_VERSION}" in
cu12*)
export TENSORRT_CUDA_VERSION_UPPER_BOUND="12.9"
export TENSORRT_RTX_CUDA_VERSION_UPPER_BOUND="12.9"
;;
cu13*)
export TENSORRT_CUDA_VERSION_UPPER_BOUND="13.3"
export TENSORRT_RTX_CUDA_VERSION_UPPER_BOUND="13.4"
;;
*)
echo "ERROR: Unsupported CUDA version '${CU_VERSION}' for TensorRT archive selection."
exit 1
;;
esac

cat toolchains/ci_workspaces/MODULE.bazel.tmpl | envsubst > MODULE.bazel

if [[ ${TENSORRT_VERSION} != "" ]]; then
Expand Down
17 changes: 17 additions & 0 deletions packaging/pre_build_script_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,23 @@ unzip fmt.zip
cp -r fmt-12.0.0/include/fmt/ $TORCH_INSTALL_PATH/include/
ls -lart $TORCH_INSTALL_PATH/include/fmt/

# TensorRT archives have different CUDA compatibility ceilings. CI provides
# CU_VERSION in the PyTorch wheel format (for example, cu132).
case "${CU_VERSION}" in
cu12*)
export TENSORRT_CUDA_VERSION_UPPER_BOUND="12.9"
export TENSORRT_RTX_CUDA_VERSION_UPPER_BOUND="12.9"
;;
cu13*)
export TENSORRT_CUDA_VERSION_UPPER_BOUND="13.3"
export TENSORRT_RTX_CUDA_VERSION_UPPER_BOUND="13.4"
;;
*)
echo "ERROR: Unsupported CUDA version '${CU_VERSION}' for TensorRT archive selection."
exit 1
;;
esac

cat toolchains/ci_workspaces/MODULE.bazel.tmpl | envsubst > MODULE.bazel

if [[ ${TENSORRT_VERSION} != "" ]]; then
Expand Down
19 changes: 10 additions & 9 deletions py/torch-tensorrt-executorch-runtime/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
REPO_ROOT = HERE.parents[1]
BAZEL_TARGET = "//py/torch-tensorrt-executorch-runtime/native:delegate_native"
BUILD_NONCE = os.getenv("TORCH_TENSORRT_EXECUTORCH_BUILD_NONCE", uuid.uuid4().hex)
TENSORRT_DISTRIBUTION = "tensorrt-cu13"
CUDA_RUNTIME_DISTRIBUTION = "nvidia-cuda-runtime"


Expand Down Expand Up @@ -50,14 +49,16 @@ def installed_version(distribution: str) -> str:
) from error


def require_cuda_13() -> None:
"""Reject builds whose native dependencies do not use supported CUDA 13."""
def tensorrt_distribution() -> str:
"""Return the TensorRT distribution matching the PyTorch CUDA build."""
cuda_version = torch.version.cuda
if cuda_version is None or not cuda_version.startswith("13."):
raise RuntimeError(
"CUDA 13-enabled PyTorch is required to build this wheel "
f"(found CUDA {cuda_version or 'None'})"
)
if cuda_version is None:
raise RuntimeError("CUDA-enabled PyTorch is required to build this wheel")
if cuda_version.startswith("12.6"):
return "tensorrt-cu12"
if cuda_version.startswith("13."):
return "tensorrt-cu13"
raise RuntimeError(f"Unsupported CUDA version: {cuda_version}")


class BazelExtension(Extension):
Expand Down Expand Up @@ -139,7 +140,7 @@ def build_extension(self, ext: Extension) -> None:
shutil.copy2(source, output.parent / dependency)


require_cuda_13()
TENSORRT_DISTRIBUTION = tensorrt_distribution()
executorch_version = installed_version("executorch")
tensorrt_version = installed_version(TENSORRT_DISTRIBUTION)
cuda_runtime_version = installed_version(CUDA_RUNTIME_DISTRIBUTION)
Expand Down
Loading
Loading