Artem Plastinkin commited on
Commit ·
1024868
1
Parent(s): c451aec
Update
Browse files- README.md +1 -1
- compile_config/RetinaNet_l2seg.json +312 -0
- int8/benchmarks/x5h_mwmx_npu_apm80_12core.yaml +39 -0
README.md
CHANGED
|
@@ -181,7 +181,7 @@ To run inference on Renesas R-Car X5H, you need:
|
|
| 181 |
## Download
|
| 182 |
|
| 183 |
```bash
|
| 184 |
-
|
| 185 |
```
|
| 186 |
|
| 187 |
## Inference
|
|
|
|
| 181 |
## Download
|
| 182 |
|
| 183 |
```bash
|
| 184 |
+
hf download Renesas/RetinaNet-R101-ONNX --repo-type=model --include "fp32/*"
|
| 185 |
```
|
| 186 |
|
| 187 |
## Inference
|
compile_config/RetinaNet_l2seg.json
ADDED
|
@@ -0,0 +1,312 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"segments": [
|
| 3 |
+
{
|
| 4 |
+
"name": "Segment_MP",
|
| 5 |
+
"inputs": [
|
| 6 |
+
"input"
|
| 7 |
+
],
|
| 8 |
+
"outputs": [
|
| 9 |
+
"740"
|
| 10 |
+
],
|
| 11 |
+
"n_buffer": 1
|
| 12 |
+
},
|
| 13 |
+
{
|
| 14 |
+
"name": "Segment_1",
|
| 15 |
+
"inputs": [
|
| 16 |
+
"740"
|
| 17 |
+
],
|
| 18 |
+
"outputs": [
|
| 19 |
+
"772"
|
| 20 |
+
],
|
| 21 |
+
"n_buffer": 1
|
| 22 |
+
},
|
| 23 |
+
{
|
| 24 |
+
"name": "Segment_merge_2_3_4",
|
| 25 |
+
"inputs": [
|
| 26 |
+
"772"
|
| 27 |
+
],
|
| 28 |
+
"outputs": [
|
| 29 |
+
"932"
|
| 30 |
+
],
|
| 31 |
+
"n_buffer": 1,
|
| 32 |
+
"tiling_info": {
|
| 33 |
+
"932": {
|
| 34 |
+
"l2_tile_shape": [
|
| 35 |
+
1,
|
| 36 |
+
30,
|
| 37 |
+
40,
|
| 38 |
+
1024
|
| 39 |
+
]
|
| 40 |
+
}
|
| 41 |
+
}
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
"name": "Segment_6",
|
| 45 |
+
"inputs": [
|
| 46 |
+
"932"
|
| 47 |
+
],
|
| 48 |
+
"outputs": [
|
| 49 |
+
"972"
|
| 50 |
+
],
|
| 51 |
+
"n_buffer": 1
|
| 52 |
+
},
|
| 53 |
+
{
|
| 54 |
+
"name": "Segment_7_8_9",
|
| 55 |
+
"inputs": [
|
| 56 |
+
"972"
|
| 57 |
+
],
|
| 58 |
+
"outputs": [
|
| 59 |
+
"1004"
|
| 60 |
+
],
|
| 61 |
+
"n_buffer": 1,
|
| 62 |
+
"tiling_info": {
|
| 63 |
+
"1004": {
|
| 64 |
+
"l2_tile_shape": [
|
| 65 |
+
1,
|
| 66 |
+
15,
|
| 67 |
+
20,
|
| 68 |
+
2048
|
| 69 |
+
]
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
},
|
| 73 |
+
{
|
| 74 |
+
"name": "Segment_10",
|
| 75 |
+
"inputs": [
|
| 76 |
+
"1004"
|
| 77 |
+
],
|
| 78 |
+
"outputs": [
|
| 79 |
+
"1005"
|
| 80 |
+
],
|
| 81 |
+
"n_buffer": 1
|
| 82 |
+
},
|
| 83 |
+
{
|
| 84 |
+
"name": "Segment_11",
|
| 85 |
+
"inputs": [
|
| 86 |
+
"1004"
|
| 87 |
+
],
|
| 88 |
+
"outputs": [
|
| 89 |
+
"1028"
|
| 90 |
+
],
|
| 91 |
+
"n_buffer": 1,
|
| 92 |
+
"tiling_info": {
|
| 93 |
+
"1028": {
|
| 94 |
+
"l2_tile_shape": [
|
| 95 |
+
1,
|
| 96 |
+
8,
|
| 97 |
+
10,
|
| 98 |
+
256
|
| 99 |
+
]
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
},
|
| 103 |
+
{
|
| 104 |
+
"name": "Segment_12_merge_resize_1",
|
| 105 |
+
"inputs": [
|
| 106 |
+
"740",
|
| 107 |
+
"1016"
|
| 108 |
+
],
|
| 109 |
+
"outputs": [
|
| 110 |
+
"1031"
|
| 111 |
+
],
|
| 112 |
+
"n_buffer": 1,
|
| 113 |
+
"tiling_info": {
|
| 114 |
+
"1031": {
|
| 115 |
+
"l2_tile_shape": [
|
| 116 |
+
1,
|
| 117 |
+
60,
|
| 118 |
+
80,
|
| 119 |
+
256
|
| 120 |
+
]
|
| 121 |
+
}
|
| 122 |
+
}
|
| 123 |
+
},
|
| 124 |
+
{
|
| 125 |
+
"name": "Segment_output1.0",
|
| 126 |
+
"inputs": [
|
| 127 |
+
"1031"
|
| 128 |
+
],
|
| 129 |
+
"outputs": [
|
| 130 |
+
"output1"
|
| 131 |
+
],
|
| 132 |
+
"n_buffer": 1
|
| 133 |
+
},
|
| 134 |
+
{
|
| 135 |
+
"name": "Segment_output2.0",
|
| 136 |
+
"inputs": [
|
| 137 |
+
"1032"
|
| 138 |
+
],
|
| 139 |
+
"outputs": [
|
| 140 |
+
"output2"
|
| 141 |
+
],
|
| 142 |
+
"n_buffer": 1
|
| 143 |
+
},
|
| 144 |
+
{
|
| 145 |
+
"name": "Segment_output3.0",
|
| 146 |
+
"inputs": [
|
| 147 |
+
"1033"
|
| 148 |
+
],
|
| 149 |
+
"outputs": [
|
| 150 |
+
"output3"
|
| 151 |
+
],
|
| 152 |
+
"n_buffer": 1
|
| 153 |
+
},
|
| 154 |
+
{
|
| 155 |
+
"name": "Segment_output4.0",
|
| 156 |
+
"inputs": [
|
| 157 |
+
"1028"
|
| 158 |
+
],
|
| 159 |
+
"outputs": [
|
| 160 |
+
"output4"
|
| 161 |
+
],
|
| 162 |
+
"n_buffer": 1
|
| 163 |
+
},
|
| 164 |
+
{
|
| 165 |
+
"name": "Segment_output5.0",
|
| 166 |
+
"inputs": [
|
| 167 |
+
"1030"
|
| 168 |
+
],
|
| 169 |
+
"outputs": [
|
| 170 |
+
"output5"
|
| 171 |
+
],
|
| 172 |
+
"n_buffer": 1
|
| 173 |
+
},
|
| 174 |
+
{
|
| 175 |
+
"name": "Segment_output6",
|
| 176 |
+
"inputs": [
|
| 177 |
+
"1031"
|
| 178 |
+
],
|
| 179 |
+
"outputs": [
|
| 180 |
+
"output6"
|
| 181 |
+
],
|
| 182 |
+
"n_buffer": 1
|
| 183 |
+
},
|
| 184 |
+
{
|
| 185 |
+
"name": "Segment_output7",
|
| 186 |
+
"inputs": [
|
| 187 |
+
"1032"
|
| 188 |
+
],
|
| 189 |
+
"outputs": [
|
| 190 |
+
"output7"
|
| 191 |
+
],
|
| 192 |
+
"n_buffer": 1
|
| 193 |
+
},
|
| 194 |
+
{
|
| 195 |
+
"name": "Segment_output8",
|
| 196 |
+
"inputs": [
|
| 197 |
+
"1033"
|
| 198 |
+
],
|
| 199 |
+
"outputs": [
|
| 200 |
+
"output8"
|
| 201 |
+
],
|
| 202 |
+
"n_buffer": 1
|
| 203 |
+
},
|
| 204 |
+
{
|
| 205 |
+
"name": "Segment_output9",
|
| 206 |
+
"inputs": [
|
| 207 |
+
"1028"
|
| 208 |
+
],
|
| 209 |
+
"outputs": [
|
| 210 |
+
"output9"
|
| 211 |
+
],
|
| 212 |
+
"n_buffer": 1
|
| 213 |
+
},
|
| 214 |
+
{
|
| 215 |
+
"name": "Segment_output10",
|
| 216 |
+
"inputs": [
|
| 217 |
+
"1030"
|
| 218 |
+
],
|
| 219 |
+
"outputs": [
|
| 220 |
+
"output10"
|
| 221 |
+
],
|
| 222 |
+
"n_buffer": 1
|
| 223 |
+
},
|
| 224 |
+
{
|
| 225 |
+
"name": "seg_33_merge_resize_0",
|
| 226 |
+
"inputs": [
|
| 227 |
+
"972",
|
| 228 |
+
"1005"
|
| 229 |
+
],
|
| 230 |
+
"outputs": [
|
| 231 |
+
"1016"
|
| 232 |
+
],
|
| 233 |
+
"n_buffer": 1,
|
| 234 |
+
"tiling_info": {
|
| 235 |
+
"1016": {
|
| 236 |
+
"l2_tile_shape": [
|
| 237 |
+
1,
|
| 238 |
+
30,
|
| 239 |
+
40,
|
| 240 |
+
256
|
| 241 |
+
]
|
| 242 |
+
}
|
| 243 |
+
}
|
| 244 |
+
}
|
| 245 |
+
],
|
| 246 |
+
|
| 247 |
+
"layer_groups": [
|
| 248 |
+
{
|
| 249 |
+
"name": "LayerGroup_0",
|
| 250 |
+
"inputs": [
|
| 251 |
+
"666"
|
| 252 |
+
],
|
| 253 |
+
"outputs": [
|
| 254 |
+
"673"
|
| 255 |
+
]
|
| 256 |
+
},
|
| 257 |
+
{
|
| 258 |
+
"name": "LayerGroup_1",
|
| 259 |
+
"inputs": [
|
| 260 |
+
"678"
|
| 261 |
+
],
|
| 262 |
+
"outputs": [
|
| 263 |
+
"688"
|
| 264 |
+
]
|
| 265 |
+
},
|
| 266 |
+
{
|
| 267 |
+
"name": "LayerGroup_2",
|
| 268 |
+
"inputs": [
|
| 269 |
+
"688"
|
| 270 |
+
],
|
| 271 |
+
"outputs": [
|
| 272 |
+
"698"
|
| 273 |
+
]
|
| 274 |
+
},
|
| 275 |
+
{
|
| 276 |
+
"name": "LayerGroup_3",
|
| 277 |
+
"inputs": [
|
| 278 |
+
"698"
|
| 279 |
+
],
|
| 280 |
+
"outputs": [
|
| 281 |
+
"705"
|
| 282 |
+
]
|
| 283 |
+
},
|
| 284 |
+
{
|
| 285 |
+
"name": "LayerGroup_4",
|
| 286 |
+
"inputs": [
|
| 287 |
+
"710"
|
| 288 |
+
],
|
| 289 |
+
"outputs": [
|
| 290 |
+
"720"
|
| 291 |
+
]
|
| 292 |
+
},
|
| 293 |
+
{
|
| 294 |
+
"name": "LayerGroup_5",
|
| 295 |
+
"inputs": [
|
| 296 |
+
"720"
|
| 297 |
+
],
|
| 298 |
+
"outputs": [
|
| 299 |
+
"730"
|
| 300 |
+
]
|
| 301 |
+
},
|
| 302 |
+
{
|
| 303 |
+
"name": "LayerGroup_6",
|
| 304 |
+
"inputs": [
|
| 305 |
+
"730"
|
| 306 |
+
],
|
| 307 |
+
"outputs": [
|
| 308 |
+
"740"
|
| 309 |
+
]
|
| 310 |
+
}
|
| 311 |
+
]
|
| 312 |
+
}
|
int8/benchmarks/x5h_mwmx_npu_apm80_12core.yaml
CHANGED
|
@@ -40,3 +40,42 @@ memory:
|
|
| 40 |
|
| 41 |
power:
|
| 42 |
avg_w: null
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
power:
|
| 42 |
avg_w: null
|
| 43 |
+
|
| 44 |
+
# Exact commands verified against the NNAC "Getting Started" chapter, plus the
|
| 45 |
+
# network_configuration block verified against the internal model_zoo compile
|
| 46 |
+
# config for this model's 12-core slice (see
|
| 47 |
+
# compile_config/RetinaNet_l2seg.json). Rendered by the AI-Dashboard in place
|
| 48 |
+
# of the generic placeholder flow — see downloadRunHTML() / parse_reproduce().
|
| 49 |
+
reproduce:
|
| 50 |
+
steps:
|
| 51 |
+
- title: Download the ONNX model and compile config
|
| 52 |
+
command: hf download Renesas/RetinaNet-R101-ONNX --repo-type=model --include "fp32/*" --include "compile_config/*"
|
| 53 |
+
- title: Configure the network for the 12-core build
|
| 54 |
+
command: |
|
| 55 |
+
cat >> ${WORKDIR}/nnac_config/config.yaml << 'EOF'
|
| 56 |
+
network_configuration:
|
| 57 |
+
retinanet_9:
|
| 58 |
+
optimization_options:
|
| 59 |
+
- -segmentation_json ./compile_config/RetinaNet_l2seg.json
|
| 60 |
+
- -enable_dma_fusion
|
| 61 |
+
- -enable_stu_multi_channel
|
| 62 |
+
- -stu_multi_channel_config 0x15212420
|
| 63 |
+
- -stu_weight
|
| 64 |
+
- -distributed_coef_stu
|
| 65 |
+
EOF
|
| 66 |
+
# If config.yaml already has a network_configuration: key (e.g. from a
|
| 67 |
+
# previous model), merge this block into it instead of appending a duplicate key.
|
| 68 |
+
- title: Compile with the NNAC toolchain (INT8 auto-cast from the FP32 graph)
|
| 69 |
+
command: |
|
| 70 |
+
python3 nnac_frontend/legalize.py -d binary/nnx ./fp32/retinanet-9.onnx
|
| 71 |
+
- title: Set up the R-Car X5H board
|
| 72 |
+
command: Configure the board per the AI Compiler (NNAC) "Getting Started" guide, section 3.4 (host TFTP/NFS setup, bootloader flashing, U-Boot, Linux boot, login) -- exact steps depend on your board/network setup.
|
| 73 |
+
- title: Copy the compiled artifact to the board
|
| 74 |
+
command: Copy ${WORKDIR}/binary/nnx to the board -- method may vary (NFS mount, scp, USB, etc.).
|
| 75 |
+
- title: Run on R-Car X5H (single NPU cluster, 12 AI cores)
|
| 76 |
+
command: |
|
| 77 |
+
cd binary
|
| 78 |
+
./host_app ./arc_prog_npus ./nnx/retinanet-9
|
| 79 |
+
notes: >-
|
| 80 |
+
hash[n] = 0x...(OK) means the run's output matches the reference hash in
|
| 81 |
+
hash.txt; latency is the NPX execution time reported in cycles and ms.
|