Skip to content

chore: remove pre-cxx11 abi #3473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 30, 2025
Merged
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
4 changes: 0 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ build:cxx11_abi --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=1"
build:cxx11_abi --linkopt="-D_GLIBCXX_USE_CXX11_ABI=1"
build:cxx11_abi --define=abi=cxx11_abi

build:pre_cxx11_abi --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"
build:pre_cxx11_abi --linkopt="-D_GLIBCXX_USE_CXX11_ABI=0"
build:pre_cxx11_abi --define=abi=pre_cxx11_abi

build:ci_testing --define=torchtrt_src=prebuilt --cxxopt="-DDISABLE_TEST_IN_CI" --action_env "NVIDIA_TF32_OVERRIDE=0"
build:use_precompiled_torchtrt --define=torchtrt_src=prebuilt

Expand Down
25 changes: 7 additions & 18 deletions .github/scripts/generate_binary_build_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
}

PACKAGE_TYPES = ["wheel", "conda", "libtorch"]
PRE_CXX11_ABI = "pre-cxx11"
CXX11_ABI = "cxx11-abi"
RELEASE = "release"
DEBUG = "debug"
Expand Down Expand Up @@ -141,39 +140,29 @@ def initialize_globals(channel: str, build_python_only: bool) -> None:
else:
PYTHON_ARCHES = PYTHON_ARCHES_DICT[channel]
WHEEL_CONTAINER_IMAGES = {
"11.8": "pytorch/manylinux2_28-builder:cuda11.8",
"12.1": "pytorch/manylinux2_28-builder:cuda12.1",
"12.4": "pytorch/manylinux2_28-builder:cuda12.4",
"12.6": "pytorch/manylinux2_28-builder:cuda12.6",
"12.8": "pytorch/manylinux2_28-builder:cuda12.8",
**{
gpu_arch: f"pytorch/manylinux2_28-builder:cuda{gpu_arch}"
for gpu_arch in CUDA_ARCHES
},
**{
gpu_arch: f"pytorch/manylinux2_28-builder:rocm{gpu_arch}"
for gpu_arch in ROCM_ARCHES
},
CPU: "pytorch/manylinux2_28-builder:cpu",
XPU: "pytorch/manylinux2_28-builder:xpu",
# TODO: Migrate CUDA_AARCH64 image to manylinux2_28_aarch64-builder:cuda12.4
# TODO: Migrate CUDA_AARCH64 image to manylinux2_28_aarch64-builder:cuda12.6
CPU_AARCH64: "pytorch/manylinux2_28_aarch64-builder:cpu-aarch64",
CUDA_AARCH64: "pytorch/manylinuxaarch64-builder:cuda12.4",
CUDA_AARCH64: "pytorch/manylinuxaarch64-builder:cuda12.6",
}
LIBTORCH_CONTAINER_IMAGES = {
**{
(gpu_arch, PRE_CXX11_ABI): f"pytorch/manylinux2_28-builder:cuda{gpu_arch}"
for gpu_arch in CUDA_ARCHES
},
**{
(gpu_arch, CXX11_ABI): f"pytorch/libtorch-cxx11-builder:cuda{gpu_arch}"
for gpu_arch in CUDA_ARCHES
},
**{
(gpu_arch, PRE_CXX11_ABI): f"pytorch/manylinux2_28-builder:rocm{gpu_arch}"
for gpu_arch in ROCM_ARCHES
},
**{
(gpu_arch, CXX11_ABI): f"pytorch/libtorch-cxx11-builder:rocm{gpu_arch}"
for gpu_arch in ROCM_ARCHES
},
(CPU, PRE_CXX11_ABI): "pytorch/manylinux2_28-builder:cpu",
(CPU, CXX11_ABI): "pytorch/libtorch-cxx11-builder:cpu",
}

