Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPEN: Snitch Cluster Tiling Support #22

Merged
merged 11 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/BuildDocker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
file: Container/Dockerfile
push: true
# JUNGVI: If you operate from a fork and want to build a new docker make sure to replace 'pulp-platform' by your uname.
tags: ghcr.io/pulp-platform/deeploy:main
tags: ghcr.io/tahaelbayad/deeploy:main
Victor-Jung marked this conversation as resolved.
Show resolved Hide resolved
51 changes: 43 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
build-deeploy:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
Victor-Jung marked this conversation as resolved.
Show resolved Hide resolved
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -94,7 +94,42 @@ jobs:
uses: ./.github/workflows/TestRunnerSnitch.yml
with:
test-names: |
Adder
iSoftmax
TestiNoNorm
TestAdderLarge
TestiSoftmaxLarge
testMatMul
testRQGEMM
TestRQAdd
testRQGEMMTransB

snitch-kernels-tiled-singlebuffer-L2:
uses: ./.github/workflows/TestRunnerTiledSnitch.yml
Victor-Jung marked this conversation as resolved.
Show resolved Hide resolved
with:
tests-config: |
[
{
"name": "TestiNoNorm",
"L1": [5000, 10000]
},
{
"name": "TestAdderLarge",
"L1": [5000, 10000]
},
{
"name": "TestiSoftmaxLarge",
"L1": [5000, 10000]
},
{
"name": "testRQGEMM",
"L1": [2000, 5000]
},
{
"name": "TestRQAdd",
"L1": [5000, 10000]
}
]

### Mempool Tests ###
mempool-kernels:
Expand Down Expand Up @@ -507,7 +542,7 @@ jobs:
deeploy-state-serialization:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -527,7 +562,7 @@ jobs:
deeploy-memory-level-extension:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -547,7 +582,7 @@ jobs:
deeploy-tiler-extension:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -571,7 +606,7 @@ jobs:
deeploy-memory-allocation-extension:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -593,7 +628,7 @@ jobs:
deeploy-typing:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -610,7 +645,7 @@ jobs:
deeploy-regex-matching:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -627,7 +662,7 @@ jobs:
linting:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerCortexM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test-runner-cortexm:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerGeneric.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test-runner-generic:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerMempool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test-runner-mempool:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerSiracusa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
test-runner-siracusa:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/TestRunnerSnitch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test-runner-snitch:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -26,7 +26,7 @@ jobs:
echo "$testNames" | while IFS= read -r testName; do
if [[ -n "$testName" ]]; then
echo "Running test: $testName"
python testRunner_snitch.py -t Tests/$testName --toolchain_install_dir /app/install/riscv-llvm/
python testRunner_snitch.py -t Tests/$testName --simulator=banshee --cores=9 --toolchain_install_dir /app/install/riscv-llvm/
fi
done
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerTiledSiracusa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
L1: ${{ fromJSON(inputs.L1) }}
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerTiledSiracusaSequential.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
test-runner-siracusa-tiled:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerTiledSiracusaWithNeureka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
L1: ${{ fromJSON(inputs.L1) }}
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
test-runner-siracusa-neureka-tiled:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/TestRunnerTiledSnitch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: TestRunnerTiledSnitch

on:
workflow_call:
inputs:
tests-config:
required: true
type: string

jobs:

test-runner-snitch-tiled:
runs-on: ubuntu-22.04
container:
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build Deeploy
run: pip install -e .
- name: Install jq
run: apt-get install -y jq
- name: Cache ccache
id: ccache-cache
uses: actions/cache@v4
with:
path: /app/.ccache
key: ${{ runner.os }}-ccache
- name: Run Tests
run: |
cd DeeployTest
echo '${{ inputs.tests-config }}' > tests.json
mkdir -p /app/.ccache
export CCACHE_DIR=/app/.ccache

jq -c '.[]' tests.json | while read test; do
testName=$(echo "$test" | jq -r '.name')
L1_values=$(echo "$test" | jq -r '.L1[]')
for L1_value in $L1_values; do
echo "Running test: $testName with L1: $L1_value"
python testRunner_tiled_snitch.py -t Tests/$testName --cores=9 --simulator=banshee --l1 $L1_value --defaultMemLevel=L2 --toolchain_install_dir /app/install/riscv-llvm/
Victor-Jung marked this conversation as resolved.
Show resolved Hide resolved
done
done
shell: bash

6 changes: 5 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
url = https://github.com/pulp-platform/pulp-nnx.git
[submodule "CMSIS-NN"]
path = TargetLibraries/CMSIS/third_party/CMSIS-NN
url = https://github.com/ARM-software/CMSIS-NN.git
url = https://github.com/ARM-software/CMSIS-NN.git
[submodule "TargetLibraries/Snitch/third_party/pulp-nn-mixed"]
path = TargetLibraries/Snitch/third_party/pulp-nn-mixed
url = https://github.com/Victor-Jung/pulp-nn-mixed.git
branch = deeploySnitchTarget
Victor-Jung marked this conversation as resolved.
Show resolved Hide resolved
19 changes: 18 additions & 1 deletion Deeploy/Targets/Generic/Layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import numpy as np

from Deeploy.DeeployTypes import NodeMapper, ONNXLayer, Shape
from Deeploy.DeeployTypes import NodeMapper, ONNXLayer, OperatorRepresentation, Shape


class ConcatLayer(ONNXLayer):
Expand Down Expand Up @@ -85,6 +85,23 @@ def __init__(self, maps: List[NodeMapper]):
super().__init__(maps)


class iNoNormLayer(ONNXLayer):

def __init__(self, maps: List[NodeMapper]):
super().__init__(maps)

def computeOps(self):
return self.mapper.parser.operatorRepresentation['size'] * 4 # 2 mul, 1 add, 1 right shift

def computeShapes(self, inputShapes: Shape, outputShapes: Shape, operatorRepresentation: OperatorRepresentation,
channels_first: bool) -> Tuple[Shape]:

# JUNGVI: Broadcast the weights and bias to have as many dimensions as the inputs
inputShapes[1] = [1] * (len(inputShapes[0]) - len(inputShapes[1])) + list(inputShapes[1])
inputShapes[2] = inputShapes[1]
return (inputShapes, outputShapes)


class RQSiGELULayer(iGELULayer):

def __init__(self, maps: List[NodeMapper]):
Expand Down
Loading