Skip to content

Commit

Permalink
Merge branch 'main' into sasha/relu-snst
Browse files Browse the repository at this point in the history
  • Loading branch information
superlopuh committed Nov 3, 2023
2 parents 14de4e5 + c5b4929 commit a526d28
Show file tree
Hide file tree
Showing 11 changed files with 1,143 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-experiments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
run-experiments:
runs-on: ubuntu-latest
container: ghcr.io/nazavode/snitch-toolchain:2.3
container: ghcr.io/nazavode/snitch-toolchain:latest
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-kernels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
build-and-run-kernels:
runs-on: ubuntu-latest
container: ghcr.io/nazavode/snitch-toolchain:2.3
container: ghcr.io/nazavode/snitch-toolchain:latest
steps:
- uses: actions/checkout@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ a clone of this repo inside it at `/src`:

```shell
$ git clone https://github.com/opencompl/riscv-paper-experiments.git
$ docker run --rm -ti --volume $PWD/riscv-paper-experiments:/src ghcr.io/nazavode/snitch-toolchain:2.3 bash
$ docker run --rm -ti --volume $PWD/riscv-paper-experiments:/src ghcr.io/nazavode/snitch-toolchain:latest bash
```

Alternatively, the current flow can be performed with:

```shell
$ docker run --rm -ti --volume $PWD/riscv-paper-experiments:/src ghcr.io/nazavode/snitch-toolchain:2.3 /src/scripts/run.sh
$ docker run --rm -ti --volume $PWD/riscv-paper-experiments:/src ghcr.io/nazavode/snitch-toolchain:latest /src/scripts/run.sh
```

This builds the kernels, executes them with Verilator, process the traces from these runs and plots the results.
Expand Down
535 changes: 535 additions & 0 deletions alexnet/flow.mlir

Large diffs are not rendered by default.

335 changes: 335 additions & 0 deletions alexnet/input.mlir

Large diffs are not rendered by default.

243 changes: 243 additions & 0 deletions alexnet/iree.mlir

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions alexnet/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shark-turbine
torchvision
5 changes: 5 additions & 0 deletions alexnet/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Script that generated the mlir files in this folder

python test.py > iree.mlir
iree-compile --iree-input-type=torch --compile-to=input iree.mlir > input.mlir
iree-compile --iree-input-type=torch --compile-to=flow --iree-util-zero-fill-elided-attrs iree.mlir > flow.mlir
12 changes: 12 additions & 0 deletions alexnet/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import torch
import torch.nn as nn

import shark_turbine.aot as aot
from iree.compiler import compile_str

from torchvision.models import AlexNet

model = AlexNet()
example_x = torch.empty(64, 3, 224, 224)
exported = aot.export(model, example_x)
exported.print_readable()
9 changes: 6 additions & 3 deletions snitch/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM ghcr.io/pulp-platform/snitch_cluster@sha256:9978f9d0e3e6b7ad1b2c1f0eb628a113226e8443bc42ae8b4ddd3f34d9528e96 as builder

RUN git clone --recursive https://github.com/pulp-platform/snitch_cluster.git /src \
RUN git clone --recursive https://github.com/nazavode/snitch_cluster.git /src \
&& cd /src \
&& git reset --hard 772b86ae84ec0d5a6f1e755cb524ba0aae2cefc3 \
&& git checkout nazavode/xdsl-ci \
# verilator model
&& cd /src/target/snitch_cluster \
&& make bin/snitch_cluster.vlt \
&& make CFG_OVERRIDE=cfg/fdiv.hjson bin/snitch_cluster.vlt \
# spike-dasm
&& cd /src/target/snitch_cluster/work-vlt/riscv-isa-sim \
&& ./configure --prefix=/opt/snitch-spike \
Expand Down Expand Up @@ -98,3 +98,6 @@ deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-16 main\n" >> /etc/apt
&& apt-get -y install git \
# cleanup
&& rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/*

# Make our own python3.11 available for current $USER:
ENV PATH "/opt/python3.11/bin:${PATH}"

0 comments on commit a526d28

Please sign in to comment.