Expand Down Expand Up @@ -344,7 +333,7 @@ def generate_libtorch_matrix(
if os == WINDOWS:
abi_versions = [RELEASE, DEBUG]
elif os == LINUX:
abi_versions = [PRE_CXX11_ABI, CXX11_ABI]
abi_versions = [CXX11_ABI]
elif os in [MACOS_ARM64]:
abi_versions = [CXX11_ABI]
else:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/docgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ jobs:
id: vars
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Build Python Package
env:
USE_PRE_CXX11_ABI: 0
run: |
python3 -m pip install --pre . --extra-index-url https://download.pytorch.org/whl/nightly/cu128
- name: Generate New Docs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ jobs:
echo "${MATRIX_BLOB}"
echo "matrix=${MATRIX_BLOB}" >> "${GITHUB_OUTPUT}"

release-other-artifacts:
name: Release torch-tensorrt wheel and pre-cxx11 tarball artifacts
release-wheel-artifacts:
name: Release torch-tensorrt wheel artifacts
needs: [generate-release-wheel-matrix]
strategy:
fail-fast: false
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/release-wheel-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,6 @@ jobs:
release/tarball/libtorchtrt-${BUILD_VERSION}-tensorrt${TRT_VERSION}-cuda${CU_VERSION:2}-libtorch${PYTORCH_VERSION}-x86_64-linux.tar.gz
else
${CONDA_RUN} python setup.py bdist_wheel --release

cp bazel-bin/libtorchtrt.tar.gz \
release/tarball/libtorchtrt-${BUILD_VERSION}-pre-cxx11-abi-tensorrt${TRT_VERSION}-cuda${CU_VERSION:2}-libtorch${PYTORCH_VERSION}-x86_64-linux.tar.gz

${CONDA_RUN} python -m pip install auditwheel
${CONDA_RUN} python -m auditwheel repair \
$(cat py/ci/soname_excludes.params) \
Expand Down Expand Up @@ -240,13 +236,6 @@ jobs:
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ inputs.repository }}/release/wheel/
- name: Upload pre-cxx11 tarball to GitHub
if: ${{ inputs.cxx11-tarball-release != 'true' && env.PYTHON_VERSION == '3.11' }}
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: pre-cxx11-tarball-${{ env.PYTHON_VERSION }}-${{ env.CU_VERSION }}
path: ${{ inputs.repository }}/release/tarball/
- name: Upload cxx11 tarball to GitHub
if: ${{ inputs.cxx11-tarball-release == 'true' }}
continue-on-error: true
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ Environment variables supported by nox
```
PYT_PATH - To use different PYTHONPATH than system installed Python packages
TOP_DIR - To set the root directory of the noxfile
USE_PRE_CXX11 - To use pre_cxx11_abi (Defaults to 0)
USE_HOST_DEPS - To use host dependencies for tests (Defaults to 0)
```

Expand Down
20 changes: 1 addition & 19 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,6 @@ http_archive(
urls = ["https://download.pytorch.org/libtorch/nightly/cu128/libtorch-cxx11-abi-shared-with-deps-latest.zip"],
)

http_archive(
name = "libtorch_pre_cxx11_abi",
build_file = "@//third_party/libtorch:BUILD",
strip_prefix = "libtorch",
urls = ["https://download.pytorch.org/libtorch/nightly/cu128/libtorch-shared-with-deps-latest.zip"],
)

