Skip to content

Commit

Permalink
Fix wheel macos arm64 validations (#1441)
Browse files Browse the repository at this point in the history
* Fix wheel validations

* Try using upgrade flag instead

* try uninstall

* test

* Try using python3

* use python3 vs python for validation

* Fix windows vs other os python execution

* Uninstall fix
  • Loading branch information
atalman committed Jun 29, 2023
1 parent 6240da5 commit 387228a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
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

0 comments on commit 387228a

Please sign in to comment.