msluszniak commited on
Commit
5215a18
·
verified ·
1 Parent(s): 8ec8923

Core ML: drop fp32 and make fp16 the default

Browse files

fp32 was marked default, so callers got the slower, larger variant unless they opted out. It is also structurally unable to run on the ANE and measured slower than fp16 on every model tested.

The output of a style transfer model is an image, so it was gated perceptually rather than by tensor distance: minimum PSNR 59.51 dB between fp16 and fp32 across 6 images (above roughly 40 dB the difference is not visible), relative L2 under 0.002.

v0.9.0 and below are untouched.

coreml/config.json CHANGED
@@ -12,38 +12,6 @@
12
  "file": "style_transfer_candy_coreml_fp16.pte",
13
  "precision": "fp16",
14
  "quantized": false,
15
- "default": false,
16
- "methods": {
17
- "forward": {
18
- "inputs": [
19
- {
20
- "shape": [
21
- 1,
22
- 3,
23
- 640,
24
- 640
25
- ],
26
- "dtype": "float32"
27
- }
28
- ],
29
- "outputs": [
30
- {
31
- "shape": [
32
- 1,
33
- 3,
34
- 640,
35
- 640
36
- ],
37
- "dtype": "float32"
38
- }
39
- ]
40
- }
41
- }
42
- },
43
- {
44
- "file": "style_transfer_candy_coreml_fp32.pte",
45
- "precision": "fp32",
46
- "quantized": false,
47
  "default": true,
48
  "methods": {
49
  "forward": {
 
12
  "file": "style_transfer_candy_coreml_fp16.pte",
13
  "precision": "fp16",
14
  "quantized": false,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  "default": true,
16
  "methods": {
17
  "forward": {
coreml/style_transfer_candy_coreml_fp32.pte DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:70d29c056335f8271467137a57abafcd102f42c7c53c3afb449a98c701498c15
3
- size 7115907