Skip to content

Commit

Permalink
Merge pull request #36 from ROCmSoftwarePlatform/IFU-main-2023-07-31
Browse files Browse the repository at this point in the history
[Refiled] IFU-main-2023-07-31
  • Loading branch information
jithunnair-amd authored Aug 7, 2023
2 parents 3fe2e34 + a581835 commit 6987207
Show file tree
Hide file tree
Showing 92 changed files with 718 additions and 2,017 deletions.
70 changes: 30 additions & 40 deletions .github/scripts/validate_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,39 @@ if [[ ${MATRIX_PACKAGE_TYPE} == "libtorch" ]]; then
curl ${MATRIX_INSTALLATION} -o libtorch.zip
unzip libtorch.zip
else
#special case for Python 3.11
if [[ ${MATRIX_PYTHON_VERSION} == '3.11' ]]; then
conda create -y -n ${ENV_NAME} python=${MATRIX_PYTHON_VERSION}
conda activate ${ENV_NAME}

INSTALLATION=${MATRIX_INSTALLATION/"-c pytorch"/"-c malfet -c pytorch"}
INSTALLATION=${INSTALLATION/"pytorch-cuda"/"pytorch-${MATRIX_CHANNEL}::pytorch-cuda"}
INSTALLATION=${INSTALLATION/"conda install"/"conda install -y"}

eval $INSTALLATION
python ./test/smoke_test/smoke_test.py
conda deactivate
conda env remove -n ${ENV_NAME}
else



# Special case Pypi installation package, only applicable to linux nightly CUDA 11.7 builds, wheel package
if [[ ${TARGET_OS} == 'linux' && ${MATRIX_GPU_ARCH_VERSION} == '11.7' && ${MATRIX_PACKAGE_TYPE} == 'manywheel' && ${MATRIX_CHANNEL} != 'nightly' ]]; then
conda create -yp ${ENV_NAME}_pypi python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
INSTALLATION_PYPI=${MATRIX_INSTALLATION/"cu117"/"cu117_pypi_cudnn"}
INSTALLATION_PYPI=${INSTALLATION_PYPI/"torchvision torchaudio"/""}
INSTALLATION_PYPI=${INSTALLATION_PYPI/"index-url"/"extra-index-url"}
conda run -p ${ENV_NAME}_pypi ${INSTALLATION_PYPI}
conda run -p ${ENV_NAME}_pypi python ./test/smoke_test/smoke_test.py --package torchonly
conda deactivate
conda env remove -p ${ENV_NAME}_pypi
fi
# Please note ffmpeg is required for torchaudio, see https://github.com/pytorch/pytorch/issues/96159
conda create -y -n ${ENV_NAME} python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
conda activate ${ENV_NAME}
INSTALLATION=${MATRIX_INSTALLATION/"conda install"/"conda install -y"}

export OLD_PATH=${PATH}
# Workaround macos-arm64 runners. Issue: https://github.com/pytorch/test-infra/issues/4342
if [[ ${TARGET_OS} == 'macos-arm64' ]]; then
export PATH="${CONDA_PREFIX}/bin:${PATH}"
fi

# Please note ffmpeg is required for torchaudio, see https://github.com/pytorch/pytorch/issues/96159
conda create -y -n ${ENV_NAME} python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
conda activate ${ENV_NAME}
INSTALLATION=${MATRIX_INSTALLATION/"conda install"/"conda install -y"}
eval $INSTALLATION
# Make sure we remove previous installation if it exists, this issue seems to affect only
if [[ ${MATRIX_PACKAGE_TYPE} == 'wheel' ]]; then
pip3 uninstall -y torch torchaudio torchvision
fi
eval $INSTALLATION

if [[ ${TARGET_OS} == 'linux' ]]; then
export CONDA_LIBRARY_PATH="$(dirname $(which python))/../lib"
export LD_LIBRARY_PATH=$CONDA_LIBRARY_PATH:$LD_LIBRARY_PATH
${PWD}/check_binary.sh
fi
if [[ ${TARGET_OS} == 'linux' ]]; then
export CONDA_LIBRARY_PATH="$(dirname $(which python))/../lib"
export LD_LIBRARY_PATH=$CONDA_LIBRARY_PATH:$LD_LIBRARY_PATH
${PWD}/check_binary.sh
fi

if [[ ${TARGET_OS} == 'windows' ]]; then
python ./test/smoke_test/smoke_test.py
conda deactivate
conda env remove -n ${ENV_NAME}
else
python3 ./test/smoke_test/smoke_test.py
fi

if [[ ${TARGET_OS} == 'macos-arm64' ]]; then
export PATH=${OLD_PATH}
fi

conda deactivate
conda env remove -n ${ENV_NAME}
fi
12 changes: 12 additions & 0 deletions .github/scripts/validate_pipy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
conda create -yp ${ENV_NAME}_pypi python=${MATRIX_PYTHON_VERSION} numpy ffmpeg

