- rename no-jit -> core (#1920)

- add windows release
pull/1919/merge
Maksim Levental 2023-03-07 00:20:06 -06:00 committed by GitHub
parent 1d3a7419c5
commit c718f87c5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 47 deletions

View File

@ -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:
@ -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
@ -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
@ -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

View File

@ -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
@ -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
@ -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"
@ -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} \
@ -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"

View File

@ -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'"
@ -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
@ -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

View File

@ -146,7 +146,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
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",