Skip to content

Commit d412e86

Browse files
msluszniakclaude
andauthored
feat: deprecate unquantized XNNPACK variants with a faster quantized twin (#1519)
## Description - Deprecates 66 unquantized XNNPACK variants whose quantized twin is faster and smaller. They still load, warn once on download (dev only) and are marked `@deprecated`. Removal in v1.0.0. - fp32 for efficientnet-v2-s, fcn r50/r101, deeplab r50/r101/mbv3, lraspp, the 4 style transfers, paraphrase-multilingual/distiluse, PP-OCRv6 and whisper base.en/small.en. - fp32 for the models that gain int8 in #1530, #1537, #1539, #1542, plus mpnet and whisper small, whose int8 is re-exported as 8da8w (export-scripts !34). - Removes all 15 bf16/fp16 XNNPACK LLMs. - Points efficientnet int8, deeplab mbv3 int8 and paraphrase/distiluse 8da4w at their v0.11.0 re-exports (export-scripts !32): int8 recipe fixes, and int8 embedding tables (~395 -> ~115 MB). - Apps and docs use the int8 variants. ### Introduces a breaking change? - [x] Yes - [ ] No ### Type of change - [ ] Bug fix (change which fixes an issue) - [ ] New feature (change which adds functionality) - [ ] Documentation update (improves or adds clarity to existing documentation) - [x] Other (chores, tests, code style improvements etc.) ### Tested on - [ ] iOS - [ ] Android ### Testing instructions - `yarn workspace react-native-executorch test` ### Screenshots ### Related issues Part of #1456 ### Checklist - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [x] My changes generate no new warnings ### Additional notes Host accuracy (ET 1.4.1 XNNPACK, published v0.10.0 files), fp32 vs quantized: | model | metric (n) | fp32 | quant | |---|---|---|---| | fcn r50 / r101 | VOC mIoU (300) | 71.06 / 74.20 | 71.07 / 74.57 | | deeplab r50 / r101 | VOC mIoU (300) | 76.14 / 78.26 | 76.47 / 78.13 | | deeplab mbv3 | VOC mIoU (300) | 69.13 | 67.43, re-export 68.88 | | lraspp | VOC mIoU (300) | 65.80 | 66.02 | | efficientnet-v2-s | ImageNetV2 top-1 (1000) | 75.8% | 72.1%, re-export 75.0% | | paraphrase-multilingual / distiluse | STSb 10 langs Spearman (3000) | 0.8891 / 0.8357 | 0.8871 / 0.8345, re-export 0.8870 / 0.8343 | | PP-OCRv6 detector | CER on 157 synthetic lines | 0.076% | 0.038% | | style transfer | visual check (30 images) | | equivalent | | mpnet / multi-qa-mpnet | SQuAD top-1 (2000) | 65.05 / 64.60 | 65.00 / 65.00 | | whisper small | WER en / pl / zh CER | 2.84 / 22.57 / 10.81 | 2.90 / 22.92 / 10.96 | --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent beb86c9 commit d412e86

15 files changed

Lines changed: 392 additions & 232 deletions

File tree

‎apps/computer-vision/app/classification/index.tsx‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ const MODEL_OPTIONS: ModelOption[] = [
1717
label: 'EfficientNetV2-S (XNNPACK INT8)',
1818
value: models.classification.EFFICIENTNET_V2_S.XNNPACK_INT8,
1919
},
20-
{
21-
label: 'EfficientNetV2-S (XNNPACK FP32)',
22-
value: models.classification.EFFICIENTNET_V2_S.XNNPACK_FP32,
23-
},
2420
{
2521
label: 'EfficientNetV2-S (CoreML FP16)',
2622
value: models.classification.EFFICIENTNET_V2_S.COREML_FP16,

‎apps/computer-vision/app/detection/index.tsx‎

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,34 @@ const MODEL_OPTIONS: ModelOption[] = [
2222
label: 'RF-DETR Nano (XNNPACK INT8)',
2323
value: models.objectDetection.RFDETR_NANO.XNNPACK_INT8,
2424
},
25-
{
26-
label: 'RF-DETR Nano (XNNPACK FP32)',
27-
value: models.objectDetection.RFDETR_NANO.XNNPACK_FP32,
28-
},
2925
{
3026
label: 'RF-DETR Nano (CoreML FP16)',
3127
value: models.objectDetection.RFDETR_NANO.COREML_FP16,
3228
disabled: Platform.OS !== 'ios',
3329
},
3430
{
35-
label: 'YOLO26 Nano 384 (XNNPACK FP32)',
36-
value: models.objectDetection.YOLO26.NANO.SIZE_384.XNNPACK_FP32,
31+
label: 'YOLO26 Nano 384 (XNNPACK INT8)',
32+
value: models.objectDetection.YOLO26.NANO.SIZE_384.XNNPACK_INT8,
3733
},
3834
{
39-
label: 'YOLO26 Nano 640 (XNNPACK FP32)',
40-
value: models.objectDetection.YOLO26.NANO.SIZE_640.XNNPACK_FP32,
35+
label: 'YOLO26 Nano 640 (XNNPACK INT8)',
36+
value: models.objectDetection.YOLO26.NANO.SIZE_640.XNNPACK_INT8,
4137
},
4238
{
43-
label: 'YOLO26 Small 640 (XNNPACK FP32)',
44-
value: models.objectDetection.YOLO26.SMALL.SIZE_640.XNNPACK_FP32,
39+
label: 'YOLO26 Small 640 (XNNPACK INT8)',
40+
value: models.objectDetection.YOLO26.SMALL.SIZE_640.XNNPACK_INT8,
4541
},
4642
{
47-
label: 'YOLO26 Medium 640 (XNNPACK FP32)',
48-
value: models.objectDetection.YOLO26.MEDIUM.SIZE_640.XNNPACK_FP32,
43+
label: 'YOLO26 Medium 640 (XNNPACK INT8)',
44+
value: models.objectDetection.YOLO26.MEDIUM.SIZE_640.XNNPACK_INT8,
4945
},
5046
{
51-
label: 'YOLO26 Large 640 (XNNPACK FP32)',
52-
value: models.objectDetection.YOLO26.LARGE.SIZE_640.XNNPACK_FP32,
47+
label: 'YOLO26 Large 640 (XNNPACK INT8)',
48+
value: models.objectDetection.YOLO26.LARGE.SIZE_640.XNNPACK_INT8,
5349
},
5450
{
55-
label: 'YOLO26 X-Large 640 (XNNPACK FP32)',
56-
value: models.objectDetection.YOLO26.XLARGE.SIZE_640.XNNPACK_FP32,
51+
label: 'YOLO26 X-Large 640 (XNNPACK INT8)',
52+
value: models.objectDetection.YOLO26.XLARGE.SIZE_640.XNNPACK_INT8,
5753
},
5854
];
5955

‎apps/computer-vision/app/imageEmbeddings/index.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import { Button } from '../../components/Button';
2222

2323
const IMAGE_MODEL_OPTIONS: ModelOption[] = [
2424
{
25-
label: 'CLIP ViT-B/32 (XNNPACK FP32)',
26-
value: models.imageEmbeddings.CLIP_VIT_BASE_PATCH32.XNNPACK_FP32,
25+
label: 'CLIP ViT-B/32 (XNNPACK INT8)',
26+
value: models.imageEmbeddings.CLIP_VIT_BASE_PATCH32.XNNPACK_INT8,
2727
},
2828
{
2929
label: 'CLIP ViT-B/32 (CoreML FP16)',

‎apps/computer-vision/app/instanceSegmentation/index.tsx‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,10 @@ const MODEL_OPTIONS: ModelOption[] = [
2828
label: 'YOLO26 Nano (XNNPACK INT8)',
2929
value: models.instanceSegmentation.YOLO26.NANO.SIZE_384.XNNPACK_INT8,
3030
},
31-
{
32-
label: 'YOLO26 Nano (XNNPACK FP32)',
33-
value: models.instanceSegmentation.YOLO26.NANO.SIZE_384.XNNPACK_FP32,
34-
},
3531
{
3632
label: 'RFDETR (XNNPACK INT8)',
3733
value: models.instanceSegmentation.RFDETR_NANO.XNNPACK_INT8,
3834
},
39-
{
40-
label: 'RFDETR (XNNPACK FP32)',
41-
value: models.instanceSegmentation.RFDETR_NANO.XNNPACK_FP32,
42-
},
4335
{
4436
label: 'RFDETR (CoreML FP16)',
4537
value: models.instanceSegmentation.RFDETR_NANO.COREML_FP16,
@@ -49,18 +41,10 @@ const MODEL_OPTIONS: ModelOption[] = [
4941
label: 'FastSAM Small (XNNPACK INT8)',
5042
value: models.instanceSegmentation.FASTSAM.S.XNNPACK_INT8,
5143
},
52-
{
53-
label: 'FastSAM Small (XNNPACK FP32)',
54-
value: models.instanceSegmentation.FASTSAM.S.XNNPACK_FP32,
55-
},
5644
{
5745
label: 'FastSAM X-Large (XNNPACK INT8)',
5846
value: models.instanceSegmentation.FASTSAM.X.XNNPACK_INT8,
5947
},
60-
{
61-
label: 'FastSAM X-Large (XNNPACK FP32)',
62-
value: models.instanceSegmentation.FASTSAM.X.XNNPACK_FP32,
63-
},
6448
{
6549
label: 'FastSAM Small (CoreML FP16)',
6650
value: models.instanceSegmentation.FASTSAM.S.COREML_FP16,

‎apps/computer-vision/app/keypoint/index.tsx‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,10 @@ const MODEL_OPTIONS: ModelOption[] = [
3232
label: 'YOLO26 Pose (XNNPACK INT8)',
3333
value: models.keypointDetection.YOLO26_POSE.SIZE_384.XNNPACK_INT8,
3434
},
35-
{
36-
label: 'YOLO26 Pose (XNNPACK FP32)',
37-
value: models.keypointDetection.YOLO26_POSE.SIZE_384.XNNPACK_FP32,
38-
},
3935
{
4036
label: 'RF-DETR Keypoint (XNNPACK INT8)',
4137
value: models.keypointDetection.RFDETR_KEYPOINT.XNNPACK_INT8,
4238
},
43-
{
44-
label: 'RF-DETR Keypoint (XNNPACK FP32)',
45-
value: models.keypointDetection.RFDETR_KEYPOINT.XNNPACK_FP32,
46-
},
4739
{
4840
label: 'RF-DETR Keypoint (CoreML FP16)',
4941
value: models.keypointDetection.RFDETR_KEYPOINT.COREML_FP16,

‎apps/computer-vision/app/textToImage/index.tsx‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ const MODEL_OPTIONS: ModelOption[] = [
2626
label: 'SDXS-512-DreamShaper (XNNPACK INT8)',
2727
value: models.textToImage.SDXS_512_DREAMSHAPER.XNNPACK_INT8,
2828
},
29-
{
30-
label: 'SDXS-512-DreamShaper (XNNPACK FP32)',
31-
value: models.textToImage.SDXS_512_DREAMSHAPER.XNNPACK_FP32,
32-
},
3329
{
3430
label: 'SDXS-512-DreamShaper (CoreML FP16)',
3531
value: models.textToImage.SDXS_512_DREAMSHAPER.COREML_FP16,

‎apps/speech/app/audio-file-transcription/index.tsx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { theme } from '../../theme';
1919
const MODELS = [
2020
{
2121
name: 'Tiny English (CPU)',
22-
config: models.speechToText.WHISPER.EN.TINY.XNNPACK_FP32,
22+
config: models.speechToText.WHISPER.EN.TINY.XNNPACK_INT8,
2323
},
2424
{
2525
name: 'Tiny English (CoreML)',
@@ -33,7 +33,7 @@ const MODELS = [
3333
},
3434
{
3535
name: 'Base English (CPU)',
36-
config: models.speechToText.WHISPER.EN.BASE.XNNPACK_FP32,
36+
config: models.speechToText.WHISPER.EN.BASE.XNNPACK_INT8,
3737
},
3838
{
3939
name: 'Base English (CoreML)',
@@ -47,7 +47,7 @@ const MODELS = [
4747
},
4848
{
4949
name: 'Small English (CPU)',
50-
config: models.speechToText.WHISPER.EN.SMALL.XNNPACK_FP32,
50+
config: models.speechToText.WHISPER.EN.SMALL.XNNPACK_INT8,
5151
},
5252
{
5353
name: 'Small English (CoreML)',
@@ -61,7 +61,7 @@ const MODELS = [
6161
},
6262
{
6363
name: 'Tiny Multilingual (CPU)',
64-
config: models.speechToText.WHISPER.TINY.XNNPACK_FP32,
64+
config: models.speechToText.WHISPER.TINY.XNNPACK_INT8,
6565
},
6666
{
6767
name: 'Tiny Multilingual (CoreML)',
@@ -100,7 +100,7 @@ const MODELS = [
100100
},
101101
{
102102
name: 'Base Multilingual (CPU)',
103-
config: models.speechToText.WHISPER.BASE.XNNPACK_FP32,
103+
config: models.speechToText.WHISPER.BASE.XNNPACK_INT8,
104104
},
105105
{
106106
name: 'Base Multilingual (CoreML)',
@@ -114,7 +114,7 @@ const MODELS = [
114114
},
115115
{
116116
name: 'Small Multilingual (CPU)',
117-
config: models.speechToText.WHISPER.SMALL.XNNPACK_FP32,
117+
config: models.speechToText.WHISPER.SMALL.XNNPACK_INT8,
118118
},
119119
{
120120
name: 'Small Multilingual (CoreML)',

‎apps/speech/app/microphone-transcription/index.tsx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { theme } from '../../theme';
1212
const MODELS = [
1313
{
1414
name: 'Tiny English (CPU)',
15-
config: models.speechToText.WHISPER.EN.TINY.XNNPACK_FP32,
15+
config: models.speechToText.WHISPER.EN.TINY.XNNPACK_INT8,
1616
},
1717
{
1818
name: 'Tiny English (CoreML)',
@@ -26,7 +26,7 @@ const MODELS = [
2626
},
2727
{
2828
name: 'Base English (CPU)',
29-
config: models.speechToText.WHISPER.EN.BASE.XNNPACK_FP32,
29+
config: models.speechToText.WHISPER.EN.BASE.XNNPACK_INT8,
3030
},
3131
{
3232
name: 'Base English (CoreML)',
@@ -40,7 +40,7 @@ const MODELS = [
4040
},
4141
{
4242
name: 'Small English (CPU)',
43-
config: models.speechToText.WHISPER.EN.SMALL.XNNPACK_FP32,
43+
config: models.speechToText.WHISPER.EN.SMALL.XNNPACK_INT8,
4444
},
4545
{
4646
name: 'Small English (CoreML)',
@@ -54,7 +54,7 @@ const MODELS = [
5454
},
5555
{
5656
name: 'Tiny Multilingual (CPU)',
57-
config: models.speechToText.WHISPER.TINY.XNNPACK_FP32,
57+
config: models.speechToText.WHISPER.TINY.XNNPACK_INT8,
5858
},
5959
{
6060
name: 'Tiny Multilingual (CoreML)',
@@ -93,7 +93,7 @@ const MODELS = [
9393
},
9494
{
9595
name: 'Base Multilingual (CPU)',
96-
config: models.speechToText.WHISPER.BASE.XNNPACK_FP32,
96+
config: models.speechToText.WHISPER.BASE.XNNPACK_INT8,
9797
},
9898
{
9999
name: 'Base Multilingual (CoreML)',
@@ -107,7 +107,7 @@ const MODELS = [
107107
},
108108
{
109109
name: 'Small Multilingual (CPU)',
110-
config: models.speechToText.WHISPER.SMALL.XNNPACK_FP32,
110+
config: models.speechToText.WHISPER.SMALL.XNNPACK_INT8,
111111
},
112112
{
113113
name: 'Small Multilingual (CoreML)',

‎apps/speech/app/text-to-speech/index.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ const STEPS_OPTIONS = [
5151
];
5252

5353
const MODEL_OPTIONS = [
54-
{ label: 'XNNPACK (CPU)', value: 'XNNPACK_FP32' as const },
54+
{ label: 'XNNPACK (CPU)', value: 'XNNPACK_INT8' as const },
5555
{ label: 'MLX (Apple Silicon)', value: 'MLX_FP32' as const, disabled: Platform.OS !== 'ios' },
5656
{ label: 'Vulkan (GPU)', value: 'VULKAN_FP16' as const, disabled: Platform.OS !== 'android' },
5757
];
5858

5959
function TTSContent() {
6060
const [text, setText] = useState(SAMPLE_TEXT);
61-
const [selectedModel, setSelectedModel] = useState<'XNNPACK_FP32' | 'MLX_FP32' | 'VULKAN_FP16'>(
62-
Platform.OS === 'android' ? 'VULKAN_FP16' : 'XNNPACK_FP32'
61+
const [selectedModel, setSelectedModel] = useState<'XNNPACK_INT8' | 'MLX_FP32' | 'VULKAN_FP16'>(
62+
Platform.OS === 'android' ? 'VULKAN_FP16' : 'XNNPACK_INT8'
6363
);
6464
const [selectedVoice, setSelectedVoice] = useState<SupertonicDefaultVoiceName>('F1');
6565
const [selectedLang, setSelectedLang] = useState<speech.SupertonicLanguage>('en');

‎docs/docs/01-fundamentals/02-downloading-models.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import { useResourceDownload, models } from 'react-native-executorch';
5353

5454
function Example() {
5555
const { resource, downloadProgress, downloadError } = useResourceDownload(
56-
models.classification.EFFICIENTNET_V2_S.XNNPACK_FP32
56+
models.classification.EFFICIENTNET_V2_S.XNNPACK_INT8
5757
);
5858

5959
// resource is undefined until the download resolves, then mirrors the config
@@ -83,7 +83,7 @@ paths — ready to pass straight to a `create<Task>` factory:
8383
```typescript
8484
import { download, models } from 'react-native-executorch';
8585

86-
const model = await download(models.classification.EFFICIENTNET_V2_S.XNNPACK_FP32, {
86+
const model = await download(models.classification.EFFICIENTNET_V2_S.XNNPACK_INT8, {
8787
onProgress: (p) => console.log(`${Math.round(p * 100)}%`),
8888
});
8989

0 commit comments

Comments
 (0)