Skip to content

Commit

Permalink
update ci to pixi (#304)
Browse files Browse the repository at this point in the history
* update all rules

update workflows

update worklfow

use custom mlir build

* undo mlir test pass fixes

* remove pyright
  • Loading branch information
jorendumoulin authored Dec 17, 2024
1 parent 41d3d9b commit 8dfa45d
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 143 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-run-kernel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:

jobs:
build-and-run-kernels:
runs-on: ubuntu-latest
container:
image: ghcr.io/kuleuven-micas/snax:v0.2.7
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- name: Install snax-mlir
run: python3 -m pip install '-e.[dev]'
- uses: prefix-dev/[email protected]
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: Build and run kernels
run: make allrun
run: pixi run make allrun
working-directory: kernels/${{ matrix.kernel }}
strategy:
matrix:
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/build-run-mlperf-tiny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ on:

jobs:
build-and-run-networks:
runs-on: ubuntu-latest
container:
image: ghcr.io/kuleuven-micas/snax:v0.2.7
runs-on: ubuntu-24.04
strategy:
matrix:
model:
Expand All @@ -25,15 +23,16 @@ jobs:
dir: kernels/mlperf_tiny_kws
steps:
- uses: actions/checkout@v3
- name: Install snax-mlir
run: |
python3 -m pip install '-e.[dev,nn]'
- uses: prefix-dev/[email protected]
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: snax-opt network compilation
run: |
make ${{ matrix.model.name }}.o
pixi run make ${{ matrix.model.name }}.o
working-directory: ${{ matrix.model.dir }}
- name: vanilla network compilation
run: |
make ${{ matrix.model.name }}.no-snax-opt.o
pixi run make ${{ matrix.model.name }}.no-snax-opt.o
working-directory: ${{ matrix.model.dir }}

4 changes: 2 additions & 2 deletions .github/workflows/code-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
code-formatting:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

Expand All @@ -17,4 +17,4 @@ jobs:

- name: Run code formatting checks with pre-commit
uses: pre-commit/[email protected]


14 changes: 6 additions & 8 deletions .github/workflows/lit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ permissions:
jobs:
python-tests:

runs-on: ubuntu-latest
container:
image: ghcr.io/kuleuven-micas/snax:v0.2.7
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v3
- name: Install snax-mlir
shell: bash
run: |
python3 -m pip install '-e.[dev]'
- uses: prefix-dev/[email protected]
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: Test with lit
shell: bash
run: |
lit tests/filecheck -v
pixi run lit tests/filecheck -v
14 changes: 6 additions & 8 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ permissions:
jobs:
python-tests:

runs-on: ubuntu-latest
container:
image: ghcr.io/kuleuven-micas/snax:v0.2.7
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v3
- name: Install snax-mlir
shell: bash
run: |
python3 -m pip install '-e.[dev]'
- uses: prefix-dev/[email protected]
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: Test with pytest
shell: bash
run: |
python3 -m pytest .
pixi run python -m pytest .
13 changes: 6 additions & 7 deletions .github/workflows/run-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ on:

jobs:
run-benchmarks:
runs-on: ubuntu-latest
container:
image: ghcr.io/kuleuven-micas/snax:v0.2.7
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install snax-mlir
run: python3 -m pip install '-e.[dev,viz]'
- uses: actions/checkout@v4
- uses: actions/prefix-dev/[email protected]
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: Run benchmarks
run: python3 genbenchmark.py
working-directory: benchmarks/${{ matrix.kernel }}
Expand Down
105 changes: 14 additions & 91 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ line-length = 120
max-complexity = 10

[tool.pixi.project]
channels = ["conda-forge", "bioconda"]
channels = ["conda-forge", "bioconda", "kuleuven-micas"]
platforms = ["linux-64"]

[tool.pixi.pypi-dependencies]
Expand All @@ -81,6 +81,7 @@ default = { features = ["dev", "nn", "viz"] }
[tool.pixi.tasks]

[tool.pixi.dependencies]
mlir = "==19.1.1"
mlir = { version = "==19.1.1.d401987fe349a87c53fe25829215b80b70c0c1a", channel = "kuleuven-micas" }
clang = "==19.1.1"
lld = "==19.1.1"
snax-cluster = "==0.2.7"
2 changes: 1 addition & 1 deletion runtime/Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ AR = llvm-ar
RANLIB = llvm-ranlib
OBJDUMP = llvm-objdump
DASM = spike-dasm
GENTRACE = /opt/gen_trace.py
GENTRACE = ${CONDA_PREFIX}/snax-utils/gen_trace.py
MLIROPT = mlir-opt
MLIRTRANSLATE = mlir-translate
SNAXOPT = $(MAKEFILE_RULES_DIRNAME)/../compiler/snax-opt
Expand Down
4 changes: 2 additions & 2 deletions runtime/snax-alu.rules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Specific settings for snax-alu RTL
SNITCH_SW_PATH = /opt/snax-alu
VLTSIM = /opt/snax-alu-rtl/bin/snitch_cluster.vlt
SNITCH_SW_PATH = ${CONDA_PREFIX}/snax-utils/snax-alu
VLTSIM = ${CONDA_PREFIX}/snax-utils/snax-alu-rtl/bin/snitch_cluster.vlt
4 changes: 2 additions & 2 deletions runtime/snax-gemm.rules
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Specific settings for snax-mac RTL
SNITCH_SW_PATH = /opt/snax-gemm
VLTSIM = /opt/snax-gemm-rtl/bin/snitch_cluster.vlt
SNITCH_SW_PATH = ${CONDA_PREFIX}/snax-utils/snax-gemm
VLTSIM = ${CONDA_PREFIX}/snax-utils/snax-gemm-rtl/bin/snitch_cluster.vlt
CFLAGS += -I$(SNITCH_SW_PATH)/target/snitch_cluster/sw/snax/gemm/include
LDFLAGS += $(SNITCH_SW_PATH)/target/snitch_cluster/sw/snax/gemm/build/snax-gemm-lib.o
4 changes: 2 additions & 2 deletions runtime/snax-gemmx.rules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Specific settings for snax-kul-cluster-mixed-narrow-wide RTL
SNITCH_SW_PATH = /opt/snax-kul-cluster-mixed-narrow-wide/
VLTSIM = /opt/snax-kul-cluster-mixed-narrow-wide-rtl/bin/snitch_cluster.vlt
SNITCH_SW_PATH = ${CONDA_PREFIX}/snax-utils/snax-kul-cluster-mixed-narrow-wide/
VLTSIM = ${CONDA_PREFIX}/snax-utils/snax-kul-cluster-mixed-narrow-wide-rtl/bin/snitch_cluster.vlt
4 changes: 2 additions & 2 deletions runtime/snax-mac.rules
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Specific settings for snax-mac RTL
SNITCH_SW_PATH = /opt/snax-mac
VLTSIM = /opt/snax-mac-rtl/bin/snitch_cluster.vlt
SNITCH_SW_PATH = ${CONDA_PREFIX}/snax-utils/snax-mac
VLTSIM = ${CONDA_PREFIX}/snax-utils/snax-mac-rtl/bin/snitch_cluster.vlt
CFLAGS += -I$(SNITCH_SW_PATH)/target/snitch_cluster/sw/snax/mac/include
LDFLAGS += $(SNITCH_SW_PATH)/target/snitch_cluster/sw/snax/mac/build/mac.o
4 changes: 2 additions & 2 deletions runtime/snax-streamer-gemm.rules
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Specific settings for snax-streamer-gemm RTL
SNITCH_SW_PATH = /opt/snax-streamer-gemm
VLTSIM = /opt/snax-streamer-gemm-rtl/bin/snitch_cluster.vlt
SNITCH_SW_PATH = ${CONDA_PREFIX}/snax-utils/snax-streamer-gemm
VLTSIM = ${CONDA_PREFIX}/snax-utils/snax-streamer-gemm-rtl/bin/snitch_cluster.vlt
CFLAGS += -I$(SNITCH_SW_PATH)/target/snitch_cluster/sw/snax/streamer-gemm/include
LDFLAGS += $(SNITCH_SW_PATH)/target/snitch_cluster/sw/snax/streamer-gemm/build/snax-streamer-gemm-lib.o

0 comments on commit 8dfa45d

Please sign in to comment.