Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
lanluo-nvidia committed Jul 9, 2024
1 parent 4eb7df2 commit c5297f4
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 88 deletions.
79 changes: 10 additions & 69 deletions .github/workflows/docker_builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

permissions:
packages: write
id-token: write
contents: read

jobs:
build-pre-cxx11:
build:
permissions:
packages: write

runs-on: linux.4xlarge.nvidia.gpu
outputs:
docker_url: ${{ env.DOCKER_REGISTRY }}/${{ steps.fix_slashes.outputs.container_name }}

# Define key environment variables
# Container name is of the form torch_tensorrt:<branch_name>
env:
Expand All @@ -37,7 +34,6 @@ jobs:
- name: Fix Slashes Repo Name
id: fix_slashes
run: |
set -x
export container_name=$(echo ${{ env.CONTAINER_NAME }} | sed 's|/|_|g')
echo "container_name=$container_name" >> $GITHUB_OUTPUT
Expand All @@ -48,22 +44,21 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build PRE_CXX11_ABI Docker image
# Automatically detect TensorRT default versions for Torch-TRT build
- name: Build Docker image
env:
DOCKER_TAG: ${{ env.DOCKER_REGISTRY }}/${{ steps.fix_slashes.outputs.container_name }}
run: |
set -x
python3 -m pip install pyyaml
TRT_VERSION=$(python3 -c "import versions; versions.tensorrt_version()")
echo "TRT VERSION = ${TRT_VERSION}"
DOCKER_BUILDKIT=1 docker build --build-arg TENSORRT_VERSION=$TRT_VERSION -f docker/Dockerfile --tag $DOCKER_TAG .
- name: Push PRE_CXX11_ABI Docker image
- name: Push Docker image
env:
DOCKER_URL: ${{ env.DOCKER_REGISTRY }}/${{ steps.fix_slashes.outputs.container_name }}
run: |
set -x
docker push $DOCKER_URL
run: docker push $DOCKER_URL

# Clean up all untagged containers in registry
- name: Container Registry Cleanup
Expand All @@ -73,57 +68,3 @@ jobs:
package-type: container
min-versions-to-keep: 0
delete-only-untagged-versions: True

build-cxx11:
runs-on: linux.4xlarge.nvidia.gpu
outputs:
docker_url: ${{ env.DOCKER_REGISTRY }}/${{ steps.fix_slashes.outputs.container_name }}
# Define key environment variables
# Container name is of the form torch_tensorrt_cxx11:<branch_name>
env:
DOCKER_REGISTRY: ghcr.io/pytorch/tensorrt
CONTAINER_NAME: torch_tensorrt_cxx11:${{ github.ref_name }}

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Fix Slashes Repo Name
id: fix_slashes
run: |
set -x
export container_name=$(echo ${{ env.CONTAINER_NAME }} | sed 's|/|_|g')
echo "container_name=$container_name" >> $GITHUB_OUTPUT
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build CXX11_ABI Docker image
env:
DOCKER_TAG: ${{ env.DOCKER_REGISTRY }}/${{ steps.fix_slashes.outputs.container_name }}
run: |
set -x
python3 -m pip install pyyaml
TRT_VERSION=$(python3 -c "import versions; versions.tensorrt_version()")
echo "TRT VERSION = ${TRT_VERSION}"
DOCKER_BUILDKIT=1 docker build --build-arg TENSORRT_VERSION=$TRT_VERSION --build-arg USE_CXX11_ABI=True -f docker/Dockerfile --tag $DOCKER_TAG .
- name: Push CXX11_ABI Docker image
env:
DOCKER_URL: ${{ env.DOCKER_REGISTRY }}/${{ steps.fix_slashes.outputs.container_name }}
run: |
set -x
docker push $DOCKER_URL
# Clean up all untagged containers in registry
- name: Container Registry Cleanup
uses: actions/delete-package-versions@v4
with:
package-name: "tensorrt/torch_tensorrt_cxx11"
package-type: container
min-versions-to-keep: 0
delete-only-untagged-versions: True
2 changes: 0 additions & 2 deletions .github/workflows/release-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Release Linux wheels and tarball artifacts
on:
pull_request:
push:
branches:
- release/*
tags:
# NOTE: Binary build pipelines should only get triggered on release candidate builds
# Release candidate tags look like: v1.11.0-rc1
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/release-wheel-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ jobs:
- name: Clean workspace
shell: bash -l {0}
run: |
set -euxo pipefail
echo "needs.check.outputs.release_flag: ${{ needs.check.outputs.release_flag }}"
set -x
echo "::group::Cleanup debug output"
rm -rf "${GITHUB_WORKSPACE}"
mkdir -p "${GITHUB_WORKSPACE}"
Expand Down Expand Up @@ -164,7 +163,7 @@ jobs:
cat "${{ inputs.env-var-script }}" >> "${BUILD_ENV_FILE}"
- name: Install torch dependency
run: |
set -euxo pipefail
set -x
# shellcheck disable=SC1090
source "${BUILD_ENV_FILE}"
# shellcheck disable=SC2086
Expand All @@ -181,14 +180,14 @@ jobs:
working-directory: ${{ inputs.repository }}
shell: bash -l {0}
run: |
set -euxo pipefail
set -x
source "${BUILD_ENV_FILE}"
${CONDA_RUN} python setup.py clean
- name: Build the wheel (bdist_wheel)
working-directory: ${{ inputs.repository }}
shell: bash -l {0}
run: |
set -euxo pipefail
set -x
source "${BUILD_ENV_FILE}"
# BUILD_VERSION example: 2.4.0+cu121, we don't want the +cu121 part, so remove +cu121
Expand Down Expand Up @@ -226,7 +225,7 @@ jobs:
PACKAGE_NAME: ${{ inputs.package-name }}
SMOKE_TEST_SCRIPT: ${{ inputs.smoke-test-script }}
run: |
set -euxo pipefail
set -x
source "${BUILD_ENV_FILE}"
# TODO: add smoke test for the auditwheel tarball built
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/release-windows.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Release Windows wheels artifacts

on:
pull_request:
push:
branches:
- release/*
tags:
# NOTE: Binary build pipelines should only get triggered on release candidate builds
# Release candidate tags look like: v1.11.0-rc1
Expand Down
14 changes: 6 additions & 8 deletions docker/WORKSPACE.docker
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,16 @@ new_local_repository(
# Tarballs and fetched dependencies (default - use in cases when building from precompiled bin and tarballs)
#############################################################################################################

http_archive(
new_local_repository(
name = "libtorch",
build_file = "@//third_party/libtorch:BUILD",
strip_prefix = "libtorch",
urls = ["https://download.pytorch.org/libtorch/nightly/cu124/libtorch-cxx11-abi-shared-with-deps-latest.zip"],
path = "/opt/python3/site-packages/torch/",
build_file = "third_party/libtorch/BUILD"
)

http_archive(
new_local_repository(
name = "libtorch_pre_cxx11_abi",
build_file = "@//third_party/libtorch:BUILD",
strip_prefix = "libtorch",
urls = ["https://download.pytorch.org/libtorch/nightly/cu124/libtorch-shared-with-deps-latest.zip"],
path = "/opt/python3/site-packages/torch/",
build_file = "third_party/libtorch/BUILD"
)

####################################################################################
Expand Down

0 comments on commit c5297f4

Please sign in to comment.