mlboydaisuke commited on
Commit
1b37693
·
verified ·
1 Parent(s): 0868cb5

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +21 -14
README.md CHANGED
@@ -10,32 +10,39 @@ tags:
10
  ---
11
  # twinlitenet — ExecuTorch XNNPACK
12
 
13
- `twinlitenet_xnnpack_fp32.pte` (1.8 MB, fp32, XNNPACK-delegated)
14
-
15
  - **Source**: chequanghuy/TwinLiteNet (pretrained/best.pth)
16
  - **License**: MIT
17
  - **Input**: [[1, 3, 360, 640]] — RGB 0-1, 360x640
18
  - **Output**: drivable area [1,2,360,640] + lane line [1,2,360,640]
19
 
20
- ## Verification (Mac arm64, executorch 1.4.0, torch 2.13.0)
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
- Parity vs torch fp32 eager on random input:
 
 
 
23
 
24
  | output | shape | max_abs_diff | corr |
25
  |--------|-------|--------------|------|
26
- | 0 | [1, 2, 360, 640] | 1.192e-05 | 1.000000 |
27
- | 1 | [1, 2, 360, 640] | 1.049e-05 | 1.000000 |
28
 
29
- Median latency over 10 runs (single Mac process, reference only — device numbers to follow):
30
- ExecuTorch 33.7 ms vs torch eager 23.3 ms.
31
 
32
  ## Conversion
33
 
34
  torch.export -> to_edge_transform_and_lower(XnnpackPartitioner) -> .pte
35
  (conversion scripts: [executorch-models](https://github.com/john-rocky/executorch-models))
36
-
37
- **Notes**: PReLU is excluded from XNNPACK delegation (XNNPACK PReLU segfaults at execute on macOS arm64 in executorch 1.4.0; minimal repro: a lone nn.PReLU(1)). PReLU runs on the portable kernel instead; outputs are bit-identical to the stock model.
38
-
39
-
40
- ---
41
- Part of [executorch-models](https://github.com/john-rocky/executorch-models) — a verified .pte zoo for ExecuTorch. Conversion scripts and all models are indexed there.
 
10
  ---
11
  # twinlitenet — ExecuTorch XNNPACK
12
 
 
 
13
  - **Source**: chequanghuy/TwinLiteNet (pretrained/best.pth)
14
  - **License**: MIT
15
  - **Input**: [[1, 3, 360, 640]] — RGB 0-1, 360x640
16
  - **Output**: drivable area [1,2,360,640] + lane line [1,2,360,640]
17
 
18
+ ## Variants
19
+
20
+ All variants take and return fp32 tensors — swap the `.pte` file, keep your app code.
21
+
22
+ | precision | file | size (MB) | parity vs fp32 eager (worst corr) | Mac median (ms)* |
23
+ |-----------|------|-----------|------------------------------------|------------------|
24
+ | fp32 | `twinlitenet_xnnpack_fp32.pte` | 1.8 | 1.000000 | 32.5 |
25
+
26
+ \*Mac arm64, single process, median of 10 — a reference point for relative cost
27
+ only, not a device number (torch eager fp32 on the same machine: 23.9 ms).
28
+
29
+ ### Precisions that did not earn a slot
30
+
31
+ - **fp16 is not shipped**: it comes out at 100% of the fp32 file (1.8 MB vs 1.8 MB), so it buys nothing. XNNPACK serializes convolution weights as fp32 no matter what dtype the graph carries, so on a conv-heavy model fp16 saves no disk and only adds cast operations. Reach for int8 here, not fp16.
32
 
33
+ ## Verification (executorch 1.4.0, torch 2.13.0)
34
+
35
+ Parity is measured against the fp32 eager model on real image input; `corr` is
36
+ the correlation over all elements of each output tensor.
37
 
38
  | output | shape | max_abs_diff | corr |
39
  |--------|-------|--------------|------|
40
+ | 0 | [1, 2, 360, 640] | 1.240e-05 | 1.000000 |
41
+ | 1 | [1, 2, 360, 640] | 1.287e-05 | 1.000000 |
42
 
43
+ XNNPACK delegate coverage (fp32): 79.7% (177/222 ops); ops left on the portable kernels: `aten.gt.Scalar` x20, `aten.where.self` x20, `aten.avg_pool2d.default` x3, `aten.max.dim` x1, `aten.expand_copy.default` x1
 
44
 
45
  ## Conversion
46
 
47
  torch.export -> to_edge_transform_and_lower(XnnpackPartitioner) -> .pte
48
  (conversion scripts: [executorch-models](https://github.com/john-rocky/executorch-models))