http_archive(
name = "libtorch_win",
build_file = "@//third_party/libtorch:BUILD",
Expand Down Expand Up @@ -98,25 +91,14 @@ http_archive(
# Locally installed dependencies (use in cases of custom dependencies or aarch64)
####################################################################################

# NOTE: In the case you are using just the pre-cxx11-abi path or just the cxx11 abi path
# with your local libtorch, just point deps at the same path to satisfy bazel.

# NOTE: NVIDIA's aarch64 PyTorch (python) wheel file uses the CXX11 ABI unlike PyTorch's standard
# x86_64 python distribution. If using NVIDIA's version just point to the root of the package
# for both versions here and do not use --config=pre-cxx11-abi
# NOTE: If you are using a local build of torch, just point the Libtorch dep to that path.

#new_local_repository(
# name = "libtorch",
# path = "/usr/local/lib/python3.6/dist-packages/torch",
# build_file = "third_party/libtorch/BUILD"
#)

#new_local_repository(
# name = "libtorch_pre_cxx11_abi",
# path = "/usr/local/lib/python3.6/dist-packages/torch",
# build_file = "third_party/libtorch/BUILD"
#)

#new_local_repository(
# name = "tensorrt",
# path = "/usr/",
Expand Down
18 changes: 8 additions & 10 deletions core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ load("@rules_pkg//:pkg.bzl", "pkg_tar")

package(default_visibility = ["//visibility:public"])

config_setting(
name = "use_pre_cxx11_abi",
values = {
"define": "abi=pre_cxx11_abi",
},
)

config_setting(
name = "python_core",
values = {
Expand Down Expand Up @@ -39,9 +32,14 @@ cc_library(
"//core/runtime",
"//core/util/logging",
] + select({
":windows": ["@tensorrt_win//:nvinfer", "@libtorch_win//:libtorch"],
":use_pre_cxx11_abi": ["@tensorrt//:nvinfer", "@libtorch_pre_cxx11_abi//:libtorch"],
"//conditions:default": ["@tensorrt//:nvinfer", "@libtorch"],
":windows": [
"@libtorch_win//:libtorch",
"@tensorrt_win//:nvinfer",
],
"//conditions:default": [
"@libtorch",
"@tensorrt//:nvinfer",
],
}),
alwayslink = True,
)
Expand Down
18 changes: 8 additions & 10 deletions core/conversion/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ load("@rules_pkg//:pkg.bzl", "pkg_tar")

package(default_visibility = ["//visibility:public"])

config_setting(
name = "use_pre_cxx11_abi",
values = {
"define": "abi=pre_cxx11_abi",
},
)

config_setting(
name = "windows",
constraint_values = [
Expand All @@ -34,9 +27,14 @@ cc_library(
"//core/ir",
"//core/util:prelude",
] + select({
":windows": ["@tensorrt_win//:nvinfer", "@libtorch_win//:libtorch"],
":use_pre_cxx11_abi": ["@tensorrt//:nvinfer", "@libtorch_pre_cxx11_abi//:libtorch"],
"//conditions:default": ["@tensorrt//:nvinfer", "@libtorch"],
":windows": [
"@libtorch_win//:libtorch",
"@tensorrt_win//:nvinfer",
],
"//conditions:default": [
"@libtorch",
"@tensorrt//:nvinfer",
],
}),
alwayslink = True,
)
Expand Down
18 changes: 8 additions & 10 deletions core/conversion/conversionctx/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ load("@rules_pkg//:pkg.bzl", "pkg_tar")

package(default_visibility = ["//visibility:public"])

config_setting(
name = "use_pre_cxx11_abi",
values = {
"define": "abi=pre_cxx11_abi",
},
)

config_setting(
name = "windows",
constraint_values = [
Expand All @@ -29,9 +22,14 @@ cc_library(
"//core/ir",
"//core/util:prelude",
] + select({
":windows": ["@tensorrt_win//:nvinfer", "@libtorch_win//:libtorch"],
":use_pre_cxx11_abi": ["@tensorrt//:nvinfer", "@libtorch_pre_cxx11_abi//:libtorch"],
"//conditions:default": ["@tensorrt//:nvinfer", "@libtorch"],
":windows": [
"@libtorch_win//:libtorch",
"@tensorrt_win//:nvinfer",
],
"//conditions:default": [
"@libtorch",
"@tensorrt//:nvinfer",
],
}),
alwayslink = True,
)
Expand Down
40 changes: 24 additions & 16 deletions core/conversion/converters/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ load("@rules_pkg//:pkg.bzl", "pkg_tar")

package(default_visibility = ["//visibility:public"])

config_setting(
name = "use_pre_cxx11_abi",
values = {
"define": "abi=pre_cxx11_abi",
},
)

config_setting(
name = "windows",
constraint_values = [
Expand All @@ -29,9 +22,14 @@ cc_library(
"//core/conversion/conversionctx",
"//core/util:prelude",
] + select({
":windows": ["@tensorrt_win//:nvinfer", "@libtorch_win//:libtorch"],
":use_pre_cxx11_abi": ["@tensorrt//:nvinfer", "@libtorch_pre_cxx11_abi//:libtorch"],
"//conditions:default": ["@tensorrt//:nvinfer", "@libtorch"],
":windows": [
"@libtorch_win//:libtorch",
"@tensorrt_win//:nvinfer",
],
"//conditions:default": [
"@libtorch",
"@tensorrt//:nvinfer",
],
}),
alwayslink = True,
)
Expand All @@ -49,9 +47,14 @@ cc_library(
"//core/conversion/conversionctx",
"//core/util:prelude",
] + select({
":windows": ["@tensorrt_win//:nvinfer", "@libtorch_win//:libtorch"],
":use_pre_cxx11_abi": ["@tensorrt//:nvinfer", "@libtorch_pre_cxx11_abi//:libtorch"],
"//conditions:default": ["@tensorrt//:nvinfer", "@libtorch"],
":windows": [
"@libtorch_win//:libtorch",
"@tensorrt_win//:nvinfer",
],
"//conditions:default": [
"@libtorch",
"@tensorrt//:nvinfer",
],
}),
alwayslink = True,
)
Expand Down Expand Up @@ -106,9 +109,14 @@ cc_library(
"//core/plugins:torch_tensorrt_plugins",
"//core/util:prelude",
] + select({
":windows": ["@tensorrt_win//:nvinfer", "@libtorch_win//:libtorch"],
":use_pre_cxx11_abi": ["@tensorrt//:nvinfer", "@libtorch_pre_cxx11_abi//:libtorch"],
"//conditions:default": ["@tensorrt//:nvinfer", "@libtorch"],
":windows": [
"@libtorch_win//:libtorch",
"@tensorrt_win//:nvinfer",
],
"//conditions:default": [
"@libtorch",
"@tensorrt//:nvinfer",
],
}),
alwayslink = True,
)
Expand Down
8 changes: 0 additions & 8 deletions core/conversion/evaluators/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ load("@rules_pkg//:pkg.bzl", "pkg_tar")

package(default_visibility = ["//visibility:public"])

config_setting(
name = "use_pre_cxx11_abi",
values = {
"define": "abi=pre_cxx11_abi",
},
)

config_setting(
name = "windows",
constraint_values = [
Expand All @@ -36,7 +29,6 @@ cc_library(
"//core/util:prelude",
] + select({
":windows": ["@libtorch_win//:libtorch"],
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
"//conditions:default": ["@libtorch"],
}),
alwayslink = True,
Expand Down
18 changes: 8 additions & 10 deletions core/conversion/tensorcontainer/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ load("@rules_pkg//:pkg.bzl", "pkg_tar")

package(default_visibility = ["//visibility:public"])

config_setting(
name = "use_pre_cxx11_abi",
values = {
"define": "abi=pre_cxx11_abi",
},
)

config_setting(
name = "windows",
constraint_values = [
Expand All @@ -28,9 +21,14 @@ cc_library(
deps = [
"//core/util:prelude",
] + select({
":windows": ["@tensorrt_win//:nvinfer", "@libtorch_win//:libtorch"],
":use_pre_cxx11_abi": ["@tensorrt//:nvinfer", "@libtorch_pre_cxx11_abi//:libtorch"],
"//conditions:default": ["@tensorrt//:nvinfer", "@libtorch"],
":windows": [
"@libtorch_win//:libtorch",
"@tensorrt_win//:nvinfer",
],
"//conditions:default": [
"@libtorch",
"@tensorrt//:nvinfer",
],
}),
alwayslink = True,
)
Expand Down
Loading
Loading