if [[ ${MATRIX_CHANNEL} != "release" ]]; then
conda run -p ${ENV_NAME}_pypi pip3 install --pre torch --index-url "https://download.pytorch.org/whl/${MATRIX_CHANNEL}/${MATRIX_DESIRED_CUDA}_pypi_cudnn"
conda run -p ${ENV_NAME}_pypi pip3 install --pre torchvision torchaudio --index-url "https://download.pytorch.org/whl/${MATRIX_CHANNEL}/${MATRIX_DESIRED_CUDA}"
else
conda run -p ${ENV_NAME}_pypi pip3 install torch torchvision torchaudio
fi

conda run -p ${ENV_NAME}_pypi python ./test/smoke_test/smoke_test.py
conda deactivate
conda env remove -p ${ENV_NAME}_pypi
27 changes: 27 additions & 0 deletions .github/scripts/validate_poetry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

conda create -y -n ${ENV_NAME}_poetry python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
conda activate ${ENV_NAME}_poetry
curl -sSL https://install.python-poetry.org | python3 - --git https://github.com/python-poetry/poetry.git@master
export PATH="/root/.local/bin:$PATH"

poetry --version
poetry new test_poetry
cd test_poetry

if [[ ${MATRIX_CHANNEL} != "release" ]]; then
# Installing poetry from our custom repo. We need to configure it before use and disable authentication
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
poetry source add --priority=explicit domains "https://download.pytorch.org/whl/${MATRIX_CHANNEL}/${MATRIX_DESIRED_CUDA}"
poetry source add --priority=supplemental pytorch-nightly "https://download.pytorch.org/whl/${MATRIX_CHANNEL}"
poetry source add --priority=supplemental pytorch "https://download.pytorch.org/whl/${MATRIX_CHANNEL}/${MATRIX_DESIRED_CUDA}_pypi_cudnn"
poetry --quiet add --source pytorch torch
poetry --quiet add --source domains torchvision torchaudio
else
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
poetry --quiet add torch torchaudio torchvision
fi

