From a7bf29d475a671d6955b669ae175c1c503d22370 Mon Sep 17 00:00:00 2001 From: Andrey Talman Date: Thu, 27 Jun 2024 11:28:04 -0400 Subject: [PATCH] Add validations to torchao (#453) --- .github/scripts/validate_binaries.sh | 2 ++ .github/workflows/validate-binaries.yml | 47 +++++++++++++++++++++++++ test/smoke_tests/smoke_tests.py | 6 ++++ 3 files changed, 55 insertions(+) create mode 100644 .github/scripts/validate_binaries.sh create mode 100644 .github/workflows/validate-binaries.yml create mode 100644 test/smoke_tests/smoke_tests.py diff --git a/.github/scripts/validate_binaries.sh b/.github/scripts/validate_binaries.sh new file mode 100644 index 0000000000..8984a6b599 --- /dev/null +++ b/.github/scripts/validate_binaries.sh @@ -0,0 +1,2 @@ +pip install ${PYTORCH_PIP_PREFIX} torchao --index-url ${PYTORCH_PIP_DOWNLOAD_URL} +python ./test/smoke_tests/smoke_tests.py diff --git a/.github/workflows/validate-binaries.yml b/.github/workflows/validate-binaries.yml new file mode 100644 index 0000000000..087f3130f4 --- /dev/null +++ b/.github/workflows/validate-binaries.yml @@ -0,0 +1,47 @@ +name: Validate binaries + +on: + workflow_call: + inputs: + channel: + description: "Channel to use (nightly, test, release, all)" + required: false + type: string + default: release + ref: + description: "Reference to checkout, defaults to empty" + default: "" + required: false + type: string + workflow_dispatch: + inputs: + channel: + description: "Channel to use (nightly, test, release, all)" + required: true + type: choice + options: + - release + - nightly + - test + - all + ref: + description: "Reference to checkout, defaults to empty" + default: "" + required: false + type: string + pytorch_version: + description: "PyTorch version to validate (ie. 2.0, 2.2.2, etc.) - optional" + default: "" + required: false + type: string +jobs: + validate-binaries: + uses: pytorch/test-infra/.github/workflows/validate-domain-library.yml@main + with: + package_type: "wheel" + version: ${{ inputs.version }} + os: "linux" + channel: ${{ inputs.channel }} + repository: "pytorch/ao" + smoke_test: "source ./.github/scripts/validate_binaries.sh" + install_torch: true diff --git a/test/smoke_tests/smoke_tests.py b/test/smoke_tests/smoke_tests.py new file mode 100644 index 0000000000..21537359f7 --- /dev/null +++ b/test/smoke_tests/smoke_tests.py @@ -0,0 +1,6 @@ +"""Run smoke tests""" + +import torchao + + +print("torchao version is ", torchao.__version__)