From 95cdbbaac9a5d98092fc3960b800eada0b538769 Mon Sep 17 00:00:00 2001 From: lanluo-nvidia Date: Mon, 17 Jun 2024 12:53:10 -0700 Subject: [PATCH] test --- .../scripts/build-linux-release-artifacts.sh | 7 +++- .github/workflows/linux-release-artifacts.yml | 32 +++++++++++++------ .github/workflows/linux-release.yml | 8 +++-- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/.github/scripts/build-linux-release-artifacts.sh b/.github/scripts/build-linux-release-artifacts.sh index ef1113f8d4..d2524c2df1 100644 --- a/.github/scripts/build-linux-release-artifacts.sh +++ b/.github/scripts/build-linux-release-artifacts.sh @@ -2,6 +2,8 @@ set -x +source "${BUILD_ENV_FILE}" + export CXX=g++ CURRENT_DIR=`pwd` @@ -89,4 +91,7 @@ python -m auditwheel repair \ --plat manylinux_2_34_x86_64 \ /opt/torch-tensorrt-builds/torch_tensorrt-*-${PY_BUILD_CODE}-linux_x86_64.whl -cp wheelhouse/torch_tensorrt*x86_64.whl dist/ \ No newline at end of file +cp wheelhouse/torch_tensorrt*x86_64.whl dist/ + + +BUILD_VERSION=${TORCHTRT_VERSION} CI_BUILD=1 RELEASE=1 C python setup.py bdist_wheel --release \ No newline at end of file diff --git a/.github/workflows/linux-release-artifacts.yml b/.github/workflows/linux-release-artifacts.yml index 378fe2c87c..33ef9fec25 100644 --- a/.github/workflows/linux-release-artifacts.yml +++ b/.github/workflows/linux-release-artifacts.yml @@ -19,6 +19,10 @@ on: description: "Pre script to run prior to build" default: "" type: string + env-var-script: + description: "Script that sets Domain-Specific Environment Variables" + default: "" + type: string test-infra-repository: description: "Test infra repository to use" default: "pytorch/test-infra" @@ -77,9 +81,6 @@ jobs: container: image: ${{ matrix.container_image }} options: ${{ matrix.gpu_arch_type == 'cuda' && '--gpus all' || ' ' }} - # TO DO: ask Naren, I am not able to skip the release build if it is not cuda12.1 on the job level - # if: ${{ env.CU_VERSION == '12.1' }} - # If a build is taking longer than 60 minutes on these runners we need # to have a conversation timeout-minutes: 60 @@ -116,6 +117,19 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} cuda-version: ${{ env.CU_VERSION }} arch: ${{ env.ARCH }} + - name: Combine Env Var and Build Env Files + if: ${{ inputs.env-var-script != '' }} + working-directory: ${{ inputs.repository }} + run: | + set -euxo pipefail + cat "${{ inputs.env-var-script }}" >> "${BUILD_ENV_FILE}" + - name: Install torch dependency + run: | + set -euxo pipefail + # shellcheck disable=SC1090 + source "${BUILD_ENV_FILE}" + # shellcheck disable=SC2086 + ${CONDA_RUN} ${PIP_INSTALL_TORCH} - name: Run Pre-Script with Caching if: ${{ inputs.pre-script != '' }} uses: ./test-infra/.github/actions/run-script-with-cache @@ -129,12 +143,12 @@ jobs: with: name: ${{ env.ARTIFACT_NAME }} path: /opt/torch-tensorrt-builds/ - - name: Install torch and torch-tensorrt - if: ${{ inputs.pre-script != '' }} - uses: ./test-infra/.github/actions/run-script-with-cache - with: - repository: ${{ inputs.repository }} - script: .github/scripts/install-torch-tensorrt.sh + # - name: Install torch and torch-tensorrt + # if: ${{ inputs.pre-script != '' }} + # uses: ./test-infra/.github/actions/run-script-with-cache + # with: + # repository: ${{ inputs.repository }} + # script: .github/scripts/install-torch-tensorrt.sh - name: Pack script continue-on-error: ${{ inputs.continue-on-error }} working-directory: ${{ inputs.repository }} diff --git a/.github/workflows/linux-release.yml b/.github/workflows/linux-release.yml index c8531028a7..55603b766a 100644 --- a/.github/workflows/linux-release.yml +++ b/.github/workflows/linux-release.yml @@ -53,10 +53,11 @@ jobs: matrix: include: - repository: pytorch/tensorrt - - package-name: torch_tensorrt - - pre-script: packaging/pre_build_script.sh + package-name: torch_tensorrt + pre-script: packaging/pre_build_script.sh + env-var-script: packaging/env_vars.txt uses: ./.github/workflows/linux-release-artifacts.yml - if: ${{ contains(github.event.pull_request.labels.*.name, 'build-release-artifacts') }} + if: ${{ (contains(github.event.pull_request.labels.*.name, 'build-release-artifacts') || startsWith(github.event.ref, 'refs/tags/v')) && needs.generate-matrix.outputs.matrix.desired_cuda == 'cu121' }} with: job-name: build-release-artifiacts repository: "pytorch/tensorrt" @@ -65,6 +66,7 @@ jobs: test-infra-ref: main build-matrix: ${{ needs.generate-matrix.outputs.matrix }} pre-script: ${{ matrix.pre-script }} + env-var-script: ${{ matrix.env-var-script }} script: | concurrency: