Skip to content

Commit

Permalink
- rename no-jit -> core (llvm#1920)
Browse files Browse the repository at this point in the history
- add windows release
  • Loading branch information
makslevental authored Mar 7, 2023
1 parent 1d3a741 commit c718f87
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 47 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/buildRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
runs-on: a100
strategy:
matrix:
package: [ torch-mlir, torch-mlir-no-jit ]
package: [ torch-mlir, torch-mlir-core ]
py_version: [ cp38-cp38, cp310-cp310, cp311-cp311 ]
exclude:
- package: torch-mlir-no-jit
- package: torch-mlir-core
py_version: cp38-cp38
- package: torch-mlir-no-jit
- package: torch-mlir-core
py_version: cp310-cp310

steps:
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
package: [ torch-mlir, torch-mlir-no-jit ]
package: [ torch-mlir, torch-mlir-core ]
steps:
- name: Get torch-mlir
uses: actions/checkout@v3
Expand Down Expand Up @@ -147,6 +147,9 @@ jobs:
build_windows:
name: Windows Build
runs-on: windows-latest
strategy:
matrix:
package: [ torch-mlir, torch-mlir-core ]
steps:
- name: Get torch-mlir
uses: actions/checkout@v3
Expand All @@ -162,6 +165,14 @@ jobs:
- name: Build Python wheels and smoke test.
shell: pwsh
run: |
if ( "${{ matrix.package }}" -eq "torch-mlir-core" )
{
$env:TORCH_MLIR_ENABLE_JIT_IR_IMPORTER='0'
$env:TORCH_MLIR_ENABLE_ONLY_MLIR_PYTHON_BINDINGS='1'
} else {
$env:TORCH_MLIR_ENABLE_JIT_IR_IMPORTER='1'
$env:TORCH_MLIR_ENABLE_ONLY_MLIR_PYTHON_BINDINGS='0'
}
$env:TORCH_MLIR_PYTHON_PACKAGE_VERSION = '${{ github.event.inputs.python_package_version }}'
./build_tools/python_deploy/build_windows.ps1
Expand Down
25 changes: 8 additions & 17 deletions build_tools/python_deploy/build_linux_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ TM_PYTHON_VERSIONS="${TM_PYTHON_VERSIONS:-cp38-cp38 cp310-cp310 cp311-cp311}"
# Location to store Release wheels
TM_OUTPUT_DIR="${TM_OUTPUT_DIR:-${this_dir}/wheelhouse}"
# What "packages to build"
TM_PACKAGES="${TM_PACKAGES:-torch-mlir torch-mlir-no-jit}"
TM_PACKAGES="${TM_PACKAGES:-torch-mlir torch-mlir-core}"
# Use pre-built Pytorch
TM_USE_PYTORCH_BINARY="${TM_USE_PYTORCH_BINARY:-ON}"
# Skip running tests if you want quick iteration
Expand Down Expand Up @@ -84,7 +84,7 @@ function run_on_host() {
export USERID=0
export GROUPID=0
;;
torch-mlir-no-jit)
torch-mlir-core)
TM_CURRENT_DOCKER_IMAGE=${TM_RELEASE_DOCKER_IMAGE}
export USERID=0
export GROUPID=0
Expand Down Expand Up @@ -164,11 +164,11 @@ function run_in_docker() {

clean_build torch_mlir "$python_version"
;;
torch-mlir-no-jit)
clean_wheels torch_mlir_no_jit "$python_version"
build_torch_mlir_no_jit
run_audit_wheel torch_mlir_no_jit "$python_version"
clean_build torch_mlir_no_jit "$python_version"
torch-mlir-core)
clean_wheels torch_mlir_core "$python_version"
build_torch_mlir_core
run_audit_wheel torch_mlir_core "$python_version"
clean_build torch_mlir_core "$python_version"
;;
out-of-tree)
setup_venv "$python_version"
Expand Down Expand Up @@ -384,7 +384,7 @@ function run_audit_wheel() {
rm "$generic_wheel"
}

function build_torch_mlir_no_jit() {
function build_torch_mlir_core() {
python -m pip install --no-cache-dir -r /main_checkout/torch-mlir/build-requirements.txt
CMAKE_GENERATOR=Ninja \
TORCH_MLIR_PYTHON_PACKAGE_VERSION=${TORCH_MLIR_PYTHON_PACKAGE_VERSION} \
Expand All @@ -393,15 +393,6 @@ function build_torch_mlir_no_jit() {
python -m pip wheel -v -w /wheelhouse /main_checkout/torch-mlir
}

function run_audit_wheel_no_jit() {
local wheel_basename="$1"
local python_version="$2"
generic_wheel="/wheelhouse/${wheel_basename}-${TORCH_MLIR_PYTHON_PACKAGE_VERSION}-${python_version}-linux_x86_64.whl"
echo ":::: Auditwheel $generic_wheel"
auditwheel repair -w /wheelhouse "$generic_wheel"
rm "$generic_wheel"
}

function clean_wheels() {
local wheel_basename="$1"
local python_version="$2"
Expand Down
30 changes: 5 additions & 25 deletions build_tools/python_deploy/build_macos_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ function run() {
build_torch_mlir torch_mlir "$python_version"
run_audit_wheel torch_mlir "$python_version"
;;
torch-mlir-no-jit)
clean_wheels torch_mlir_no_jit "$python_version"
build_torch_mlir_no_jit torch_mlir_no_jit "$python_version"
run_audit_wheel_no_jit torch_mlir_no_jit "$python_version"
torch-mlir-core)
clean_wheels torch_mlir_core "$python_version"
build_torch_mlir_core torch_mlir_core "$python_version"
run_audit_wheel torch_mlir_core "$python_version"
;;
*)
echo "Unrecognized package '$package'"
Expand Down Expand Up @@ -93,7 +93,7 @@ function build_torch_mlir() {
rm -rf "$output_dir"/build_venv
}

function build_torch_mlir_no_jit() {
function build_torch_mlir_core() {
local wheel_basename="$1"
local python_version="$2"
rm -rf "$output_dir"/build_venv
Expand Down Expand Up @@ -141,24 +141,4 @@ function run_audit_wheel() {
fi
}

function run_audit_wheel_no_jit() {
set +x
local wheel_basename="$1"
local python_version="$2"
generic_wheel=$(ls "$output_dir"/"${wheel_basename}"-* | grep "${python_version//./}")
echo "Looking for $generic_wheel"
if [ -f "$generic_wheel" ]; then
echo "$generic_wheel found. Delocating it.."
rm -rf "$output_dir"/test_venv
python"${python_version}" -m venv "$output_dir"/test_venv
source "$output_dir"/test_venv/bin/activate
python"${python_version}" -m pip install -U pip delocate
python"${python_version}" -m pip install -r "$repo_root"/build-requirements.txt
python"${python_version}" -m pip install "$generic_wheel"
DYLD_LIBRARY_PATH="$output_dir"/test_venv/lib/python"${python_version}"/site-packages/torch/lib delocate-wheel -v "$generic_wheel"
deactivate
rm -rf "$output_dir"/test_venv
fi
}

run
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def build_extension(self, ext):


setup(
name="torch-mlir" if not TORCH_MLIR_ENABLE_ONLY_MLIR_PYTHON_BINDINGS else "torch-mlir-no-jit",
name="torch-mlir" if not TORCH_MLIR_ENABLE_ONLY_MLIR_PYTHON_BINDINGS else "torch-mlir-core",
version=f"{PACKAGE_VERSION}",
author="Sean Silva",
author_email="silvasean@google.com",
Expand Down

0 comments on commit c718f87

Please sign in to comment.