diff --git a/.github/actions/validate-binary/action.yml b/.github/actions/validate-binary/action.yml index 76531010a..41bcca545 100644 --- a/.github/actions/validate-binary/action.yml +++ b/.github/actions/validate-binary/action.yml @@ -17,6 +17,18 @@ inputs: description: 'Python version' required: true default: '3.9' + desired_cuda: + description: 'Desired CUDA' + required: true + default: 'cpu' + dev_toolset: + description: 'Dev Toolset' + required: false + default: '' + package_type: + description: 'Package Type' + required: true + default: 'conda' target_os: description: 'Target OS linux or macos' required: false @@ -49,9 +61,16 @@ runs: GPU_ARCH_TYPE: ${{ inputs.gpu_arch_type }} INSTALLATION: ${{ inputs.installation }} ENV_NAME: conda-env-${{ github.run_id }} + DESIRED_PYTHON: ${{ inputs.python_version }} + DESIRED_CUDA: ${{ inputs.desired_cuda }} + DESIRED_DEVTOOLSET: ${{ inputs.dev_toolset }} + PACKAGE_TYPE: ${{ inputs.package_type }} run: | set -ex conda create -yp ${ENV_NAME} python=${{ inputs.python_version }} numpy conda run -p ${ENV_NAME} $INSTALLATION conda run -p ${ENV_NAME} python3 ./test/smoke_test/smoke_test.py + export LD_LIBRARY_PATH="$(dirname $(which python))/lib" + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib + conda run -p ${ENV_NAME} env LD_LIBRARY_PATH=$LD_LIBRARY_PATH bash ${PWD}/check_binary.sh conda env remove -p ${ENV_NAME} diff --git a/.github/workflows/validate-linux-binaries.yml b/.github/workflows/validate-linux-binaries.yml index dd65a544f..0648d9bac 100644 --- a/.github/workflows/validate-linux-binaries.yml +++ b/.github/workflows/validate-linux-binaries.yml @@ -54,6 +54,10 @@ jobs: gpu_arch_ver: ${{ matrix.gpu_arch_version }} installation: ${{ matrix.installation }} python_version: ${{ matrix.python_version }} + desired_cuda: ${{ matrix.desired_cuda }} + dev_toolset: '' + package_type: conda + target_os: linux validate-linux-binaries-wheels: needs: generate-linux-wheel-matrix strategy: @@ -69,22 +73,48 @@ jobs: gpu_arch_ver: ${{ matrix.gpu_arch_version }} installation: ${{ matrix.installation }} python_version: ${{ matrix.python_version }} + desired_cuda: ${{ matrix.desired_cuda }} + dev_toolset: '' + package_type: wheel + target_os: linux + validate-linux-libtorch-binaries: needs: generate-linux-libtorch-matrix strategy: matrix: ${{ fromJson(needs.generate-linux-libtorch-matrix.outputs.matrix) }} fail-fast: false - runs-on: "ubuntu-20.04" + runs-on: ${{ matrix.validation_runner }} env: PYTHON_VERSION: ${{ matrix.python_version }} steps: + - name: Checkout PyTorch builder + uses: actions/checkout@v2 + - name: Install Conda + uses: conda-incubator/setup-miniconda@v2 + with: + python-version: ${{ matrix.python_version }} + auto-update-conda: true + miniconda-version: "latest" + activate-environment: testenv - name: Install pytorch and smoke test + shell: bash env: INSTALLATION: ${{ matrix.installation }} ENV_NAME: conda-env-${{ github.run_id }} + DESIRED_PYTHON: ${{ matrix.python_version }} + DESIRED_CUDA: ${{ matrix.desired_cuda }} + DESIRED_DEVTOOLSET: ${{ matrix.devtoolset }} + PACKAGE_TYPE: libtorch run: | sudo apt-get install unzip -y set -ex curl ${INSTALLATION} -o libtorch.zip unzip libtorch.zip + conda create -yp ${ENV_NAME} python=${{ matrix.python_version }} numpy + export LD_LIBRARY_PATH="$(dirname $(which python))/lib" + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib + if [[ ${{ matrix.libtorch_variant }} == "static-with-deps" ]]; then + conda run -p ${ENV_NAME} --cwd libtorch env LD_LIBRARY_PATH=${LD_LIBRARY_PATH} bash ./../check_binary.sh + fi + conda env remove -p ${ENV_NAME} diff --git a/.github/workflows/validate-macos-binaries.yml b/.github/workflows/validate-macos-binaries.yml index 8b3d9c5c9..874d40f81 100644 --- a/.github/workflows/validate-macos-binaries.yml +++ b/.github/workflows/validate-macos-binaries.yml @@ -60,6 +60,8 @@ jobs: gpu_arch_ver: ${{ matrix.gpu_arch_version }} installation: ${{ matrix.installation }} python_version: ${{ matrix.python_version }} + desired_cuda: ${{ matrix.desired_cuda }} + package_type: conda target_os: macos validate-macos-arm64-binaries-wheel: needs: generate-macos-arm64-wheel-matrix @@ -76,6 +78,8 @@ jobs: gpu_arch_ver: ${{ matrix.gpu_arch_version }} installation: ${{ matrix.installation }} python_version: ${{ matrix.python_version }} + desired_cuda: ${{ matrix.desired_cuda }} + package_type: wheel target_os: macos validate-macos-x86_64-binaries-conda: needs: generate-macos-x86_64-conda-matrix @@ -92,6 +96,8 @@ jobs: gpu_arch_ver: ${{ matrix.gpu_arch_version }} installation: ${{ matrix.installation }} python_version: ${{ matrix.python_version }} + desired_cuda: ${{ matrix.desired_cuda }} + package_type: conda target_os: macos validate-macos-x86_64-binaries-wheel: needs: generate-macos-x86_64-wheel-matrix @@ -108,4 +114,6 @@ jobs: gpu_arch_ver: ${{ matrix.gpu_arch_version }} installation: ${{ matrix.installation }} python_version: ${{ matrix.python_version }} + desired_cuda: ${{ matrix.desired_cuda }} + package_type: wheel target_os: macos