python ../test/smoke_test/smoke_test.py
conda deactivate
conda env remove -p ${ENV_NAME}_poetry
cd ..
11 changes: 8 additions & 3 deletions .github/workflows/build-conda-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ name: Build conda docker images
on:
push:
branches:
main
- main
- release/*
tags:
# NOTE: Binary build pipelines should only get triggered on release candidate or nightly builds
# Release candidate tags look like: v1.11.0-rc1
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
paths:
- conda/Dockerfile
- 'common/*'
Expand All @@ -19,14 +24,14 @@ env:
DOCKER_BUILDKIT: 1
DOCKER_ID: ${{ secrets.DOCKER_ID }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
WITH_PUSH: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
WITH_PUSH: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release')) }}

jobs:
build-docker:
runs-on: ubuntu-22.04
strategy:
matrix:
cuda_version: ["11.6", "11.7", "11.8", "cpu"]
cuda_version: ["11.8", "12.1", "cpu"]
env:
CUDA_VERSION: ${{ matrix.cuda_version }}
steps:
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/build-libtorch-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ name: Build libtorch docker images
on:
push:
branches:
main
- main
- release/*
tags:
# NOTE: Binary build pipelines should only get triggered on release candidate or nightly builds
# Release candidate tags look like: v1.11.0-rc1
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
paths:
- .github/workflows/build-libtorch-images.yml
- libtorch/Dockerfile
Expand All @@ -21,14 +26,14 @@ env:
DOCKER_BUILDKIT: 1
DOCKER_ID: ${{ secrets.DOCKER_ID }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
WITH_PUSH: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
WITH_PUSH: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release')) }}

jobs:
build-docker-cuda:
runs-on: ubuntu-22.04
strategy:
matrix:
cuda_version: ["11.8", "11.7", "11.6"]
cuda_version: ["12.1", "11.8"]
env:
GPU_ARCH_TYPE: cuda
GPU_ARCH_VERSION: ${{ matrix.cuda_version }}
Expand All @@ -44,10 +49,10 @@ jobs:
run: |
libtorch/build_docker.sh
build-docker-rocm:
runs-on: ubuntu-22.04
runs-on: linux.12xlarge
strategy:
matrix:
rocm_version: ["5.3", "5.4.2"]
rocm_version: ["5.5", "5.6"]
env:
GPU_ARCH_TYPE: rocm
GPU_ARCH_VERSION: ${{ matrix.rocm_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-magma-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runs-on: linux.2xlarge
strategy:
matrix:
cuda_version: ["118", "117", "116"]
cuda_version: ["121", "118"]
steps:
- name: Checkout PyTorch builder
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-magma-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: windows-2019
strategy:
matrix:
cuda_version: ["118", "117", "116"]
cuda_version: ["121", "118"]
config: ["Release", "Debug"]
env:
CUDA_VERSION: ${{ matrix.cuda_version }}
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/build-manywheel-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ name: Build manywheel docker images
on:
push:
branches:
main
- main
- release/*
tags:
# NOTE: Binary build pipelines should only get triggered on release candidate or nightly builds
# Release candidate tags look like: v1.11.0-rc1
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
paths:
- .github/workflows/build-manywheel-images.yml
- manywheel/Dockerfile
Expand All @@ -23,14 +28,14 @@ env:
DOCKER_BUILDKIT: 1
DOCKER_ID: ${{ secrets.DOCKER_ID }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
WITH_PUSH: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
WITH_PUSH: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release')) }}

jobs:
build-docker-cuda:
runs-on: ubuntu-22.04
strategy:
matrix:
cuda_version: ["11.8", "11.7", "11.6"]
cuda_version: ["12.1", "11.8"]
env:
GPU_ARCH_TYPE: cuda
GPU_ARCH_VERSION: ${{ matrix.cuda_version }}
Expand All @@ -46,10 +51,10 @@ jobs:
run: |
manywheel/build_docker.sh
build-docker-rocm:
runs-on: ubuntu-22.04
runs-on: linux.12xlarge
strategy:
matrix:
rocm_version: ["5.3", "5.4.2"]
rocm_version: ["5.5", "5.6"]
env:
GPU_ARCH_TYPE: rocm
GPU_ARCH_VERSION: ${{ matrix.rocm_version }}
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/validate-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ on:
default: ""
required: false
type: string
limit-win-builds:
description: "Limit windows builds to single python/cuda config"
default: "disable"
type: string
workflow_dispatch:
inputs:
os:
Expand Down Expand Up @@ -53,11 +49,6 @@ on:
default: ""
required: false
type: string
limit-win-builds:
description: "Limit windows builds to single python/cuda config"
default: "disable"
required: false
type: string

jobs:
win:
Expand All @@ -66,7 +57,6 @@ jobs:
with:
channel: ${{ inputs.channel }}
ref: ${{ inputs.ref || github.ref }}
limit-win-builds: ${{ inputs.limit-win-builds }}

linux:
if: inputs.os == 'linux' || inputs.os == 'all'
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/validate-linux-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,14 @@ jobs:
export ENV_NAME="conda-env-${{ github.run_id }}"
export TARGET_OS="linux"
eval "$(conda shell.bash hook)"
# Special case PyPi installation package. And Install of PyPi package via poetry
if [[ ${MATRIX_PACKAGE_TYPE} == "manywheel" ]] && \
([[ ${MATRIX_GPU_ARCH_VERSION} == "12.1" && ${MATRIX_CHANNEL} != "release" ]] || \
[[ ${MATRIX_GPU_ARCH_VERSION} == "11.7" && ${MATRIX_CHANNEL} == "release" ]]); then
source ./.github/scripts/validate_pipy.sh --runtime-error-check disabled
source ./.github/scripts/validate_poetry.sh --runtime-error-check disabled
fi
# Standart case: Validate binaries
source ./.github/scripts/validate_binaries.sh
15 changes: 3 additions & 12 deletions .github/workflows/validate-nightly-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: cron

on:
schedule:
# At 2:30 pm UTC (7:30 am PDT)
- cron: "30 14 * * *"
# At 3:30 pm UTC (8:30 am PDT)
- cron: "30 15 * * *"
# Have the ability to trigger this job manually through the API
workflow_dispatch:
push:
Expand All @@ -17,19 +17,10 @@ on:
- .github/workflows/validate-macos-binaries.yml
- .github/workflows/validate-macos-arm64-binaries.yml
- test/smoke_test/*
pull_request:
paths:
- .github/workflows/validate-nightly-binaries.yml
- .github/workflows/validate-linux-binaries.yml
- .github/workflows/validate-windows-binaries.yml
- .github/workflows/validate-macos-binaries.yml
- .github/workflows/validate-macos-arm64-binaries.yml
- .github/scripts/validate_binaries.sh
- test/smoke_test/*

jobs:
nightly:
uses: ./.github/workflows/validate-binaries.yml
with:
channel: nightly
os: all
limit-win-builds: enable
14 changes: 11 additions & 3 deletions .github/workflows/validate-release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: cron

on:
schedule:
# At 3 am and 2 pm UTC (7 am and 8 pm PDT)
- cron: "0 3,14 * * *"
# At 3 am UTC (7 am PDT)
- cron: "0 3 * * *"
# Have the ability to trigger this job manually through the API
workflow_dispatch:
push:
Expand All @@ -17,11 +17,19 @@ on:
- .github/workflows/validate-macos-binaries.yml
- .github/workflows/validate-macos-arm64-binaries.yml
- test/smoke_test/*
pull_request:
paths:
- .github/workflows/validate-nightly-binaries.yml
- .github/workflows/validate-linux-binaries.yml
- .github/workflows/validate-windows-binaries.yml
- .github/workflows/validate-macos-binaries.yml
- .github/workflows/validate-macos-arm64-binaries.yml
- .github/scripts/validate_binaries.sh
- test/smoke_test/*

jobs:
release:
uses: ./.github/workflows/validate-binaries.yml
with:
channel: release
os: all
limit-win-builds: enable
Loading

0 comments on commit 6987207

Please sign in to comment.