Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Validate MacOS Binaries

on:
pull_request:
paths:
- .github/workflows/call-reusable-workflow-to-validate-MacOS-binaries.yml


jobs:
generate-ARM64-conda-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: conda
os: macos-arm64
channel: all

validate-MacOS-ARM64-conda-packages:
needs: generate-ARM64-conda-matrix
uses: ./.github/workflows/validate-MacOS-binaries.yml
name: validate MacOS-ARM64-conda
with:
test-matrix: ${{ needs.generate-ARM64-conda-matrix.outputs.matrix }}

generate-ARM64-wheel-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: wheel
os: macos-arm64
channel: all

validate-MacOS-ARM64-wheel-packages:
needs: generate-ARM64-wheel-matrix
uses: ./.github/workflows/validate-MacOS-binaries.yml
name: validate MacOS-ARM64-wheel
with:
test-matrix: ${{ needs.generate-ARM64-wheel-matrix.outputs.matrix }}

generate-X86_64-conda-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: conda
os: macos-x86_64
channel: all

validate-MacOS-X86_64-conda-packages:
needs: generate-X86_64-conda-matrix
uses: ./.github/workflows/validate-MacOS-binaries.yml
name: validate MacOS-X86_64-conda
with:
test-matrix: ${{ needs.generate-X86_64-conda-matrix.outputs.matrix }}

generate-X86_64-wheel-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: wheel
os: macos-x86_64
channel: all

validate-MacOS-X86_64-wheel-packages:
needs: generate-X86_64-wheel-matrix
uses: ./.github/workflows/validate-MacOS-binaries.yml
name: validate MacOS-X86_64-wheel
with:
test-matrix: ${{ needs.generate-X86_64-wheel-matrix.outputs.matrix }}
33 changes: 33 additions & 0 deletions .github/workflows/validate-MacOS-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Validate MacOS Binaries

on:
workflow_call:
inputs:
test-matrix:
description: "The MacOS JSON Matrix to test"
default: ""
type: string

jobs:
validate:
strategy:
fail-fast: false
matrix: ${{ fromJSON(inputs.test-matrix) }}
env:
PYTHON_VERSION: ${{ matrix.python_version }}
INSTALLATION: ${{ matrix.installation }}
runs-on: ${{ matrix.validation_runner }}
steps:
- name: Checkout PyTorch/Builder directory
uses: actions/checkout@v3
- name: Setup miniconda
uses: pytorch/test-infra/.github/actions/setup-miniconda@main
- name: Conda Install pytorch and smoke test
env:
ENV_NAME: conda-env-${{ github.run_id }}
run: |
set -ex
conda create -yp ${ENV_NAME} python=${PYTHON_VERSION} numpy
conda run -p ${ENV_NAME} $INSTALLATION
conda run -p ${ENV_NAME} python3 ${GITHUB_WORKSPACE}/test/smoke_test/smoke_test.py
conda env remove -p ${ENV_NAME}
4 changes: 2 additions & 2 deletions test/smoke_test/smoke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import torchaudio

def smoke_test_cuda() -> None:
gpu_arch_ver = os.environ['GPU_ARCH_VER']
gpu_arch_type = os.environ['GPU_ARCH_TYPE']
gpu_arch_ver = os.getenv('GPU_ARCH_VER')
gpu_arch_type = os.getenv('GPU_ARCH_TYPE')
is_cuda_system = gpu_arch_type == "cuda"

if(not torch.cuda.is_available() and is_cuda_system):
Expand Down