Move Validation Framework workflows to test-infra #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate linux binaries | ||
on: | ||
workflow_call: | ||
inputs: | ||
channel: | ||
description: "Channel to use (nightly, test, release, all)" | ||
required: true | ||
type: string | ||
torchonly: | ||
description: 'Validate torchonly' | ||
default: false | ||
required: false | ||
type: boolean | ||
version: | ||
description: 'Version to validate - optional' | ||
default: "" | ||
required: false | ||
type: string | ||
use-version-set: | ||
description: 'Applies when version is used, use version for each domain' | ||
default: false | ||
required: false | ||
type: boolean | ||
release-matrix: | ||
description: 'Release matrix - optional' | ||
default: "" | ||
required: false | ||
type: string | ||
include-test-ops: | ||
description: 'Include Test Ops tests (only Linux)' | ||
default: false | ||
required: false | ||
type: boolean | ||
use-only-dl-pytorch-org: | ||
description: 'Use only download.pytorch.org when generating wheel install command' | ||
default: false | ||
required: false | ||
type: boolean | ||
use-force-reinstall: | ||
description: 'Use force-reinstall for pip binaries' | ||
default: false | ||
required: false | ||
type: boolean | ||
use-meta-cdn: | ||
description: 'Use meta cdn for installing pip binaries' | ||
default: false | ||
required: false | ||
type: boolean | ||
use_split_build: | ||
description: | | ||
[Experimental] Use split build | ||
required: false | ||
type: boolean | ||
default: false | ||
use-extra-index-url: | ||
description: 'Use extra-index url for pip tests' | ||
default: false | ||
required: false | ||
type: boolean | ||
workflow_dispatch: | ||
inputs: | ||
channel: | ||
description: "Channel to use (nightly, test, release, all)" | ||
required: true | ||
type: choice | ||
options: | ||
- release | ||
- nightly | ||
- test | ||
- all | ||
torchonly: | ||
description: 'Validate torchonly' | ||
default: false | ||
required: false | ||
type: boolean | ||
version: | ||
description: 'Version to validate - optional' | ||
default: "" | ||
required: false | ||
type: string | ||
release-matrix: | ||
description: 'Release matrix - optional' | ||
default: "" | ||
required: false | ||
type: string | ||
include-test-ops: | ||
description: 'Include Test Ops tests (only Linux)' | ||
default: false | ||
required: false | ||
type: boolean | ||
use-only-dl-pytorch-org: | ||
description: 'Use only download.pytorch.org when generating wheel install command' | ||
default: false | ||
required: false | ||
type: boolean | ||
use-force-reinstall: | ||
description: 'Use force-reinstall for pip binaries' | ||
default: false | ||
required: false | ||
type: boolean | ||
use-meta-cdn: | ||
description: 'Use meta cdn for installing pip binaries' | ||
default: false | ||
required: false | ||
type: boolean | ||
use_split_build: | ||
description: | | ||
[Experimental] Use split build | ||
required: false | ||
type: boolean | ||
default: false | ||
use-extra-index-url: | ||
description: 'Use extra-index url for pip tests' | ||
default: false | ||
required: false | ||
type: boolean | ||
use-version-set: | ||
description: 'Applies when version is used, use version for each domain' | ||
default: false | ||
required: false | ||
type: boolean | ||
jobs: | ||
generate-linux-matrix: | ||
uses: ./.github/workflows/generate_binary_build_matrix.yml | ||
with: | ||
package-type: wheel,libtorch | ||
os: linux | ||
channel: ${{ inputs.channel }} | ||
use-only-dl-pytorch-org: ${{ inputs.use-only-dl-pytorch-org }} | ||
use_split_build: ${{ inputs.use_split_build }} | ||
with-xpu: enable | ||
linux: | ||
needs: generate-linux-matrix | ||
strategy: | ||
matrix: ${{ fromJson(needs.generate-linux-matrix.outputs.matrix) }} | ||
fail-fast: false | ||
uses: ./.github/workflows/linux_job.yml | ||
name: ${{ matrix.build_name }} | ||
with: | ||
runner: ${{ matrix.validation_runner }} | ||
repository: "pytorch/pytorch" | ||
ref: main | ||
job-name: ${{ matrix.build_name }} | ||
docker-image: ${{ (matrix.gpu_arch_type == 'xpu' && matrix.container_image) || (matrix.gpu_arch_version == '12.6' && 'pytorch/almalinux-builder:cpu-main') || 'pytorch/conda-builder' }} | ||
binary-matrix: ${{ toJSON(matrix) }} | ||
docker-build-dir: "skip-docker-build" | ||
timeout: 180 | ||
script: | | ||
set -ex | ||
export ENV_NAME="conda-env-${{ github.run_id }}" | ||
export TORCH_ONLY=${{ inputs.torchonly }} | ||
export INCLUDE_TEST_OPS=${{ inputs.include-test-ops }} | ||
export USE_ONLY_DL_PYTORCH_ORG=${{ inputs.use-only-dl-pytorch-org }} | ||
export USE_EXTRA_INDEX_URL=${{ inputs.use-extra-index-url }} | ||
export USE_META_CDN=${{ inputs.use-meta-cdn }} | ||
export RELEASE_VERSION=${{ inputs.version }} | ||
export USE_VERSION_SET=${{ inputs.use-version-set }} | ||
if [[ ${USE_VERSION_SET} == 'true' ]]; then | ||
export VISION_RELEASE_VERSION=${{ fromJson(inputs.release-matrix).torchvision }} | ||
export AUDIO_RELEASE_VERSION=${{ fromJson(inputs.release-matrix).torchaudio }} | ||
fi | ||
export USE_FORCE_REINSTALL=${{ inputs.use-force-reinstall }} | ||
export TARGET_OS="linux" | ||
# Due to xpu doesn't use pytorch/conda-builder image, need to install conda firstly | ||
if [[ ${{ matrix.gpu_arch_type }} == 'xpu' ]]; then | ||
source /.ci/docker/common/install_conda.sh | ||
fi | ||
eval "$(conda shell.bash hook)" | ||
printf '%s\n' ${{ toJson(inputs.release-matrix) }} > release_matrix.json | ||
# Special case PyPi installation package. And Install of PyPi package via poetry | ||
if [[ ${MATRIX_PACKAGE_TYPE} == "manywheel" && \ | ||
${MATRIX_GPU_ARCH_VERSION} == "12.4" && \ | ||
${MATRIX_CHANNEL} == "release" && \ | ||
${USE_ONLY_DL_PYTORCH_ORG} == "false" ]]; then | ||
source ../../test-infra/.github/scripts/validate_pipy.sh | ||
source ../../test-infra/.github/scripts/validate_poetry.sh | ||
fi | ||
# Standart case: Validate binaries | ||
source ../../test-infra/.github/scripts/validate_binaries.sh |