Skip to content

Commit e22975e

Browse files
committed
[REFACTOR][CI] Clean up GitHub Actions platform build workflow
1 parent f8dc0fb commit e22975e

2 files changed

Lines changed: 63 additions & 92 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 63 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -35,70 +35,83 @@ concurrency:
3535
cancel-in-progress: true
3636

3737
jobs:
38-
MacOS:
38+
Platform:
3939
if: ${{ github.repository == 'apache/tvm' }}
40-
runs-on: macOS-latest
40+
strategy:
41+
matrix:
42+
include:
43+
- name: MacOS
44+
os: macOS-latest
45+
- name: Windows
46+
os: windows-latest
47+
runs-on: ${{ matrix.os }}
48+
name: ${{ matrix.name }}
49+
env:
50+
UV_PYTHON: ${{ matrix.os == 'windows-latest' && '.venv/Scripts/python.exe' || '.venv/bin/python' }}
4151
steps:
4252
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4353
with:
4454
submodules: 'recursive'
45-
- name: Set up environment
46-
uses: ./.github/actions/setup
47-
- name: Install LLVM dependencies
48-
shell: bash -l {0}
55+
- uses: astral-sh/setup-uv@v7
56+
with:
57+
python-version: 3.10
58+
enable-cache: true
59+
cache-python: true
60+
61+
- name: Create venv
62+
shell: pwsh
4963
run: |
50-
conda install -c conda-forge llvmdev cmake ninja zlib
51-
- name: Build TVM wheel
52-
shell: bash -l {0}
64+
uv venv --python 3.10
65+
66+
- name: Install tvm-ffi package
5367
run: |
54-
pip install scikit-build-core
55-
export CMAKE_ARGS="-DUSE_LLVM=ON -DBUILD_TESTING=OFF"
56-
pip wheel --no-deps -w dist . -v
57-
- name: Install TVM from wheel
68+
uv pip install --verbose ./3rdparty/tvm-ffi
69+
70+
- name: Install LLVM dependencies (MacOS)
71+
if: matrix.os == 'macOS-latest'
5872
shell: bash -l {0}
5973
run: |
60-
pip install dist/*.whl
74+
brew install llvm cmake ninja zlib
6175
62-
- name: Test
63-
shell: bash -l {0}
64-
run: >-
65-
python -m pytest -v tests/python/all-platform-minimal-test
66-
- name: Minimal Metal Compile-Only
67-
shell: bash -l {0}
76+
- name: Install LLVM dependencies (Windows)
77+
if: matrix.os == 'windows-latest'
78+
shell: pwsh
6879
run: |
69-
python -m pytest -v -s 'tests/python/codegen/test_gpu_codegen_allreduce.py::test_allreduce_sum_compile'
70-
python -m pytest -v -s 'tests/python/codegen/test_target_codegen_metal.py::test_func_with_trailing_pod_params'
71-
- name: Minimal Metal Compile-and-Run
72-
shell: bash -l {0}
73-
run: >-
74-
python -m pytest -v -s 'tests/python/codegen/test_target_codegen_metal.py'
75-
python -m pytest -v -s 'tests/python/codegen/test_target_codegen_gpu_common.py'
76-
python -m pytest -v -s 'tests/python/codegen/test_gpu_codegen_allreduce.py::test_allreduce_sum[dims0-metal]'
80+
choco install llvm cmake ninja libxml2 -y --no-progress
7781
78-
Windows:
79-
if: ${{ github.repository == 'apache/tvm' }}
80-
runs-on: windows-latest
81-
steps:
82-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
83-
with:
84-
submodules: 'recursive'
85-
- name: Set up environment
86-
uses: ./.github/actions/setup
87-
- name: Install LLVM dependencies
88-
shell: cmd /C call {0}
82+
- name: Install TVM (MacOS)
83+
if: matrix.os == 'macOS-latest'
84+
shell: bash -l {0}
8985
run: |
90-
conda install -c conda-forge llvmdev cmake ninja zlib libxml2-devel
91-
- name: Install TVM
92-
shell: cmd /C call {0}
86+
uv pip install --verbose scikit-build-core
87+
export CMAKE_ARGS="-G Ninja -DUSE_LLVM=ON -DBUILD_TESTING=OFF"
88+
uv pip install --no-deps . --verbose
89+
90+
- name: Install TVM (Windows)
91+
if: matrix.os == 'windows-latest'
92+
shell: pwsh
9393
run: |
94-
pip install scikit-build-core
95-
set CMAKE_ARGS=-DUSE_LLVM=ON -DBUILD_TESTING=OFF
96-
pip install --no-deps . -v
94+
uv pip install --verbose scikit-build-core
95+
$env:CMAKE_ARGS = "-G Ninja -DUSE_LLVM=ON -DBUILD_TESTING=OFF"
96+
uv pip install --no-deps . --verbose
97+
9798
- name: Install test dependencies
98-
shell: cmd /C call {0}
9999
run: |
100-
pip install psutil cloudpickle ml_dtypes numpy packaging scipy tornado typing_extensions
101-
- name: Test
102-
shell: cmd /C call {0}
100+
uv pip install --verbose psutil cloudpickle ml_dtypes numpy packaging scipy tornado typing_extensions
101+
102+
- name: Platform minimal test
103+
run: >-
104+
uv run pytest -v tests/python/all-platform-minimal-test
105+
106+
- name: Minimal Metal Compile-Only
107+
if: matrix.os == 'macOS-latest'
108+
run: |
109+
uv run pytest -v -s 'tests/python/codegen/test_gpu_codegen_allreduce.py::test_allreduce_sum_compile'
110+
uv run pytest -v -s 'tests/python/codegen/test_target_codegen_metal.py::test_func_with_trailing_pod_params'
111+
112+
- name: Minimal Metal Compile-and-Run
113+
if: matrix.os == 'macOS-latest'
103114
run: >-
104-
python -m pytest -v tests/python/all-platform-minimal-test
115+
uv run pytest -v -s 'tests/python/codegen/test_target_codegen_metal.py'
116+
uv run pytest -v -s 'tests/python/codegen/test_target_codegen_gpu_common.py'
117+
uv run pytest -v -s 'tests/python/codegen/test_gpu_codegen_allreduce.py::test_allreduce_sum[dims0-metal]'

0 commit comments

Comments
 (0)