Enable OSX (Intel, Apple Silicon Builds) (#776)

Update pinned pytorch version. Will submit a follow on PR to bump.
Also update artifacts directory
pull/778/head
powderluv 2022-04-21 10:47:28 -07:00 committed by GitHub
parent cc3a4a58ef
commit b03eac4224
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 4 deletions

View File

@ -32,6 +32,24 @@ jobs:
python -m pip install wheel
./build_tools/python_deploy/build_linux_packages.sh
name: MacOS Build
runs-on: macos-latest
steps:
- name: Get torch-mlir
uses: actions/checkout@v2
with:
submodules: 'true'
- uses: ./.github/actions/setup-build
with:
cache-suffix: ''
- name: Build Python wheels and smoke test.
run: |
cd $GITHUB_WORKSPACE
python -m pip install wheel
./build_tools/python_deploy/install_macos_deps.sh
python_versions="3.9 3.10" ./build_tools/python_deploy/build_macos_packages.sh
# If we were given a release_id, then upload the package we just built
# to the github releases page.
- name: Upload Release Assets (if requested)

View File

@ -60,18 +60,18 @@ function run() {
}
function build_torch_mlir() {
python -m pip install -r /main_checkout/torch-mlir/requirements.txt
python -m pip install -r $repo_root/requirements.txt --extra-index-url https://download.pytorch.org/whl/nightly/cpu
CMAKE_GENERATOR=Ninja \
MACOSX_DEPLOYMENT_TARGET=11.0 \
CMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
python -m pip wheel -v -w /wheelhouse /main_checkout/torch-mlir/
python -m pip wheel -v -w $output_dir $repo_root --extra-index-url https://download.pytorch.org/whl/nightly/cpu
}
function clean_wheels() {
local wheel_basename="$1"
local python_version="$2"
echo ":::: Clean wheels $wheel_basename $python_version"
rm -f /wheelhouse/${wheel_basename}-*-${python_version}-*.whl
rm -f $output_dir/${wheel_basename}-*-${python_version}-*.whl
}
run

View File

@ -16,6 +16,6 @@ requires = [
# artifacts.
# TODO: Come up with a better way to pin the version.
"numpy",
"torch==1.12.0.dev20220419+cpu",
"torch==1.12.0.dev20220420",
]
build-backend = "setuptools.build_meta"