Skip to content

Commit

Permalink
experimental_offload: Add atax, correlation and covariance
Browse files Browse the repository at this point in the history
  • Loading branch information
colluca committed Apr 11, 2024
1 parent 4809483 commit 93fb59f
Show file tree
Hide file tree
Showing 14 changed files with 654 additions and 54 deletions.
8 changes: 8 additions & 0 deletions target/sim/experiments/offload/data/atax.json.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright 2024 ETH Zurich and University of Bologna.

Check failure on line 1 in target/sim/experiments/offload/data/atax.json.tpl

View workflow job for this annotation

GitHub Actions / Check License headers

FAILED: File does not start with comment
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

{
M: 16,
N: ${N}
}
8 changes: 8 additions & 0 deletions target/sim/experiments/offload/data/correlation.json.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright 2024 ETH Zurich and University of Bologna.

Check failure on line 1 in target/sim/experiments/offload/data/correlation.json.tpl

View workflow job for this annotation

GitHub Actions / Check License headers

FAILED: File does not start with comment
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

{
M: 16,
N: 8
}
8 changes: 8 additions & 0 deletions target/sim/experiments/offload/data/covariance.json.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright 2024 ETH Zurich and University of Bologna.

Check failure on line 1 in target/sim/experiments/offload/data/covariance.json.tpl

View workflow job for this annotation

GitHub Actions / Check License headers

FAILED: File does not start with comment
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

