forked from llvm/torch-mlir
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a powershell script to build windows .whl packages Disable LTC as it doesn't build on Windows. Add GHA hooks Use Python 3.10.8
- Loading branch information
Showing
5 changed files
with
129 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Uncomment if you want to install Python. GHA provides this | ||
|
||
#Write-Host "Installing python" | ||
|
||
#Start-Process choco 'install python --version=3.10.8' -wait -NoNewWindow | ||
|
||
#Write-Host "python installation completed successfully" | ||
|
||
#Write-Host "Reload environment variables" | ||
#$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") | ||
#Write-Host "Reloaded environment variables" | ||
|
||
Write-Host "Installing Build Dependencies" | ||
python -m venv .\mlir_venv\ | ||
.\mlir_venv\Scripts\activate | ||
pip install -r .\requirements.txt | ||
Write-Host "Build Deps installation completed successfully" | ||
|
||
Write-Host "Building torch-mlir" | ||
$env:CMAKE_GENERATOR='Ninja' | ||
$env:TORCH_MLIR_ENABLE_LTC='0' | ||
python -m pip wheel -v -w wheelhouse ./ -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html -r whl-requirements.txt | ||
|
||
Write-Host "Build completed successfully" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#Uncomment if you want to test locally. GHA provides Python | ||
#Write-Host "Installing python" | ||
|
||
#Start-Process choco 'install python --version=3.10.8' -wait -NoNewWindow | ||
|
||
#Write-Host "python installation completed successfully" | ||
|
||
#Write-Host "Reload environment variables" | ||
#$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") | ||
#Write-Host "Reloaded environment variables" | ||
|
||
Write-Host "Installing Build Dependencies" | ||
python -m venv .\mlir_venv\ | ||
.\mlir_venv\Scripts\activate | ||
pip install -r .\requirements.txt | ||
Write-Host "Build Deps installation completed successfully" | ||
|
||
Write-Host "Building torch-mlir" | ||
|
||
#Start-Process cmake '-GNinja -Bbuild \ | ||
# -DCMAKE_BUILD_TYPE=Release \ | ||
# -DPython3_FIND_VIRTUALENV=ONLY \ | ||
# -DLLVM_ENABLE_PROJECTS=mlir \ | ||
# -DLLVM_EXTERNAL_PROJECTS="torch-mlir;torch-mlir-dialects" \ | ||
# -DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR="$PWD" \ | ||
# -DLLVM_EXTERNAL_TORCH_MLIR_DIALECTS_SOURCE_DIR="$PWD"/externals/llvm-external-projects/torch-mlir-dialects \ | ||
# -DMLIR_ENABLE_BINDINGS_PYTHON=ON \ | ||
# -DLLVM_TARGETS_TO_BUILD=host \ | ||
# /externals/llvm-project/llvm' | ||
#Write-Host "Build completed successfully" | ||
|
||
Write-Host "Building torch-mlir" | ||
$env:CMAKE_GENERATOR='Ninja' | ||
$env:TORCH_MLIR_ENABLE_LTC='0' | ||
python -m pip wheel -v -w wheelhouse ./ -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html -r whl-requirements.txt | ||
Write-Host "Build completed successfully" | ||
|
||
Write-Host "Testing torch-mlir" | ||
$env:PYTHONPATH = "$PWD/build/cmake_build/tools/torch-mlir/python_packages/torch_mlir;$PWD/examples" | ||
# Uncomment here to enable tests. TODO: Fix paths | ||
#cmake --build cmake_build/build --target check-torch-mlir-all | ||
Write-Host "Testing completed successfully" |