Skip to content

[CI] Enable CPU CPP Uint test in Github Action #37

[CI] Enable CPU CPP Uint test in Github Action

[CI] Enable CPU CPP Uint test in Github Action #37

Workflow file for this run

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# GH actions.
# We use it to cover windows and mac builds
# Jenkins is still the primary CI
name: CI
on:
push:
branches:
- v0.18.0
pull_request:
branches:
- v0.18.0
workflow_dispatch:
concurrency:
group: CI-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
MacOS:
if: ${{ github.repository == 'MetaX-MACA/mcTVM' }}
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set up environment
uses: ./.github/actions/setup
- name: Conda Build
shell: bash -l {0}
run: >-
conda build --output-folder=conda/pkg conda/recipe &&
conda install tvm -c ./conda/pkg
- name: Test
shell: bash -l {0}
run: >-
python -m pytest -v tests/python/all-platform-minimal-test
- name: Minimal Metal Compile-Only
shell: bash -l {0}
run: |
python -m pytest -v -s 'tests/python/codegen/test_gpu_codegen_allreduce.py::test_allreduce_sum_compile'
python -m pytest -v -s 'tests/python/codegen/test_target_codegen_metal.py::test_func_with_trailing_pod_params'
- name: Minimal Metal Compile-and-Run
shell: bash -l {0}
run: >-
python -m pytest -v -s 'tests/python/codegen/test_target_codegen_metal.py'
python -m pytest -v -s 'tests/python/codegen/test_target_codegen_gpu_common.py'
python -m pytest -v -s 'tests/python/codegen/test_gpu_codegen_allreduce.py::test_allreduce_sum[dims0-metal]'
MetaXGPU:
if: ${{ github.repository == 'MetaX-MACA/mcTVM' }}
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Build
run: |
rm -rf build
mkdir -p build
cp cmake/config.cmake build
cmake -B build
make -j -C build
- name: Test
shell: bash -l {0}
run: >-
PYTHONPATH=python python3 -m pytest -v tests/python/all-platform-minimal-test
Windows:
if: ${{ github.repository == 'MetaX-MACA/mcTVM' }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set up environment
uses: ./.github/actions/setup
- name: Conda Build
shell: cmd /C call {0}
run: >-
conda build --output-folder=conda/pkg conda/recipe &&
conda install tvm -c ./conda/pkg
- name: Test
shell: cmd /C call {0}
run: >-
python -m pytest -v tests/python/all-platform-minimal-test
Linux-CPU-Test:
if: ${{ github.repository == 'MetaX-MACA/mcTVM' }}
runs-on: ubuntu-22.04
steps:
- uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: false
swap-storage: false
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: hendrikmuhs/ccache-action@v1.2
- name: Set up environment
uses: ./.github/actions/setup
- name: Fetch tophub
shell: bash -l {0}
run: >-
git clone https://github.com/tlc-pack/tophub.git ${HOME}/.tvm
- name: Build TVM
shell: bash -l {0}
run: >-
cmake -B build -G Ninja -S ./ \
-DUSE_SORT=ON \
-DUSE_LLVM=llvm-config \
-DUSE_UMA=ON \
-DSUMMARIZE=ON \
-DUSE_MSC=ON \
-DUSE_LIBBACKTRACE=COMPILE \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=RelWithDebInfo &&
cmake --build ./build -j $(nproc)
- name: Build CPP tests
shell: bash -l {0}
run: >-
cmake --build ./build --target cpptest -j $(nproc)
- name: Run CPP Unit Test
shell: bash -l {0}
run: >-
bash ./tests/scripts/task_cpp_unittest.sh
- name: Run Python Unit Test
shell: bash -l {0}
run: >-
bash ./tests/scripts/task_python_unittest.sh