From 4ef61aa27f1cec6146d317519e844aceace8bf14 Mon Sep 17 00:00:00 2001 From: powderluv Date: Thu, 21 Apr 2022 15:53:00 -0700 Subject: [PATCH] Minor buildsystem fixes (#778) Sets up auto-pinning of latest torch-nightly --- .github/workflows/{buildManylinux.yml => buildRelease.yml} | 6 +----- .github/workflows/oneshotSnapshotPackage.yml | 4 ++-- build_tools/python_deploy/build_linux_packages.sh | 1 + build_tools/python_deploy/build_macos_packages.sh | 2 +- pyproject.toml | 2 +- requirements.txt | 2 +- 6 files changed, 7 insertions(+), 10 deletions(-) rename .github/workflows/{buildManylinux.yml => buildRelease.yml} (96%) diff --git a/.github/workflows/buildManylinux.yml b/.github/workflows/buildRelease.yml similarity index 96% rename from .github/workflows/buildManylinux.yml rename to .github/workflows/buildRelease.yml index 94a13bc89..89b8afc2d 100644 --- a/.github/workflows/buildManylinux.yml +++ b/.github/workflows/buildRelease.yml @@ -1,10 +1,6 @@ -name: Manylinux Build +name: Release Build on: - push: - branches: - - main - pull_request: workflow_dispatch: inputs: release_id: diff --git a/.github/workflows/oneshotSnapshotPackage.yml b/.github/workflows/oneshotSnapshotPackage.yml index 3a43febe8..0073b3dd1 100644 --- a/.github/workflows/oneshotSnapshotPackage.yml +++ b/.github/workflows/oneshotSnapshotPackage.yml @@ -55,10 +55,10 @@ jobs: ref: "${{ env.tag_name }}" inputs: '{"release_id": "", "python_package_version": "${{ env.package_version }}"}' - - name: "Invoke workflow :: Manylinux Build" + - name: "Invoke workflow :: Release Build" uses: benc-uk/workflow-dispatch@v1 with: - workflow: Manylinux Build + workflow: Release Build token: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }} ref: "${{ env.tag_name }}" inputs: '{"release_id": "${{ steps.create_release.outputs.id }}", "python_package_version": "${{ env.package_version }}"}' diff --git a/build_tools/python_deploy/build_linux_packages.sh b/build_tools/python_deploy/build_linux_packages.sh index c195649f7..0b2fde203 100755 --- a/build_tools/python_deploy/build_linux_packages.sh +++ b/build_tools/python_deploy/build_linux_packages.sh @@ -95,6 +95,7 @@ function run_in_docker() { } function build_torch_mlir() { + python -m pip install -r /main_checkout/torch-mlir/requirements.txt --extra-index-url https://download.pytorch.org/whl/nightly/cpu CMAKE_GENERATOR=Ninja \ python -m pip wheel -v -w /wheelhouse /main_checkout/torch-mlir/ \ --extra-index-url https://download.pytorch.org/whl/nightly/cpu diff --git a/build_tools/python_deploy/build_macos_packages.sh b/build_tools/python_deploy/build_macos_packages.sh index 69dc75c1d..ec01a49e6 100755 --- a/build_tools/python_deploy/build_macos_packages.sh +++ b/build_tools/python_deploy/build_macos_packages.sh @@ -20,7 +20,7 @@ set -eu -o errtrace this_dir="$(cd $(dirname $0) && pwd)" repo_root="$(cd $this_dir/../../ && pwd)" -python_versions="${python_versions:3.9 3.10}" +python_versions="${python_versions:-3.9 3.10}" output_dir="${output_dir:-${this_dir}/wheelhouse}" packages="${packages:-torch-mlir}" diff --git a/pyproject.toml b/pyproject.toml index dc2e8d88e..34a6e2710 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,6 @@ requires = [ # artifacts. # TODO: Come up with a better way to pin the version. "numpy", - "torch==1.12.0.dev20220420", + "torch>=1.12.0.dev20220420", ] build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt index a49dd0e1e..dab7bce18 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html --pre +torch numpy -torch torchvision # Build requirements.