physic76 commited on
Commit
9cd307c
·
verified ·
1 Parent(s): 49d7b29

Keep the INT8 head outputs in FP16

Browse files

The DFL and the last box and class convolutions of the Detect head stay in FP16 in the INT8 models (640x480). COCO val2017 mAP50:95 on 500 images: yolo11s 0.392 -> 0.422 (FP16 0.436), yolo11n 0.300 -> 0.318 (FP16 0.354), at the same speed. Built with scripts/main.py of the occurra vms repo, branch fix-fp8-int8-selection. The README says FP8 is for RTX 50 only.

README.md CHANGED
@@ -30,8 +30,8 @@ yolo11{n,s}_{apple,fp16,fp8,int8}_{640x640,640x480}.onnx
30
  | `n` / `s` | YOLOv11 nano (~5 MB) or small (~19 MB) |
31
  | `apple` | FP16, NMS-free, batch=1, static — CoreML / Apple ANE friendly. uint8 input. |
32
  | `fp16` | FP16 weights, NMS embedded. Default for NVIDIA `TensorRT` EP. |
33
- | `fp8` | FP8 quantized via TensorRT QDQ. Smallest VRAM footprint on Blackwell / Hopper. |
34
- | `int8` | INT8 quantized with QDQ nodes embedded in the graph. No sidecar calibration cache needed. |
35
  | `640x640` | Square input — used on Apple (`apple` variant) and as the upstream default. |
36
  | `640x480` | 4:3 input — ~25% fewer FLOPs than 640×640 on cameras with 4:3 aspect, measurably faster on NVIDIA TensorRT. |
37
 
@@ -44,8 +44,8 @@ is informational.
44
  | Hardware | Recommended |
45
  | -------- | ----------- |
46
  | Apple Silicon (CoreML / ANE) | `yolo11n_apple_640x640.onnx` |
47
- | NVIDIA RTX 4000+ / Blackwell | `yolo11n_fp8_640x480.onnx` |
48
- | NVIDIA older (no FP8) | `yolo11n_int8_640x480.onnx` or `yolo11n_fp16_640x480.onnx` |
49
  | Higher accuracy (any NVIDIA) | swap the `n` for `s` (3–4× slower, marginally better mAP) |
50
 
51
  ## Source
 
30
  | `n` / `s` | YOLOv11 nano (~5 MB) or small (~19 MB) |
31
  | `apple` | FP16, NMS-free, batch=1, static — CoreML / Apple ANE friendly. uint8 input. |
32
  | `fp16` | FP16 weights, NMS embedded. Default for NVIDIA `TensorRT` EP. |
33
+ | `fp8` | FP8 quantized via TensorRT QDQ. Picked on compute capability 12.x (RTX 50, RTX PRO Blackwell). |
34
+ | `int8` | INT8 quantized with QDQ nodes embedded in the graph; the DFL and the last box and class convolutions of the head stay in FP16. No sidecar calibration cache needed. |
35
  | `640x640` | Square input — used on Apple (`apple` variant) and as the upstream default. |
36
  | `640x480` | 4:3 input — ~25% fewer FLOPs than 640×640 on cameras with 4:3 aspect, measurably faster on NVIDIA TensorRT. |
37
 
 
44
  | Hardware | Recommended |
45
  | -------- | ----------- |
46
  | Apple Silicon (CoreML / ANE) | `yolo11n_apple_640x640.onnx` |
47
+ | NVIDIA RTX 50 / RTX PRO Blackwell | `yolo11s_fp8_640x480.onnx` |
48
+ | NVIDIA RTX 40 and older | `yolo11s_int8_640x480.onnx` |
49
  | Higher accuracy (any NVIDIA) | swap the `n` for `s` (3–4× slower, marginally better mAP) |
50
 
51
  ## Source
yolo11n_int8_640x480.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:80869a9299077d504553416e06d5890f4b2b12e1a1243a8429d7fd55404ae13a
3
- size 5667820
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:028da522e6eed49caf6ba248f59c12e99bcad8c0a9ccb0d0000b1386d4c19626
3
+ size 5648925
yolo11s_int8_640x480.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:703c3694b0e03d25f756bd390db1f8d9f9a827949b68b7b97b01f53e73657108
3
- size 19366868
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:86c9ec3b4f698f2a52e32d4ba2c93d718b778d02a04b567375685bf930fa9602
3
+ size 19347949