Skip to content

Commit

Permalink
fix nsnet kernel examples
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilySillars committed Nov 13, 2024
1 parent 94a9925 commit 125b7d2
Show file tree
Hide file tree
Showing 12 changed files with 435 additions and 78 deletions.
38 changes: 13 additions & 25 deletions tiling-nsnet/dispatch_0_matmul_transpose_b_1x400x161_f64.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ outs(%8 : tensor<1x400xf64>) -> tensor<1x400xf64>
```
matmul_transpose_b (I : tensor<1x161xf64, W : tensor<400x161xf64>, O : tensor<1x400xf64>) {
for a in [0, 1)
for b in [0, 161)
for c in [0, 400)
O[a][b]+=I[a][c]*transpose(W)[b][c]
for b in [0, 400)
for c in [0, 161)
O[a][b]+=I[a][c]*W[b][c]
}
```

Expand All @@ -29,7 +29,7 @@ matmul_transpose_b (I : tensor<1x161xf64, W : tensor<400x161xf64>, O : tensor<1x
equation: O[a][b]+=I[a][c]*W[b][c]
dimension_relations: []
loop_dims: [A,B,C]
loop_sizes: [1, 161, 400]
loop_sizes: [1, 400, 161]
operand_precision:
W: 64
I: 64
Expand All @@ -42,39 +42,34 @@ matmul_transpose_b (I : tensor<1x161xf64, W : tensor<400x161xf64>, O : tensor<1x

## ZigZag Run

Commands run:
Command Run:

```
python main_zigzag_integration.py --model=zigzag/inputs/workload/dispatch_0_matmul_transpose_b_1x400x161_f64.yaml --mapping=zigzag/inputs/mapping/empty-mapping.yaml --accelerator=zigzag/inputs/hardware/snitch-cluster-only-floats-no-ssrs.yaml
```

```
cat outputs/snitch-cluster-only-floats-no-ssrs-dispatch_0_matmul_transpose_b_1x400x161_f64/loop_ordering.txt
sh tiling-nsnet.sh dispatch_0_matmul_transpose_b_1x400x161_f64
```

Output:

```
Loop ordering for dispatch_0_matmul_transpose_b_1x400x161_f64
===========================================================================================
Temporal Loops O W I
===========================================================================================
for B in [0, 7): l1 l1 l1
for B in [0, 2): l1 l1 l1
-------------------------------------------------------------------------------------------
for C in [0, 5): rf_f0_thru_f31 l1 l1
for C in [0, 7): rf_f0_thru_f31 l1 l1
-------------------------------------------------------------------------------------------
for C in [0, 5): rf_f0_thru_f31 l1 l1
for C in [0, 23): rf_f0_thru_f31 l1 l1
-------------------------------------------------------------------------------------------
for C in [0, 2): rf_f0_thru_f31 l1 rf_f0_thru_f31
for B in [0, 5): rf_f0_thru_f31 l1 rf_f0_thru_f31
-------------------------------------------------------------------------------------------
for B in [0, 23): rf_f0_thru_f31 l1 rf_f0_thru_f31
for B in [0, 5): rf_f0_thru_f31 rf_f0_thru_f31 rf_f0_thru_f31
-------------------------------------------------------------------------------------------
===========================================================================================
Spatial Loops
===========================================================================================
parfor C in [0, 8):
parfor B in [0, 8):
-------------------------------------------------------------------------------------------
parfor A in [0, 1):
parfor C in [0, 1):
-------------------------------------------------------------------------------------------
```

Expand All @@ -84,13 +79,6 @@ Since everything fits in L1, don't tile at all?!

No loop interchange either?!

```
l1Tiles[0] = 0;
l1Tiles[1] = 0;
l1Tiles[2] = 0;
l1Interchange = {0, 1, 2};
```

## JSON Summary

```
Expand Down
Loading

0 comments on commit 125b7d2

Please sign in to comment.