Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
75ccfee
FlatAttention test fixes. Some compiler fixes that may need to be rev…
diaconuccalin Mar 6, 2026
d0b5bac
Apply remaining fixes to flatatt
diaconuccalin Mar 6, 2026
f36888d
Made the attention test generation dynamic (the user can now specify …
diaconuccalin Mar 6, 2026
05981cb
Added flat attention test without data tiling. Added clang format fil…
diaconuccalin Mar 9, 2026
48e94c5
Reverted Claude erronous toolchain adaptations. Switched to float16al…
diaconuccalin Mar 18, 2026
b363771
Updated gvsoc_init make flow. Updated testing pipeline
diaconuccalin Mar 19, 2026
85948a4
Added GEMM chain test and refactored tile config generation
diaconuccalin Apr 1, 2026
b7d4bd3
Reorganize GEMM test into via_l2 subdirectory
diaconuccalin Apr 2, 2026
251f00f
Decouple GEMM test from attention_utils.h; deactivate flatatt
diaconuccalin Apr 2, 2026
bde9498
Rework flatatt test: embed golden data, update attention/EU utils
diaconuccalin Apr 2, 2026
8c3a539
Update toolchain paths and CI to use GCC_PULP; add seed param
diaconuccalin Apr 2, 2026
ebcc0bb
Reorganize gemm test: rename dir, move gen_golden and gemm_utils, add…
diaconuccalin Apr 6, 2026
7ad4177
Add via_l2_interlaced GEMM test with prefetched M5
diaconuccalin Apr 6, 2026
d1b8551
Add interlaced GEMM test step to CI workflow
diaconuccalin Apr 6, 2026
7327dd3
Restructure gemm_comm: via_l2_* → via_L2/{naive,interlaced}
diaconuccalin Apr 6, 2026
6fac2c6
Add via_L1/naive GEMM test with direct L1-to-L1 communication
diaconuccalin Apr 6, 2026
b401509
Add via_L1/interlaced GEMM test with L1 communication and M5 prefetch
diaconuccalin Apr 6, 2026
1e06750
Add L1 FIFO communication utility header
diaconuccalin Apr 8, 2026
83eb769
Rework L1 FIFO to lock-free slot array and add FIFO GEMM test
diaconuccalin Apr 10, 2026
55d58b5
Switch FIFO GEMM test to iDMA-based push with fractional batching
diaconuccalin Apr 10, 2026
f7c8ebd
Small fixes
diaconuccalin Apr 11, 2026
e8d7eaa
Implement incremental K-dimension accumulation for GEMM3
diaconuccalin Apr 11, 2026
46ab793
Post-rebase cleanup
diaconuccalin Apr 27, 2026
eed1f1e
Migrate CI to gemm_comm/ structure and add FIFO CI job
diaconuccalin Apr 29, 2026
d64ead3
CI pipeline fix
diaconuccalin Apr 29, 2026
7eaee67
Skip gemm_comm tests in CI via BUILD_NON_GITLAB_TESTS flag
diaconuccalin Apr 29, 2026
9e81a78
Added double buffering to FIFO test GEMM 1 and GEMM 2
diaconuccalin Apr 29, 2026
f028b48
Format fix
diaconuccalin Apr 29, 2026
dc3da0a
Temporary quickfix for profiling. Test renaming
diaconuccalin May 5, 2026
bd98a3f
Add per-tile cycle-count breakdown to FIFO GEMM test
diaconuccalin May 7, 2026
2147f10
Add preamble cycle counter and debug-print variant for FIFO GEMM test
diaconuccalin May 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
376 changes: 376 additions & 0 deletions .github/workflows/gemm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,379 @@ jobs:
else
echo "PASS: 0 errors"
fi

gemm-interlaced:
name: GEMM interlaced [8x8 mesh]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential python3-pip

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Install Python dependencies
run: |
pip install .
pip install torch --index-url https://download.pytorch.org/whl/cpu

- name: Cache RISC-V toolchain
id: cache-riscv
uses: actions/cache@v4
with:
path: ~/riscv
key: pulp-riscv-gcc-v1.0.16

- name: Install PULP RISC-V toolchain
if: steps.cache-riscv.outputs.cache-hit != 'true'
run: |
wget -q https://github.com/pulp-platform/pulp-riscv-gnu-toolchain/releases/download/v1.0.16/v1.0.16-pulp-riscv-gcc-ubuntu-18.tar.bz2 -O /tmp/riscv-toolchain.tar.bz2
mkdir -p ~/riscv
tar -xjf /tmp/riscv-toolchain.tar.bz2 -C ~/riscv --strip-components=1
rm /tmp/riscv-toolchain.tar.bz2

- name: Add toolchain to PATH
run: echo "$HOME/riscv/bin" >> "$GITHUB_PATH"

- name: Verify toolchain
run: riscv32-unknown-elf-gcc --version

- name: Cache GVSoC
id: cache-gvsoc
uses: actions/cache@v4
with:
path: gvsoc
key: gvsoc-v1-tiles-8
restore-keys: |
gvsoc-v1-tiles-
gvsoc-v1-

- name: Clone GVSoC
if: steps.cache-gvsoc.outputs.cache-hit != 'true'
run: |
if [ ! -d "gvsoc" ]; then
git config --global url."https://github.com/".insteadOf "git@github.com:"
make gvsoc_init
fi

- name: Install GVSoC Python dependencies
run: |
pip install -r gvsoc/core/requirements.txt
pip install -r gvsoc/requirements.txt
pip install -r gvsoc/gvrun/requirements.txt

- name: Build GVSoC
run: make gvsoc tiles=8

- name: Generate golden data
run: bash scripts/gemm/gemm-gen.sh

- name: Build GEMM interlaced test
run: TILES=8 COMPILER=GCC_PULP bash scripts/gemm/gemm-build.sh

- name: Run GEMM interlaced test (8x8 mesh)
run: |
output=$(TILES=8 TEST_NAME=test_gemm_interlaced bash scripts/gemm/gemm-run.sh 2>&1) || true
result=$(echo "$output" | grep -E 'Errors:|Test complete' || true)
echo "$result"
errors=$(echo "$output" | grep -oP 'Errors:\s*\K[0-9]+' | head -1)
if [ -z "$errors" ]; then
echo "ERROR: Could not parse test output"
echo "Full output:"
echo "$output"
exit 1
elif [ "$errors" -gt 0 ]; then
echo "FAIL: $errors errors"
exit 1
else
echo "PASS: 0 errors"
fi

gemm-l1-naive:
name: GEMM L1 naive [8x8 mesh]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential python3-pip

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Install Python dependencies
run: |
pip install .
pip install torch --index-url https://download.pytorch.org/whl/cpu

- name: Cache RISC-V toolchain
id: cache-riscv
uses: actions/cache@v4
with:
path: ~/riscv
key: pulp-riscv-gcc-v1.0.16

- name: Install PULP RISC-V toolchain
if: steps.cache-riscv.outputs.cache-hit != 'true'
run: |
wget -q https://github.com/pulp-platform/pulp-riscv-gnu-toolchain/releases/download/v1.0.16/v1.0.16-pulp-riscv-gcc-ubuntu-18.tar.bz2 -O /tmp/riscv-toolchain.tar.bz2
mkdir -p ~/riscv
tar -xjf /tmp/riscv-toolchain.tar.bz2 -C ~/riscv --strip-components=1
rm /tmp/riscv-toolchain.tar.bz2

- name: Add toolchain to PATH
run: echo "$HOME/riscv/bin" >> "$GITHUB_PATH"

- name: Verify toolchain
run: riscv32-unknown-elf-gcc --version

- name: Cache GVSoC
id: cache-gvsoc
uses: actions/cache@v4
with:
path: gvsoc
key: gvsoc-v1-tiles-8
restore-keys: |
gvsoc-v1-tiles-
gvsoc-v1-

- name: Clone GVSoC
if: steps.cache-gvsoc.outputs.cache-hit != 'true'
run: |
if [ ! -d "gvsoc" ]; then
git config --global url."https://github.com/".insteadOf "git@github.com:"
make gvsoc_init
fi

- name: Install GVSoC Python dependencies
run: |
pip install -r gvsoc/core/requirements.txt
pip install -r gvsoc/requirements.txt
pip install -r gvsoc/gvrun/requirements.txt

- name: Build GVSoC
run: make gvsoc tiles=8

- name: Generate golden data
run: bash scripts/gemm/gemm-gen.sh

- name: Build GEMM L1 naive test
run: TILES=8 COMPILER=GCC_PULP bash scripts/gemm/gemm-build.sh

- name: Run GEMM L1 naive test (8x8 mesh)
run: |
output=$(TILES=8 TEST_NAME=test_gemm_l1_naive bash scripts/gemm/gemm-run.sh 2>&1) || true
result=$(echo "$output" | grep -E 'Errors:|Test complete' || true)
echo "$result"
errors=$(echo "$output" | grep -oP 'Errors:\s*\K[0-9]+' | head -1)
if [ -z "$errors" ]; then
echo "ERROR: Could not parse test output"
echo "Full output:"
echo "$output"
exit 1
elif [ "$errors" -gt 0 ]; then
echo "FAIL: $errors errors"
exit 1
else
echo "PASS: 0 errors"
fi

gemm-l1-interlaced:
name: GEMM L1 interlaced [8x8 mesh]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential python3-pip

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Install Python dependencies
run: |
pip install .
pip install torch --index-url https://download.pytorch.org/whl/cpu

- name: Cache RISC-V toolchain
id: cache-riscv
uses: actions/cache@v4
with:
path: ~/riscv
key: pulp-riscv-gcc-v1.0.16

- name: Install PULP RISC-V toolchain
if: steps.cache-riscv.outputs.cache-hit != 'true'
run: |
wget -q https://github.com/pulp-platform/pulp-riscv-gnu-toolchain/releases/download/v1.0.16/v1.0.16-pulp-riscv-gcc-ubuntu-18.tar.bz2 -O /tmp/riscv-toolchain.tar.bz2
mkdir -p ~/riscv
tar -xjf /tmp/riscv-toolchain.tar.bz2 -C ~/riscv --strip-components=1
rm /tmp/riscv-toolchain.tar.bz2

- name: Add toolchain to PATH
run: echo "$HOME/riscv/bin" >> "$GITHUB_PATH"

- name: Verify toolchain
run: riscv32-unknown-elf-gcc --version

- name: Cache GVSoC
id: cache-gvsoc
uses: actions/cache@v4
with:
path: gvsoc
key: gvsoc-v1-tiles-8
restore-keys: |
gvsoc-v1-tiles-
gvsoc-v1-

- name: Clone GVSoC
if: steps.cache-gvsoc.outputs.cache-hit != 'true'
run: |
if [ ! -d "gvsoc" ]; then
git config --global url."https://github.com/".insteadOf "git@github.com:"
make gvsoc_init
fi

- name: Install GVSoC Python dependencies
run: |
pip install -r gvsoc/core/requirements.txt
pip install -r gvsoc/requirements.txt
pip install -r gvsoc/gvrun/requirements.txt

- name: Build GVSoC
run: make gvsoc tiles=8

- name: Generate golden data
run: bash scripts/gemm/gemm-gen.sh

- name: Build GEMM L1 interlaced test
run: TILES=8 COMPILER=GCC_PULP bash scripts/gemm/gemm-build.sh

- name: Run GEMM L1 interlaced test (8x8 mesh)
run: |
output=$(TILES=8 TEST_NAME=test_gemm_l1_interlaced bash scripts/gemm/gemm-run.sh 2>&1) || true
result=$(echo "$output" | grep -E 'Errors:|Test complete' || true)
echo "$result"
errors=$(echo "$output" | grep -oP 'Errors:\s*\K[0-9]+' | head -1)
if [ -z "$errors" ]; then
echo "ERROR: Could not parse test output"
echo "Full output:"
echo "$output"
exit 1
elif [ "$errors" -gt 0 ]; then
echo "FAIL: $errors errors"
exit 1
else
echo "PASS: 0 errors"
fi

gemm-fifo:
name: GEMM FIFO [8x8 mesh]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential python3-pip

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Install Python dependencies
run: |
pip install .
pip install torch --index-url https://download.pytorch.org/whl/cpu

- name: Cache RISC-V toolchain
id: cache-riscv
uses: actions/cache@v4
with:
path: ~/riscv
key: pulp-riscv-gcc-v1.0.16

- name: Install PULP RISC-V toolchain
if: steps.cache-riscv.outputs.cache-hit != 'true'
run: |
wget -q https://github.com/pulp-platform/pulp-riscv-gnu-toolchain/releases/download/v1.0.16/v1.0.16-pulp-riscv-gcc-ubuntu-18.tar.bz2 -O /tmp/riscv-toolchain.tar.bz2
mkdir -p ~/riscv
tar -xjf /tmp/riscv-toolchain.tar.bz2 -C ~/riscv --strip-components=1
rm /tmp/riscv-toolchain.tar.bz2

- name: Add toolchain to PATH
run: echo "$HOME/riscv/bin" >> "$GITHUB_PATH"

- name: Verify toolchain
run: riscv32-unknown-elf-gcc --version

- name: Cache GVSoC
id: cache-gvsoc
uses: actions/cache@v4
with:
path: gvsoc
key: gvsoc-v1-tiles-8
restore-keys: |
gvsoc-v1-tiles-
gvsoc-v1-

- name: Clone GVSoC
if: steps.cache-gvsoc.outputs.cache-hit != 'true'
run: |
if [ ! -d "gvsoc" ]; then
git config --global url."https://github.com/".insteadOf "git@github.com:"
make gvsoc_init
fi

- name: Install GVSoC Python dependencies
run: |
pip install -r gvsoc/core/requirements.txt
pip install -r gvsoc/requirements.txt
pip install -r gvsoc/gvrun/requirements.txt

- name: Build GVSoC
run: make gvsoc tiles=8

- name: Generate golden data
run: bash scripts/gemm/gemm-gen.sh

- name: Build GEMM FIFO test
run: TILES=8 COMPILER=GCC_PULP bash scripts/gemm/gemm-build.sh

- name: Run GEMM FIFO test (8x8 mesh)
run: |
output=$(TILES=8 TEST_NAME=test_gemm_fifo bash scripts/gemm/gemm-run.sh 2>&1) || true
result=$(echo "$output" | grep -E 'Errors:|Test complete' || true)
echo "$result"
errors=$(echo "$output" | grep -oP 'Errors:\s*\K[0-9]+' | head -1)
if [ -z "$errors" ]; then
echo "ERROR: Could not parse test output"
echo "Full output:"
echo "$output"
exit 1
elif [ "$errors" -gt 0 ]; then
echo "FAIL: $errors errors"
exit 1
else
echo "PASS: 0 errors"
fi
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ regression_output*
scripts/wave.do

# Generated test inputs
tests/magia/mesh/gemm/*/include/*
tests/magia/mesh/gemm**/include/*

# Editor
.vscode/
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ magia_v2_tiles_1:
.build:
extends: [.base, .export_path]
script:
- make clean build tiles=${tiles} target_platform=${target_platform} compiler=${compiler}
- make clean build tiles=${tiles} target_platform=${target_platform} compiler=${compiler} build_non_gitlab_tests=0
artifacts:
paths: [ "build", "targets/${target_platform}/include/addr_map/tile_addr_map.h" ]

Expand Down
Loading
Loading