2020-08-05 09:57:59 +08:00
|
|
|
name: Build and Test
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2021-07-28 07:10:10 +08:00
|
|
|
name: Build and Test (Release Asserts)
|
2020-08-08 01:32:02 +08:00
|
|
|
runs-on: ubuntu-20.04
|
2020-08-05 09:57:59 +08:00
|
|
|
steps:
|
2021-07-30 01:43:18 +08:00
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.9
|
2020-08-05 09:57:59 +08:00
|
|
|
- name: Get npcomp
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: 'true'
|
2020-11-23 05:01:15 +08:00
|
|
|
- name: Install python depends
|
2020-10-13 12:49:39 +08:00
|
|
|
run: |
|
2021-07-30 01:43:18 +08:00
|
|
|
python -m pip install -r $GITHUB_WORKSPACE/external/llvm-project/mlir/python/requirements.txt
|
2021-02-22 05:36:06 +08:00
|
|
|
- name: Install pytorch_nightly depends
|
|
|
|
run: |
|
2021-08-03 01:58:02 +08:00
|
|
|
python -m pip install --pre torch torchvision -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
|
2021-07-28 07:10:10 +08:00
|
|
|
- name: Install Ninja
|
|
|
|
uses: llvm/actions/install-ninja@55d844821959226fab4911f96f37071c1d4c3268
|
|
|
|
- name: Get Submodule Hash
|
|
|
|
id: get-submodule-hash
|
|
|
|
run: echo "::set-output name=hash::$(md5sum $(git submodule status))"
|
2020-08-05 09:57:59 +08:00
|
|
|
shell: bash
|
2021-07-28 07:10:10 +08:00
|
|
|
- name: Ccache for C++ compilation
|
|
|
|
uses: hendrikmuhs/ccache-action@4687d037e4d7cf725512d9b819137a3af34d39b3
|
2020-08-05 09:57:59 +08:00
|
|
|
with:
|
2021-07-30 01:43:18 +08:00
|
|
|
key: ${{ runner.os }}-clangreleaseasserts-${{ steps.get-submodule-hash.outputs.hash }}
|
2020-08-05 09:57:59 +08:00
|
|
|
- name: Build and Test npcomp (Assert)
|
|
|
|
run: |
|
2021-07-28 07:10:10 +08:00
|
|
|
cd $GITHUB_WORKSPACE
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake .. -GNinja \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DCMAKE_LINKER=lld \
|
|
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
|
|
|
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
|
2021-07-30 01:43:18 +08:00
|
|
|
-DPython3_EXECUTABLE=$(which python) \
|
2021-07-28 07:10:10 +08:00
|
|
|
-DLLVM_ENABLE_ASSERTIONS=ON \
|
|
|
|
-DLLVM_TARGETS_TO_BUILD=host \
|
|
|
|
-DNPCOMP_ENABLE_PYTORCH=ON
|
|
|
|
ninja
|
|
|
|
ninja check-npcomp check-frontends-pytorch
|
2021-07-30 13:50:52 +08:00
|
|
|
- name: Refbackend integration tests
|
|
|
|
run: |
|
|
|
|
cd $GITHUB_WORKSPACE
|
|
|
|
export PYTHONPATH="$GITHUB_WORKSPACE/build/python_packages/npcomp_core:$GITHUB_WORKSPACE/build/python_packages/npcomp_torch"
|
|
|
|
python -m frontends.pytorch.e2e_testing.torchscript.main --config=refbackend
|
2021-07-30 01:43:18 +08:00
|
|
|
|
|
|
|
build_wheels:
|
|
|
|
name: Build Wheels and Smoketest
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.9
|
|
|
|
- name: Get npcomp
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: 'true'
|
|
|
|
- name: Install python dependencies
|
|
|
|
run: |
|
2021-08-03 01:58:02 +08:00
|
|
|
python -m pip install --pre torch torchvision -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
|
2021-07-30 01:43:18 +08:00
|
|
|
python -m pip install wheel
|
|
|
|
- name: Install Ninja
|
|
|
|
uses: llvm/actions/install-ninja@55d844821959226fab4911f96f37071c1d4c3268
|
|
|
|
- name: Get Submodule Hash
|
|
|
|
id: get-submodule-hash
|
|
|
|
run: echo "::set-output name=hash::$(md5sum $(git submodule status))"
|
|
|
|
shell: bash
|
|
|
|
- name: Ccache for C++ compilation
|
|
|
|
uses: hendrikmuhs/ccache-action@4687d037e4d7cf725512d9b819137a3af34d39b3
|
|
|
|
with:
|
|
|
|
key: ${{ runner.os }}-wheel-${{ steps.get-submodule-hash.outputs.hash }}
|
2021-09-11 12:40:16 +08:00
|
|
|
#- name: Build wheels
|
|
|
|
# run: |
|
|
|
|
# cd $GITHUB_WORKSPACE
|
|
|
|
# ./build_tools/build_python_wheels.sh
|
|
|
|
#- uses: actions/upload-artifact@v2
|
|
|
|
# with:
|
|
|
|
# name: ubuntu-20.04-wheels
|
|
|
|
# path: wheelhouse/
|