artemPlastinkin commited on
Commit
f2763e6
·
verified ·
1 Parent(s): eb7ce34

Initial upload of EfficientNet-B2-ONNX

Browse files
.metadata.yaml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ model:
2
+ name: efficientnet-b2
3
+ display_name: EfficientNet-B2
4
+ upstream: timm/tf_efficientnet_b2.ns_jft_in1k
5
+ source:
6
+ kind: openmmlab
7
+ id: efficientnet_b2_3rdparty_ra_noisystudent_in1k
8
+ url: https://github.com/open-mmlab/mmpretrain/blob/main/configs/efficientnet/metafile.yml
9
+ note: >-
10
+ weights ported from the TF EfficientNet release
11
+
12
+ architecture:
13
+ family: efficientnet # lineage only — no version, no size
14
+ version: "v1"
15
+ variant: b2
16
+ dataset: imagenet-1k
17
+ input_resolution: 260x260
18
+ num_classes: 1000
19
+ modality:
20
+ - vision
21
+ parameters: 9.2M
22
+ parameters_source: published
23
+ parameters_note: >-
24
+ published EfficientNet-B2 figure (Tan & Le 2019)
25
+
26
+ format:
27
+ type: onnx
28
+ # opset: read it off the graph rather than guessing —
29
+ # onnx.load('model.onnx').opset_import[0].version
30
+ # NOTE: `version` is a GGUF-only field and must not be used for ONNX.
31
+
32
+ tasks:
33
+ - image-classification
README.md ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model:
4
+ - timm/tf_efficientnet_b2.ns_jft_in1k
5
+ pipeline_tag: image-classification
6
+ tags:
7
+ - image-classification
8
+ - computer-vision
9
+ - renesas
10
+ - x5h
11
+ - onnx
12
+ - efficientnet
13
+ ---
14
+
15
+ # EfficientNet-B2 (ONNX) – Renesas X5H
16
+
17
+ > ⏳ **Model file not yet uploaded.** Benchmark results on this page were published ahead of the model weights — see **Provided Artifacts** below. Download/deployment steps will not work until the file is added to this repository.
18
+
19
+ ## Introduction
20
+
21
+ This repository hosts **EfficientNet-B2**, targeting the **Renesas R-Car X5H** platform for image
22
+ classification inference on the NPX6 NPU.
23
+
24
+ > **Note:** The other EfficientNet sizes (B0, B1, B3–B8) each have their own sibling repo.
25
+
26
+ - **Model Architecture:** EfficientNet — compound-scaled convolutional network for 1000-class image classification
27
+ - **Source Model:** [timm/tf_efficientnet_b2.ns_jft_in1k](https://huggingface.co/timm/tf_efficientnet_b2.ns_jft_in1k) — OpenMMLab config [`efficientnet_b2_3rdparty_ra_noisystudent_in1k`](https://github.com/open-mmlab/mmpretrain/blob/main/configs/efficientnet/metafile.yml)
28
+ - **Task:** Image Classification (ImageNet-1k, 1000 classes)
29
+ - **Parameters:** 9.2M (published EfficientNet-B2 figure (Tan & Le 2019))
30
+
31
+ ## Deployment Flow
32
+
33
+ The FP32 ONNX model is auto-cast to **INT8** by the Renesas MWMX toolchain at compile time — no
34
+ separate quantization step is required.
35
+
36
+ ```
37
+ efficientnet_b2_3rdparty_ra_noisystudent_in1k_..._optimized.onnx (FP32)
38
+ │
39
+ └─▶ MWMX Runtime ──▶ INT8 auto-cast ──▶ NPX6 NPU
40
+ ```
41
+
42
+ ## Provided Artifacts
43
+
44
+ | Artifact | Status | Notes |
45
+ |----------|--------|-------|
46
+ | **FP32 (ONNX)** | ⏳ Not yet uploaded | Benchmark numbers below exist; the model file has not been published to this repo yet |
47
+
48
+ ## Performance
49
+
50
+ Measured on **Renesas R-Car X5H** via the MWMX runtime (APM50 ship-performance CI pipeline).
51
+
52
+ > **Benchmark configuration:** Single NPU · Batch size: 1 · Input resolution: not available from source data (TBD)
53
+
54
+ | Runtime | Precision | Device | Latency (ms) | Type |
55
+ |---------|-----------|--------|---------------|------|
56
+ | MWMX Runtime | INT8 (auto) | X5H · 1× NPU · 1 Core · 850 MHz | 7.786218 | Measured |
57
+ | MWMX Runtime | INT8 (auto) | X5H · 1× NPU · 12 Cores · 850 MHz | 6.624581 | Measured |
58
+
59
+ ### Accuracy
60
+
61
+ TBD — not yet measured/published for this repo.
62
+
63
+ ---
64
+
65
+ ## Runtime Details
66
+
67
+ ### MWMX Runtime
68
+
69
+ - **Engine:** Renesas MWMX (Middleware MX) native inference runtime
70
+ - **Input format:** FP32 ONNX (compiled by the MWMX toolchain)
71
+ - **NPU execution precision:** INT8 (auto-cast by MWMX toolchain)
72
+ - **Execution target:** NPX6-48K NPU on R-Car X5H
73
+
74
+ ---
75
+
76
+ ## Prerequisites
77
+
78
+ To run inference on Renesas R-Car X5H, you need:
79
+
80
+ 1. **Renesas R-Car X5H board** with NPX6 NPU
81
+ 2. **Renesas MWMX Runtime**
82
+ 3. **Hugging Face CLI** to download the model (once the model file is published)
83
+
84
+ ## Download
85
+
86
+ TBD — model file not yet published to this repository.
87
+
88
+ ---
89
+
90
+ ## Benchmark Methodology
91
+
92
+ - **HIL runs:** Hardware-in-the-loop — measured on physical R-Car X5H silicon via the MWMX
93
+ runtime (`metawaremx_runtime` CI pipeline, "APM50" ship-performance target)
94
+ - **Precision:** FP32 ONNX input; INT8 execution (auto-cast by MWMX)
95
+ - **Slices:** results reported for both 1 AI core and 12 AI cores per NPU instance
fp32/.metadata.yaml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # EfficientNet-B2 — source checkpoint: efficientnet_b2_3rdparty_ra_noisystudent_in1k
2
+ architecture:
3
+ parameters: 9.2M # published EfficientNet-B2 parameter count (EfficientNet paper / timm)
4
+
5
+ variant:
6
+ id: onnx_fp32
7
+ format: onnx
8
+ precision: fp32 # full-precision FP32 reference model
9
+ method: onnx_export # exported from the upstream source checkpoint
10
+
11
+ quantization:
12
+ datatype: fp32
13
+ scope:
14
+ - weights
15
+ granularity: none # not applicable for FP32
16
+ calibration: none # no calibration for FP32 reference
17
+ toolchain: onnx
fp32/efficientnet-b2_3rdparty-ra-noisystudent_in1k.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:89c9f466a667b8b0da35f72e0b464924f8b4d59b8573ff77f1cab6837a243e41
3
+ size 36677482
int8/.metadata.yaml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # EfficientNet-B2 — source checkpoint: efficientnet_b2_3rdparty_ra_noisystudent_in1k
2
+ architecture:
3
+ parameters: 9.2M # published EfficientNet-B2 parameter count (EfficientNet paper / timm)
4
+
5
+ variant:
6
+ id: onnx_int8
7
+ format: onnx
8
+ precision: int8 # INT8 quantized — auto-cast by NPU execution provider at runtime
9
+ method: onnx_export # base model exported to ONNX; quantization applied by runtime
10
+
11
+ quantization:
12
+ datatype: int8
13
+ scope:
14
+ - weights
15
+ - activations
16
+ granularity: per-tensor # typical for runtime-cast INT8
17
+ calibration: ptq # post-training quantization applied by the NPU EP / MWMX toolchain
18
+ toolchain: onnx
int8/benchmarks/x5h_mwmx_npu_apm50_12core.yaml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hardware:
2
+ vendor: renesas
3
+ chip: rcar-x5h
4
+ cpu: arm-cortex-a720
5
+ npu: npx6-48k
6
+ npu_count: 2
7
+ npu_cores: 12
8
+ npu_default_freq_mhz: 1066
9
+ accelerator:
10
+ - npu
11
+
12
+ runtime:
13
+ engine: mwmx
14
+ toolchain_version: "MWMX SDK v4.35.0"
15
+ format: onnx
16
+ execution_provider: npu
17
+ execution_precision: int8
18
+
19
+ configuration:
20
+ npu_instances: 1
21
+ npu_cores_per_instance: 12
22
+ npu_freq_mhz: 850
23
+
24
+ benchmark:
25
+ type: hil
26
+ parameters:
27
+ batch_size: 1
28
+ input_resolution: null # not available from source data — TBD
29
+
30
+ performance:
31
+ fps: null
32
+ latency: 6.624581 # APM50 pipeline run (metawaremx_runtime CI)
33
+
34
+ metrics:
35
+ accuracy: null
36
+ top5_accuracy: null
37
+
38
+ memory:
39
+ peak_mb: null
40
+
41
+ power:
42
+ avg_w: null
43
+
44
+ reproduce:
45
+ steps:
46
+ - title: Activate the Python environment
47
+ command: >-
48
+ Activate the Python virtual environment that has the `hf` CLI
49
+ (huggingface_hub) and the NNAC toolchain installed, e.g.
50
+ `source nnac_venv/bin/activate` -- path depends on your toolchain install.
51
+ kind: note
52
+ - title: Download the ONNX model
53
+ command: hf download Renesas/EfficientNet-B2-ONNX --repo-type=model --include "fp32/*" --local-dir ./EfficientNet-B2-ONNX-fp32
54
+ - title: Compile with the NNAC toolchain (INT8 auto-cast from the FP32 graph)
55
+ command: |
56
+ python3 nnac_frontend/legalize.py -d binary/nnx ./EfficientNet-B2-ONNX-fp32/fp32/efficientnet-b2_3rdparty-ra-noisystudent_in1k.onnx --num-core 12
57
+ - title: Set up the R-Car X5H board
58
+ 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.
59
+ kind: note
60
+ - title: Copy the compiled artifact to the board
61
+ command: Copy ${WORKDIR}/binary/nnx (the working directory from the download/compile steps above) to the board -- method may vary (NFS mount, scp, USB, etc.).
62
+ kind: note
63
+ - title: Run on R-Car X5H (single NPU cluster, 12 AI cores)
64
+ command: |
65
+ cd binary
66
+ ./host_app ./arc_prog_npus ./nnx/efficientnet-b2_3rdparty-ra-noisystudent_in1k
67
+ expected: hash[n] = 0x...(OK) means the run's output matches the reference hash in hash.txt; latency is the NPX execution time reported in cycles and ms.
int8/benchmarks/x5h_mwmx_npu_apm50_1core.yaml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hardware:
2
+ vendor: renesas
3
+ chip: rcar-x5h
4
+ cpu: arm-cortex-a720
5
+ npu: npx6-48k
6
+ npu_count: 2
7
+ npu_cores: 12
8
+ npu_default_freq_mhz: 1066
9
+ accelerator:
10
+ - npu
11
+
12
+ runtime:
13
+ engine: mwmx
14
+ toolchain_version: "MWMX SDK v4.35.0"
15
+ format: onnx
16
+ execution_provider: npu
17
+ execution_precision: int8
18
+
19
+ configuration:
20
+ npu_instances: 1
21
+ npu_cores_per_instance: 1
22
+ npu_freq_mhz: 850
23
+
24
+ benchmark:
25
+ type: hil
26
+ parameters:
27
+ batch_size: 1
28
+ input_resolution: null # not available from source data — TBD
29
+
30
+ performance:
31
+ fps: null
32
+ latency: 7.786218 # APM50 pipeline run (metawaremx_runtime CI)
33
+
34
+ metrics:
35
+ accuracy: null
36
+ top5_accuracy: null
37
+
38
+ memory:
39
+ peak_mb: null
40
+
41
+ power:
42
+ avg_w: null
43
+
44
+ reproduce:
45
+ steps:
46
+ - title: Activate the Python environment
47
+ command: >-
48
+ Activate the Python virtual environment that has the `hf` CLI
49
+ (huggingface_hub) and the NNAC toolchain installed, e.g.
50
+ `source nnac_venv/bin/activate` -- path depends on your toolchain install.
51
+ kind: note
52
+ - title: Download the ONNX model
53
+ command: hf download Renesas/EfficientNet-B2-ONNX --repo-type=model --include "fp32/*" --local-dir ./EfficientNet-B2-ONNX-fp32
54
+ - title: Compile with the NNAC toolchain (INT8 auto-cast from the FP32 graph)
55
+ command: |
56
+ python3 nnac_frontend/legalize.py -d binary/nnx ./EfficientNet-B2-ONNX-fp32/fp32/efficientnet-b2_3rdparty-ra-noisystudent_in1k.onnx --num-core 1
57
+ - title: Set up the R-Car X5H board
58
+ 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.
59
+ kind: note
60
+ - title: Copy the compiled artifact to the board
61
+ command: Copy ${WORKDIR}/binary/nnx (the working directory from the download/compile steps above) to the board -- method may vary (NFS mount, scp, USB, etc.).
62
+ kind: note
63
+ - title: Run on R-Car X5H (single NPU cluster)
64
+ command: |
65
+ cd binary
66
+ ./host_app ./arc_prog_npus ./nnx/efficientnet-b2_3rdparty-ra-noisystudent_in1k
67
+ expected: hash[n] = 0x...(OK) means the run's output matches the reference hash in hash.txt; latency is the NPX execution time reported in cycles and ms.