{
M: 16,
N: 8
}
109 changes: 109 additions & 0 deletions target/sim/experiments/offload/roi/atax.json.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
[

Check failure on line 1 in target/sim/experiments/offload/roi/atax.json.tpl

View workflow job for this annotation

GitHub Actions / Check License headers

FAILED: File does not start with comment
// CVA6 core
{
"thread": "hart_0",
"roi": [
// Iteration 1
{"idx": 1, "label": "prepare data"},
{"idx": 2, "label": "send interrupt"},
{"idx": 4, "label": "clr interrupt"},
// Iteration 2
{"idx": 5, "label": "prepare data"},
{"idx": 6, "label": "send interrupt"},
{"idx": 8, "label": "clr interrupt"}
]
},

// Snitch clusters
% for i in range(0, nr_clusters):

// Compute cores
% for j in range(0, 8):
{
"thread": "${f'hart_{1 + 9*i + j}'}",
"roi": [
// Iteration 1
{"idx": 1, "label": "clr interrupt"},
{"idx": 2, "label": "job setup"},
{"idx": 3, "label": "barrier"},
{"idx": 4, "label": "Ax"},
{"idx": 5, "label": "barrier"},
{"idx": 6, "label": "AtAx"},
{"idx": 7, "label": "barrier"},
// Iteration 2
{"idx": 10, "label": "clr interrupt"},
{"idx": 11, "label": "job setup"},
{"idx": 12, "label": "barrier"},
{"idx": 13, "label": "Ax"},
{"idx": 14, "label": "barrier"},
{"idx": 15, "label": "AtAx"},
{"idx": 16, "label": "barrier"},
]
},
% endfor

// DMA cores
{
"thread": "${f'hart_{1 + 9*i + 8}'}",
"roi": [
// Iteration 1
{"idx": 1, "label": "clr interrupt"},
{"idx": 2, "label": "get job ptr"},
{"idx": 3, "label": "get job args"},
{"idx": 4, "label": "copy data in"},
{"idx": 5, "label": "barrier"},
{"idx": 6, "label": "copy data out"},
{"idx": 7, "label": "return"},
// Iteration 2
{"idx": 10, "label": "clr interrupt"},
{"idx": 11, "label": "get job ptr"},
{"idx": 12, "label": "get job args"},
{"idx": 13, "label": "copy data in"},
{"idx": 14, "label": "barrier"},
{"idx": 15, "label": "copy data out"},
{"idx": 16, "label": "return"},
]
},

// DMA engine proper
% if i == 0 or multicast:
{
"thread": "${f'dma_{1 + 9*i + 8}'}",
"roi": [
// Iteration 1
{"idx": -10, "label": "A in"},
{"idx": -9, "label": "x in"},
{"idx": -8, "label": "y tile in"},
{"idx": -7, "label": "tmp in"},
{"idx": -6, "label": "y out"},
// Iteration 2
{"idx": -5, "label": "A in"},
{"idx": -4, "label": "x in"},
{"idx": -3, "label": "y tile in"},
{"idx": -2, "label": "tmp in"},
{"idx": -1, "label": "y out"},
]
},
% else:
{
"thread": "${f'dma_{1 + 9*i + 8}'}",
"roi": [
// Iteration 1
{"idx": -12, "label": "job info"},
{"idx": -11, "label": "A in"},
{"idx": -10, "label": "x in"},
{"idx": -9, "label": "y tile in"},
{"idx": -8, "label": "tmp in"},
{"idx": -7, "label": "y out"},
// Iteration 2
{"idx": -6, "label": "job info"},
{"idx": -5, "label": "A in"},
{"idx": -4, "label": "x in"},
{"idx": -3, "label": "y tile in"},
{"idx": -2, "label": "tmp in"},
{"idx": -1, "label": "y out"},
]
},
% endif
% endfor
]
106 changes: 106 additions & 0 deletions target/sim/experiments/offload/roi/correlation.json.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
[

Check failure on line 1 in target/sim/experiments/offload/roi/correlation.json.tpl

View workflow job for this annotation

GitHub Actions / Check License headers

FAILED: File does not start with comment
// CVA6 core
{
"thread": "hart_0",
"roi": [
// Iteration 1
{"idx": 1, "label": "prepare data"},
{"idx": 2, "label": "send interrupt"},
{"idx": 4, "label": "clr interrupt"},
// Iteration 2
{"idx": 5, "label": "prepare data"},
{"idx": 6, "label": "send interrupt"},
{"idx": 8, "label": "clr interrupt"}
]
},

// Snitch clusters
% for i in range(0, nr_clusters):

// Compute cores
% for j in range(0, 8):
{
"thread": "${f'hart_{1 + 9*i + j}'}",
"roi": [
## Only cluster 0 computes step 2
% if i == 0:
// Iteration 1
{"idx": 1, "label": "clr interrupt"},
{"idx": 2, "label": "job setup"},
{"idx": 3, "label": "barrier"},
{"idx": 4, "label": "compute step 1"},
{"idx": 5, "label": "barrier"},
{"idx": 6, "label": "compute step 2"},
{"idx": 7, "label": "barrier"},
// Iteration 2
{"idx": 10, "label": "clr interrupt"},
{"idx": 11, "label": "job setup"},
{"idx": 12, "label": "barrier"},
{"idx": 13, "label": "compute step 1"},
{"idx": 14, "label": "barrier"},
{"idx": 15, "label": "compute step 2"},
{"idx": 16, "label": "barrier"},
% else:
// Iteration 1
{"idx": 1, "label": "clr interrupt"},
{"idx": 2, "label": "job setup"},
{"idx": 3, "label": "barrier"},
{"idx": 4, "label": "compute step 1"},
{"idx": 5, "label": "barrier"},
// Iteration 2
{"idx": 8, "label": "clr interrupt"},
{"idx": 9, "label": "job setup"},
{"idx": 10, "label": "barrier"},
{"idx": 11, "label": "compute step 1"},
{"idx": 12, "label": "barrier"},
% endif
]
},
% endfor

// DMA cores
{
"thread": "${f'hart_{1 + 9*i + 8}'}",
"roi": [
## Cluster 0's DMA core aggregates the data from step 1
% if i == 0:
// Iteration 1
{"idx": 1, "label": "clr interrupt"},
{"idx": 2, "label": "get job ptr"},
{"idx": 3, "label": "get job args"},
{"idx": 4, "label": "copy data in"},
{"idx": 5, "label": "barrier"},
{"idx": 6, "label": "copy step1 data"},
{"idx": 7, "label": "barrier"},
{"idx": 8, "label": "copy data out"},
{"idx": 9, "label": "return"},
// Iteration 2
{"idx": 12, "label": "clr interrupt"},
{"idx": 13, "label": "get job ptr"},
{"idx": 14, "label": "get job args"},
{"idx": 15, "label": "copy data in"},
{"idx": 16, "label": "barrier"},
{"idx": 17, "label": "copy step1 data"},
{"idx": 18, "label": "barrier"},
{"idx": 19, "label": "copy data out"},
{"idx": 20, "label": "return"},
% else:
// Iteration 1
{"idx": 1, "label": "clr interrupt"},
{"idx": 2, "label": "get job ptr"},
{"idx": 3, "label": "get job args"},
{"idx": 4, "label": "copy data in"},
{"idx": 5, "label": "barrier"},
{"idx": 6, "label": "return"},
// Iteration 2
{"idx": 9, "label": "clr interrupt"},
{"idx": 10, "label": "get job ptr"},
{"idx": 11, "label": "get job args"},
{"idx": 12, "label": "copy data in"},
{"idx": 13, "label": "barrier"},
{"idx": 14, "label": "return"},
% endif
]
},
% endfor
]
106 changes: 106 additions & 0 deletions target/sim/experiments/offload/roi/covariance.json.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
[

Check failure on line 1 in target/sim/experiments/offload/roi/covariance.json.tpl

View workflow job for this annotation

GitHub Actions / Check License headers

FAILED: File does not start with comment
// CVA6 core
{
"thread": "hart_0",
"roi": [
// Iteration 1
{"idx": 1, "label": "prepare data"},
{"idx": 2, "label": "send interrupt"},
{"idx": 4, "label": "clr interrupt"},
// Iteration 2
{"idx": 5, "label": "prepare data"},
{"idx": 6, "label": "send interrupt"},
{"idx": 8, "label": "clr interrupt"}
]
},

// Snitch clusters
% for i in range(0, nr_clusters):

// Compute cores
% for j in range(0, 8):
{
"thread": "${f'hart_{1 + 9*i + j}'}",
"roi": [
## Only cluster 0 computes step 2
% if i == 0:
// Iteration 1
{"idx": 1, "label": "clr interrupt"},
{"idx": 2, "label": "job setup"},
{"idx": 3, "label": "barrier"},
{"idx": 4, "label": "compute step 1"},
{"idx": 5, "label": "barrier"},
{"idx": 6, "label": "compute step 2"},
{"idx": 7, "label": "barrier"},
// Iteration 2
{"idx": 10, "label": "clr interrupt"},
{"idx": 11, "label": "job setup"},
{"idx": 12, "label": "barrier"},
{"idx": 13, "label": "compute step 1"},
{"idx": 14, "label": "barrier"},
{"idx": 15, "label": "compute step 2"},
{"idx": 16, "label": "barrier"},
% else:
// Iteration 1
{"idx": 1, "label": "clr interrupt"},
{"idx": 2, "label": "job setup"},
{"idx": 3, "label": "barrier"},
{"idx": 4, "label": "compute step 1"},
{"idx": 5, "label": "barrier"},
// Iteration 2
{"idx": 8, "label": "clr interrupt"},
{"idx": 9, "label": "job setup"},
{"idx": 10, "label": "barrier"},
{"idx": 11, "label": "compute step 1"},
{"idx": 12, "label": "barrier"},
% endif
]
},
% endfor

// DMA cores
{
"thread": "${f'hart_{1 + 9*i + 8}'}",
"roi": [
## Cluster 0's DMA core aggregates the data from step 1
% if i == 0:
// Iteration 1
{"idx": 1, "label": "clr interrupt"},
{"idx": 2, "label": "get job ptr"},
{"idx": 3, "label": "get job args"},
{"idx": 4, "label": "copy data in"},
{"idx": 5, "label": "barrier"},
{"idx": 6, "label": "copy step1 data"},
{"idx": 7, "label": "barrier"},
{"idx": 8, "label": "copy data out"},
{"idx": 9, "label": "return"},
// Iteration 2
{"idx": 12, "label": "clr interrupt"},
{"idx": 13, "label": "get job ptr"},
{"idx": 14, "label": "get job args"},
{"idx": 15, "label": "copy data in"},
{"idx": 16, "label": "barrier"},
{"idx": 17, "label": "copy step1 data"},
{"idx": 18, "label": "barrier"},
{"idx": 19, "label": "copy data out"},
{"idx": 20, "label": "return"},
% else:
// Iteration 1
{"idx": 1, "label": "clr interrupt"},
{"idx": 2, "label": "get job ptr"},
{"idx": 3, "label": "get job args"},
{"idx": 4, "label": "copy data in"},
{"idx": 5, "label": "barrier"},
{"idx": 6, "label": "return"},
// Iteration 2
{"idx": 9, "label": "clr interrupt"},
{"idx": 10, "label": "get job ptr"},
{"idx": 11, "label": "get job args"},
{"idx": 12, "label": "copy data in"},
{"idx": 13, "label": "barrier"},
{"idx": 14, "label": "return"},
% endif
]
},
% endfor
]
Loading

0 comments on commit 93fb59f

Please sign in to comment.