Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wheel macos arm64 validations #1441

Merged
merged 8 commits into from
Jun 29, 2023
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
12 changes: 11 additions & 1 deletion .github/scripts/validate_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ else
conda create -y -n ${ENV_NAME} python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
conda activate ${ENV_NAME}
INSTALLATION=${MATRIX_INSTALLATION/"conda install"/"conda install -y"}

# Make sure we remove previous installation if it exists
if [[ ${MATRIX_PACKAGE_TYPE} == 'wheel' ]]; then
pip3 uninstall -y torch torchaudio torchvision
fi
eval $INSTALLATION

if [[ ${TARGET_OS} == 'linux' ]]; then
Expand All @@ -14,7 +19,12 @@ else
${PWD}/check_binary.sh
fi

python ./test/smoke_test/smoke_test.py
if [[ ${TARGET_OS} == 'windows' ]]; then
python ./test/smoke_test/smoke_test.py
else
python3 ./test/smoke_test/smoke_test.py
fi

conda deactivate
conda env remove -n ${ENV_NAME}
fi
10 changes: 1 addition & 9 deletions .github/workflows/validate-nightly-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,7 @@ 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
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/validate-release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ 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:
Expand Down
10 changes: 7 additions & 3 deletions test/smoke_test/smoke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
channel = os.getenv("MATRIX_CHANNEL")
stable_version = os.getenv("MATRIX_STABLE_VERSION")
package_type = os.getenv("MATRIX_PACKAGE_TYPE")
target_os = os.getenv("TARGET_OS")

is_cuda_system = gpu_arch_type == "cuda"
NIGHTLY_ALLOWED_DELTA = 3
Expand All @@ -24,14 +25,14 @@
{
"name": "torchvision",
"repo": "https://github.com/pytorch/vision.git",
"smoke_test": "python ./vision/test/smoke_test.py",
"smoke_test": "./vision/test/smoke_test.py",
"extension": "extension",
"repo_name": "vision",
},
{
"name": "torchaudio",
"repo": "https://github.com/pytorch/audio.git",
"smoke_test": "python ./audio/test/smoke_test/smoke_test.py --no-ffmpeg",
"smoke_test": "./audio/test/smoke_test/smoke_test.py --no-ffmpeg",
"extension": "_extension",
"repo_name": "audio",
},
Expand Down Expand Up @@ -212,8 +213,11 @@ def smoke_test_modules():
print(f"Path does not exist: {cwd}/{module['repo_name']}")
subprocess.check_output(f"git clone --depth 1 {module['repo']}", stderr=subprocess.STDOUT, shell=True)
try:
smoke_test_command = f"python3 {module['smoke_test']}"
if target_os == 'windows':
smoke_test_command = f"python {module['smoke_test']}"
output = subprocess.check_output(
module["smoke_test"], stderr=subprocess.STDOUT, shell=True,
smoke_test_command, stderr=subprocess.STDOUT, shell=True,
universal_newlines=True)
except subprocess.CalledProcessError as exc:
raise RuntimeError(
Expand Down