-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TorchScript to Knossos test with preview PyTorch on GitHub Actions (#669
) * Try using PyTorch Preview for a nightly build - helps us detect if breakages occur early * Make failable actions exit * Create vcbuild.cmd https://github.com/microsoft/vswhere/wiki/Find-VC #679
- Loading branch information
Showing
4 changed files
with
97 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: PyTorch (preview) | ||
|
||
on: | ||
|
||
schedule: | ||
- cron: '5 4 * * *' | ||
workflow_dispatch: | ||
|
||
# named branch push is for testing while experimenting. Remove before merge to master | ||
push: | ||
branches: | ||
- cogravil/pytorch_preview_ci | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: windows-2019 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
# Version range or exact version of a Python version to use, using SemVer's version range syntax. | ||
python-version: 3.7 | ||
|
||
- name: 'Make directories [userInstall]' | ||
shell: pwsh | ||
run: test/builds/mkdirs.ps1 | ||
|
||
- name: 'Install dependencies [userInstall]' | ||
shell: cmd | ||
run: call test/builds/install_windows.bat || sleep 30 && call test/builds/install_windows.bat || sleep 30 && call test/builds/install_windows.bat | ||
|
||
- name: 'GHC compile src/ksc/Main.hs [userTest]' | ||
shell: cmd | ||
run: refreshenv && C:/ProgramData/chocolatey/lib/cabal/tools/cabal-3.0.0.0/cabal v2-install --with-ghc=C:/ProgramData/chocolatey/lib/ghc/tools/ghc-8.4.4/bin/ghc --installdir=build/bin --overwrite-policy=always --install-method=copy | ||
|
||
# Preview version of PyTorch | ||
- name: Testing ksc python package [userTest] | ||
shell: cmd | ||
run: test/builds/test_pytest_PyTorchPreview.cmd | ||
|
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,40 @@ | ||
set -e | ||
|
||
set PreferredToolArchitecture=x64 | ||
|
||
IF defined GITHUB_ACTIONS ( | ||
ECHO on GitHub Actions, activating vcbuild environment | ||
call %~dp0vcbuild.cmd -arch=x64 -host_arch=x64 | ||
) | ||
|
||
where cl.exe | ||
|
||
echo Set Pip to specific version... | ||
python -m pip install --force-reinstall pip==20.3 || exit /b | ||
|
||
REM New resolver with PyTorch version notation https://pip.pypa.io/en/latest/user_guide/#changes-to-the-pip-dependency-resolver-in-20-3-2020 | ||
REM Too big, throw memory exception https://stackoverflow.com/a/31526029/35544 | ||
|
||
REM currently have backend issues on PyTorch 1.8.0 https://github.com/microsoft/knossos-ksc/issues/659 so trying nightly | ||
echo Installing dependencies... | ||
python -m pip install -r src/python/requirements.txt || exit /b | ||
python -m pip install --pre --use-deprecated=legacy-resolver --no-cache-dir pytest numpy torch -f https://download.pytorch.org/whl/nightly/cu111/torch_nightly.html || exit /b | ||
|
||
echo Installing ksc... | ||
cd ./src/python | ||
python -m pip install --editable . || exit /b | ||
cd ../.. | ||
|
||
echo Running pytest | ||
pytest test/python || exit /b | ||
|
||
echo Installing TS2KS... | ||
cd ./src/ts2k | ||
python -m pip install --editable . || exit /b | ||
cd ../.. | ||
|
||
REM we only run a single test for now, multiple tests run out of heap see #679 | ||
pytest test\ts2k\test_ts2k.py -k test_cat | ||
|
||
REM echo Running pytest on ts2k | ||
REM pytest test/ts2k || exit /b |
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,10 @@ | ||
@REM from https://github.com/microsoft/vswhere/wiki/Find-VC | ||
@echo off | ||
|
||
for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do ( | ||
set InstallDir=%%i | ||
) | ||
|
||
if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" ( | ||
"%InstallDir%\Common7\Tools\vsdevcmd.bat" %* | ||
) |