Skip to content

Commit 54f3e9c

Browse files
committed
Alpha version of CI suite using PyTest for Siracusa and Siracusa Tiled
1 parent 393dd9d commit 54f3e9c

11 files changed

+264
-275
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Siracusa Tiled Kernels Runner
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runner:
7+
required: true
8+
type: string
9+
docker-image:
10+
required: true
11+
type: string
12+
memory-level:
13+
required: true
14+
type: string
15+
description: 'Memory level marker (l2 or l3)'
16+
buffer-mode:
17+
required: true
18+
type: string
19+
description: 'Buffer mode marker (singlebuffer or doublebuffer)'
20+
21+
jobs:
22+
run-tests:
23+
runs-on: ${{ inputs.runner }}
24+
container:
25+
image: ${{ inputs.docker-image }}
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
with:
31+
submodules: recursive
32+
33+
- name: Install Deeploy
34+
run: |
35+
pip install -e .
36+
37+
- name: Run kernel tests
38+
run: |
39+
cd DeeployTest
40+
pytest test_platforms.py -m "siracusa_tiled and kernels and ${{ inputs.memory-level }} and ${{ inputs.buffer-mode }}" -v
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Siracusa Tiled Models Runner
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runner:
7+
required: true
8+
type: string
9+
docker-image:
10+
required: true
11+
type: string
12+
test-name:
13+
required: true
14+
type: string
15+
description: 'Test name to run'
16+
memory-level:
17+
required: true
18+
type: string
19+
description: 'Memory level marker (l2 or l3)'
20+
buffer-mode:
21+
required: true
22+
type: string
23+
description: 'Buffer mode marker (singlebuffer or doublebuffer)'
24+
25+
jobs:
26+
run-test:
27+
runs-on: ${{ inputs.runner }}
28+
container:
29+
image: ${{ inputs.docker-image }}
30+
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v4
34+
with:
35+
submodules: recursive
36+
37+
- name: Install Deeploy
38+
run: |
39+
pip install -e .
40+
41+
- name: Run model test with retry
42+
uses: nick-fields/retry@v3
43+
with:
44+
timeout_minutes: 10
45+
max_attempts: 3
46+
retry_on: error
47+
command: |
48+
cd DeeployTest
49+
pytest test_platforms.py -k "${{ inputs.test-name }}-" -m "siracusa_tiled and models and ${{ inputs.memory-level }} and ${{ inputs.buffer-mode }}" -v

.github/workflows/_runner-siracusa-tiled-sequential.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ jobs:
5151
- name: Build Deeploy
5252
shell: bash
5353
run: pip install -e .
54-
- name: Install jq
55-
run: |
56-
export DEBIAN_FRONTEND=noninteractive
57-
apt-get update -y
58-
apt-get install -y jq
5954
- name: Cache ccache
6055
uses: actions/cache/restore@v4
6156
with:
@@ -64,16 +59,14 @@ jobs:
6459
- name: Run Tests
6560
run: |
6661
cd DeeployTest
67-
echo '${{ inputs.tests-config }}' > tests.json
6862
mkdir -p /app/.ccache
6963
export CCACHE_DIR=/app/.ccache
7064
71-
jq -c '.[]' tests.json | while read test; do
72-
testName=$(echo "$test" | jq -r '.name')
73-
L1_values=$(echo "$test" | jq -r '.L1[]')
74-
for L1_value in $L1_values; do
75-
echo "Running test: $testName with L1: $L1_value"
76-
python testRunner_tiled_siracusa.py -t Tests/$testName --cores=${{ inputs.num-cores }} --l1 $L1_value --defaultMemLevel=${{ inputs.default-memory-level }} ${{ inputs.double-buffer && '--doublebuffer' || '' }} --memAllocStrategy=${{ inputs.memory-allocation-strategy }} --searchStrategy=${{ inputs.search-strategy }}
77-
done
78-
done
65+
# Determine buffer mode and memory level for pytest markers
66+
BUFFER_MARKER="${{ inputs.double-buffer && 'doublebuffer' || 'singlebuffer' }}"
67+
MEMLEVEL_MARKER="${{ inputs.default-memory-level == 'L3' && 'l3' || 'l2' }}"
68+
69+
# Run all kernel tests matching the buffer and memory level configuration
70+
echo "Running Siracusa tiled kernel tests (${MEMLEVEL_MARKER}, ${BUFFER_MARKER})"
71+
pytest test_platforms.py::test_siracusa_tiled_kernels_${MEMLEVEL_MARKER}_${BUFFER_MARKER} -v
7972
shell: bash

.github/workflows/_runner-siracusa-tiled.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,20 @@ jobs:
7474
cd DeeployTest
7575
mkdir -p /app/.ccache
7676
export CCACHE_DIR=/app/.ccache
77-
python testRunner_tiled_siracusa.py -t Tests/${{ inputs.test-name }} --cores=${{ inputs.num-cores }} --l1 ${{ matrix.L1 }} --defaultMemLevel=${{ inputs.default-memory-level }} ${{ inputs.double-buffer && '--doublebuffer' || '' }} --memAllocStrategy=${{ inputs.memory-allocation-strategy }} --searchStrategy=${{ inputs.search-strategy }}
77+
78+
# Determine buffer mode and memory level for pytest markers
79+
BUFFER_MARKER="${{ inputs.double-buffer && 'doublebuffer' || 'singlebuffer' }}"
80+
MEMLEVEL_MARKER="${{ inputs.default-memory-level == 'L3' && 'l3' || 'l2' }}"
81+
82+
# Determine if it's a kernel or model test
83+
TEST_TYPE="kernels"
84+
if [[ "${{ inputs.test-name }}" == *"/"* ]] || [[ "${{ inputs.test-name }}" =~ (simpleRegression|MobileNet|Attention|Transformer|Llama|MLPerf|CCT|TinyViT) ]]; then
85+
TEST_TYPE="models"
86+
fi
87+
88+
# Build test ID pattern: testname-L1value-config
89+
TEST_PATTERN="${{ inputs.test-name }}-${{ matrix.L1 }}-${{ inputs.default-memory-level }}-${BUFFER_MARKER}"
90+
91+
# Run pytest with specific test matching the pattern
92+
pytest test_platforms.py::test_siracusa_tiled_${TEST_TYPE}_${MEMLEVEL_MARKER}_${BUFFER_MARKER} -k "$TEST_PATTERN" -v
7893
shell: bash

.github/workflows/_runner-siracusa.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ name: _runner-siracusa
1414
docker-image:
1515
required: true
1616
type: string
17-
test-names:
17+
test-type:
1818
required: true
1919
type: string
20-
num-cores:
21-
required: true
22-
type: number
20+
description: "Type of tests to run: kernels or models"
2321

2422
jobs:
2523
test-runner-siracusa:
@@ -41,14 +39,10 @@ jobs:
4139
key: ccache-ci
4240
- name: Run Test
4341
run: |
44-
testNames="${{ inputs.test-names }}"
4542
cd DeeployTest
4643
mkdir -p /app/.ccache
4744
export CCACHE_DIR=/app/.ccache
48-
echo "$testNames" | while IFS= read -r testName; do
49-
if [[ -n "$testName" ]]; then
50-
echo "Running test: $testName"
51-
python testRunner_siracusa.py -t Tests/$testName --cores=${{ inputs.num-cores }}
52-
fi
53-
done
45+
46+
# Run tests using pytest markers
47+
pytest test_platforms.py::test_siracusa_${{ inputs.test-type }} -v
5448
shell: bash

0 commit comments

Comments
 (0)