Skip to content

Commit cdf0349

Browse files
committed
ci : add workflow for testing CPU variants [no ci]
This is a work in progress to try out different CPU variants using the CPU reference backend with repacking enabled. The workflow will be manually triggered and allows specifying the operation and variant to test.
1 parent 98e9865 commit cdf0349

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Test CPU Variants
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
operation:
7+
description: 'Operation to test (e.g., MUL_MAT or full spec)'
8+
required: false
9+
default: 'MUL_MAT'
10+
type: string
11+
variant:
12+
description: 'CPU variant to test (leave empty to list available variants)'
13+
required: false
14+
default: ''
15+
type: string
16+
17+
jobs:
18+
test-cpu-variant-sve:
19+
runs-on: ubuntu-24.04-arm
20+
steps:
21+
- name: Clone
22+
uses: actions/checkout@v4
23+
24+
- name: Dependencies
25+
run: |
26+
sudo apt-get update
27+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
28+
sudo apt-get update
29+
sudo apt-get install build-essential gcc-14 g++-14
30+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
31+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
32+
gcc --version
33+
34+
- name: Build with CPU reference backend
35+
run: |
36+
cmake -B build -S . \
37+
-DGGML_CPU_REF_BACKEND=ON \
38+
-DGGML_CPU_ALL_VARIANTS=ON \
39+
-DGGML_CPU_REPACK=ON \
40+
-DGGML_NATIVE=OFF \
41+
-DGGML_BACKEND_DL=ON \
42+
-DGGML_BLAS=OFF \
43+
-DLLAMA_CURL=OFF \
44+
-DCMAKE_BUILD_TYPE=Release
45+
46+
cmake --build build -j8
47+
48+
- name: List available CPU variants
49+
run: |
50+
echo "Available CPU variants:"
51+
./build/bin/test-backend-ops cpu-variants --list
52+
53+
- name: Test CPU variant
54+
if: ${{ inputs.variant != '' }}
55+
run: |
56+
echo "Testing variant: ${{ inputs.variant }}"
57+
echo "Operation: ${{ inputs.operation }}"
58+
./build/bin/test-backend-ops cpu-variants \
59+
--variant ${{ inputs.variant }} \
60+
-o "${{ inputs.operation }}"
61+
62+
- name: Instructions
63+
if: ${{ inputs.variant == '' }}
64+
run: |
65+
echo "=========================================="
66+
echo "No variant specified - only listed available variants above"
67+
echo "To test a specific variant, re-run this workflow with:"
68+
echo " - variant: one of the variants listed above"
69+
echo " - operation: your operation string (default: MUL_MAT)"
70+
echo "=========================================="

0 commit comments

Comments
 (0)