oidn-web 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +83 -19
  3. package/dist/oidn.js +3239 -2642
  4. package/dist/oidn.umd.cjs +512 -296
  5. package/lib/UNet.d.ts +54 -20
  6. package/lib/UNet.js +194 -118
  7. package/lib/UNet.js.map +1 -1
  8. package/lib/backend.d.ts +1 -8
  9. package/lib/backend.js +1 -9
  10. package/lib/backend.js.map +1 -1
  11. package/lib/finalRgbShader.d.ts +13 -0
  12. package/lib/finalRgbShader.js +160 -0
  13. package/lib/finalRgbShader.js.map +1 -0
  14. package/lib/graphOptimizer.js +1 -2
  15. package/lib/graphOptimizer.js.map +1 -1
  16. package/lib/hdrTransfer.d.ts +14 -0
  17. package/lib/hdrTransfer.js +61 -0
  18. package/lib/hdrTransfer.js.map +1 -0
  19. package/lib/main.d.ts +16 -7
  20. package/lib/main.js +4 -5
  21. package/lib/main.js.map +1 -1
  22. package/lib/nativeUNet.d.ts +39 -3
  23. package/lib/nativeUNet.js +449 -120
  24. package/lib/nativeUNet.js.map +1 -1
  25. package/lib/process.d.ts +5 -11
  26. package/lib/process.js +35 -49
  27. package/lib/process.js.map +1 -1
  28. package/lib/tileScheduler.d.ts +32 -4
  29. package/lib/tileScheduler.js +133 -20
  30. package/lib/tileScheduler.js.map +1 -1
  31. package/package.json +9 -2
  32. package/src/UNet.ts +287 -158
  33. package/src/backend.ts +1 -14
  34. package/src/finalRgbShader.ts +186 -0
  35. package/src/graphOptimizer.ts +1 -2
  36. package/src/hdrTransfer.ts +88 -0
  37. package/src/main.ts +28 -13
  38. package/src/nativeUNet.ts +515 -116
  39. package/src/process.ts +43 -70
  40. package/src/tileScheduler.ts +216 -24
  41. package/benchmarks/compare.mjs +0 -651
  42. package/benchmarks/leak.mjs +0 -255
  43. package/benchmarks/results/before-spatial.json +0 -391
  44. package/benchmarks/results/before-spatial.md +0 -47
  45. package/benchmarks/results/int8-scan.json +0 -2007
  46. package/benchmarks/results/int8-scan.md +0 -160
  47. package/benchmarks/results/int8-w8a8-scan.json +0 -2007
  48. package/benchmarks/results/int8-w8a8-scan.md +0 -160
  49. package/benchmarks/results/int8-weight-channel.json +0 -1413
  50. package/benchmarks/results/int8-weight-channel.md +0 -118
  51. package/benchmarks/results/int8-weight-only.json +0 -1437
  52. package/benchmarks/results/int8-weight-only.md +0 -118
  53. package/benchmarks/results/kernel-webnn-final.json +0 -1115
  54. package/benchmarks/results/kernel-webnn-final.md +0 -104
  55. package/benchmarks/results/latest-optimized.json +0 -375
  56. package/benchmarks/results/latest-optimized.md +0 -47
  57. package/benchmarks/results/latest.json +0 -391
  58. package/benchmarks/results/latest.md +0 -47
  59. package/benchmarks/results/profile-baseline.json +0 -331
  60. package/benchmarks/results/profile-baseline.md +0 -12
  61. package/benchmarks/results/profile-conv2x.json +0 -331
  62. package/benchmarks/results/profile-conv2x.md +0 -12
  63. package/benchmarks/results/profile-fast-init.json +0 -385
  64. package/benchmarks/results/profile-fast-init.md +0 -47
  65. package/benchmarks/results/profile-fp16-fma.json +0 -369
  66. package/benchmarks/results/profile-fp16-fma.md +0 -47
  67. package/benchmarks/results/profile-fp16-tiled-decoder.json +0 -369
  68. package/benchmarks/results/profile-fp16-tiled-decoder.md +0 -47
  69. package/benchmarks/results/profile-fp16-tiled-encoder.json +0 -369
  70. package/benchmarks/results/profile-fp16-tiled-encoder.md +0 -47
  71. package/benchmarks/results/profile-fp16-unfused-pool.json +0 -385
  72. package/benchmarks/results/profile-fp16-unfused-pool.md +0 -47
  73. package/benchmarks/results/profile-input-major.json +0 -347
  74. package/benchmarks/results/profile-input-major.md +0 -12
  75. package/benchmarks/results/profile-k16.json +0 -347
  76. package/benchmarks/results/profile-k16.md +0 -12
  77. package/benchmarks/results/profile-k4.json +0 -347
  78. package/benchmarks/results/profile-k4.md +0 -12
  79. package/benchmarks/results/profile-pool-reuse.json +0 -331
  80. package/benchmarks/results/profile-pool-reuse.md +0 -12
  81. package/benchmarks/results/profile-precompiled.json +0 -385
  82. package/benchmarks/results/profile-precompiled.md +0 -47
  83. package/benchmarks/results/profile-static-channels.json +0 -385
  84. package/benchmarks/results/profile-static-channels.md +0 -47
  85. package/benchmarks/results/profile-static-io.json +0 -385
  86. package/benchmarks/results/profile-static-io.md +0 -47
  87. package/benchmarks/results/profile-tiled-conv.json +0 -331
  88. package/benchmarks/results/profile-tiled-conv.md +0 -12
  89. package/benchmarks/results/profile-tiled-decoder.json +0 -347
  90. package/benchmarks/results/profile-tiled-decoder.md +0 -12
  91. package/benchmarks/results/profile-tiled-matmul.json +0 -331
  92. package/benchmarks/results/profile-tiled-matmul.md +0 -12
  93. package/benchmarks/results/profile-unfused-decoder.json +0 -379
  94. package/benchmarks/results/profile-unfused-decoder.md +0 -12
  95. package/benchmarks/results/profile-unfused-pool.json +0 -347
  96. package/benchmarks/results/profile-unfused-pool.md +0 -12
  97. package/benchmarks/results/spatial-auto.json +0 -575
  98. package/benchmarks/results/spatial-auto.md +0 -61
  99. package/benchmarks/results/subgroup-smoke.json +0 -1094
  100. package/benchmarks/results/subgroup-smoke.md +0 -104
  101. package/benchmarks/results/webnn-smoke.json +0 -739
  102. package/benchmarks/results/webnn-smoke.md +0 -76
  103. package/scripts/inspect-model.mjs +0 -64
  104. package/tests/modelSpec.test.mjs +0 -128
  105. package/tests/resourceLifecycle.test.mjs +0 -383
  106. package/tests/tileScheduler.test.mjs +0 -90
@@ -1,391 +0,0 @@
1
- {
2
- "generatedAt": "2026-08-20T04:14:37.676Z",
3
- "currentCommit": "5d9c1c8771e2a03c90bfadafec4b5dd28fada446",
4
- "baselineCommit": "136c00c34aa5cf4561b4137034dbd643177f0a5f",
5
- "settings": {
6
- "width": 512,
7
- "height": 512,
8
- "tileSize": 512,
9
- "warmup": 1,
10
- "runs": 5,
11
- "model": "rt_hdr_calb_cnrm_large.tza",
12
- "gpuQueueCompletionIncluded": true
13
- },
14
- "browser": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
15
- "adapter": {
16
- "vendor": "apple",
17
- "architecture": "metal-3",
18
- "device": "",
19
- "description": ""
20
- },
21
- "results": [
22
- {
23
- "label": "TFJS (136c00c)",
24
- "bundle": "baseline",
25
- "baseline": true,
26
- "initializationMs": 9.100000001490116,
27
- "timesMs": [
28
- 34.80000000447035,
29
- 34.79999999701977,
30
- 34.600000001490116,
31
- 34.5,
32
- 34.600000001490116
33
- ],
34
- "supportsFP16": true,
35
- "adapter": {
36
- "vendor": "apple",
37
- "architecture": "metal-3",
38
- "device": "",
39
- "description": ""
40
- },
41
- "summary": {
42
- "minMs": 34.5,
43
- "medianMs": 34.600000001490116,
44
- "meanMs": 34.66000000089407,
45
- "p95Ms": 34.80000000447035,
46
- "maxMs": 34.80000000447035
47
- },
48
- "messages": []
49
- },
50
- {
51
- "label": "WGSL FP32",
52
- "bundle": "current",
53
- "baseline": false,
54
- "precision": "fp32",
55
- "initializationMs": 36.19999999552965,
56
- "timesMs": [
57
- 35.70000000298023,
58
- 35.79999999701977,
59
- 35.600000001490116,
60
- 35.79999999701977,
61
- 35.600000001490116
62
- ],
63
- "executionProfile": {
64
- "totalMs": 35.260974,
65
- "layers": [
66
- {
67
- "id": "input-pack",
68
- "durationMs": 0.050663
69
- },
70
- {
71
- "id": "enc_conv1a",
72
- "durationMs": 0.839491
73
- },
74
- {
75
- "id": "enc_conv1b",
76
- "durationMs": 3.697358
77
- },
78
- {
79
- "id": "pool1",
80
- "durationMs": 0.410641
81
- },
82
- {
83
- "id": "enc_conv2a",
84
- "durationMs": 1.41958
85
- },
86
- {
87
- "id": "enc_conv2b",
88
- "durationMs": 2.268612
89
- },
90
- {
91
- "id": "pool2",
92
- "durationMs": 0.054497
93
- },
94
- {
95
- "id": "enc_conv3a",
96
- "durationMs": 0.769328
97
- },
98
- {
99
- "id": "enc_conv3b",
100
- "durationMs": 0.986439
101
- },
102
- {
103
- "id": "pool3",
104
- "durationMs": 0.018041
105
- },
106
- {
107
- "id": "enc_conv4a",
108
- "durationMs": 0.400018
109
- },
110
- {
111
- "id": "enc_conv4b",
112
- "durationMs": 0.611212
113
- },
114
- {
115
- "id": "pool4",
116
- "durationMs": 0.008375
117
- },
118
- {
119
- "id": "enc_conv5a",
120
- "durationMs": 0.258609
121
- },
122
- {
123
- "id": "enc_conv5b",
124
- "durationMs": 0.336772
125
- },
126
- {
127
- "id": "dec_conv4a",
128
- "durationMs": 1.438454
129
- },
130
- {
131
- "id": "dec_conv4b",
132
- "durationMs": 0.612338
133
- },
134
- {
135
- "id": "dec_conv3a",
136
- "durationMs": 2.351731
137
- },
138
- {
139
- "id": "dec_conv3b",
140
- "durationMs": 0.987107
141
- },
142
- {
143
- "id": "dec_conv2a",
144
- "durationMs": 4.435979
145
- },
146
- {
147
- "id": "dec_conv2b",
148
- "durationMs": 2.204491
149
- },
150
- {
151
- "id": "dec_conv1a",
152
- "durationMs": 6.840541
153
- },
154
- {
155
- "id": "dec_conv1b",
156
- "durationMs": 3.763853
157
- },
158
- {
159
- "id": "dec_conv1c",
160
- "durationMs": 0.496844
161
- }
162
- ]
163
- },
164
- "runtimeInfo": {
165
- "configuredEngine": "wgsl",
166
- "gpuEngine": "wgsl",
167
- "precision": "fp32",
168
- "model": "oidn-unet-large-v1",
169
- "modelFamily": "oidn-unet-large",
170
- "inputChannels": 9,
171
- "dynamicTile": {
172
- "enabled": false,
173
- "currentTileSize": 512,
174
- "minTileSize": 256,
175
- "maxTileSize": 512,
176
- "targetTileTimeMs": 16
177
- },
178
- "lastExecution": {
179
- "width": 512,
180
- "height": 512,
181
- "tileWidth": 512,
182
- "tileHeight": 512,
183
- "tileCount": 1,
184
- "durationMs": 37.100000001490116,
185
- "tileTimeMs": {
186
- "min": 37,
187
- "median": 37,
188
- "mean": 37,
189
- "max": 37
190
- }
191
- }
192
- },
193
- "supportsFP16": true,
194
- "adapter": {
195
- "vendor": "apple",
196
- "architecture": "metal-3",
197
- "device": "",
198
- "description": ""
199
- },
200
- "summary": {
201
- "minMs": 35.600000001490116,
202
- "medianMs": 35.70000000298023,
203
- "meanMs": 35.7,
204
- "p95Ms": 35.79999999701977,
205
- "maxMs": 35.79999999701977
206
- },
207
- "messages": [],
208
- "validation": {
209
- "sampleCount": 6144,
210
- "meanAbsoluteError": 0.0000011096847932397698,
211
- "rootMeanSquaredError": 0.0000018071588418628667,
212
- "maxAbsoluteError": 0.000013589859008789062,
213
- "passed": true,
214
- "thresholds": {
215
- "maxMeanError": 0.0001,
216
- "maxAbsoluteError": 0.001
217
- }
218
- }
219
- },
220
- {
221
- "label": "WGSL FP16",
222
- "bundle": "current",
223
- "baseline": false,
224
- "precision": "fp16",
225
- "initializationMs": 27.799999997019768,
226
- "timesMs": [
227
- 27.600000001490116,
228
- 27.5,
229
- 27.69999999552965,
230
- 27.600000001490116,
231
- 27.700000002980232
232
- ],
233
- "executionProfile": {
234
- "totalMs": 27.002728,
235
- "layers": [
236
- {
237
- "id": "input-pack",
238
- "durationMs": 0.044205
239
- },
240
- {
241
- "id": "enc_conv1a",
242
- "durationMs": 0.617922
243
- },
244
- {
245
- "id": "enc_conv1b",
246
- "durationMs": 3.10056
247
- },
248
- {
249
- "id": "pool1",
250
- "durationMs": 0.348062
251
- },
252
- {
253
- "id": "enc_conv2a",
254
- "durationMs": 1.193719
255
- },
256
- {
257
- "id": "enc_conv2b",
258
- "durationMs": 2.061333
259
- },
260
- {
261
- "id": "pool2",
262
- "durationMs": 0.049996
263
- },
264
- {
265
- "id": "enc_conv3a",
266
- "durationMs": 0.678334
267
- },
268
- {
269
- "id": "enc_conv3b",
270
- "durationMs": 0.836574
271
- },
272
- {
273
- "id": "pool3",
274
- "durationMs": 0.017041
275
- },
276
- {
277
- "id": "enc_conv4a",
278
- "durationMs": 0.340646
279
- },
280
- {
281
- "id": "enc_conv4b",
282
- "durationMs": 0.528885
283
- },
284
- {
285
- "id": "pool4",
286
- "durationMs": 0.011041
287
- },
288
- {
289
- "id": "enc_conv5a",
290
- "durationMs": 0.182155
291
- },
292
- {
293
- "id": "enc_conv5b",
294
- "durationMs": 0.233986
295
- },
296
- {
297
- "id": "dec_conv4a",
298
- "durationMs": 0.946983
299
- },
300
- {
301
- "id": "dec_conv4b",
302
- "durationMs": 0.528885
303
- },
304
- {
305
- "id": "dec_conv3a",
306
- "durationMs": 1.704563
307
- },
308
- {
309
- "id": "dec_conv3b",
310
- "durationMs": 0.839656
311
- },
312
- {
313
- "id": "dec_conv2a",
314
- "durationMs": 3.035857
315
- },
316
- {
317
- "id": "dec_conv2b",
318
- "durationMs": 1.97488
319
- },
320
- {
321
- "id": "dec_conv1a",
322
- "durationMs": 4.425147
323
- },
324
- {
325
- "id": "dec_conv1b",
326
- "durationMs": 3.108393
327
- },
328
- {
329
- "id": "dec_conv1c",
330
- "durationMs": 0.193905
331
- }
332
- ]
333
- },
334
- "runtimeInfo": {
335
- "configuredEngine": "wgsl",
336
- "gpuEngine": "wgsl",
337
- "precision": "fp16",
338
- "model": "oidn-unet-large-v1",
339
- "modelFamily": "oidn-unet-large",
340
- "inputChannels": 9,
341
- "dynamicTile": {
342
- "enabled": false,
343
- "currentTileSize": 512,
344
- "minTileSize": 256,
345
- "maxTileSize": 512,
346
- "targetTileTimeMs": 16
347
- },
348
- "lastExecution": {
349
- "width": 512,
350
- "height": 512,
351
- "tileWidth": 512,
352
- "tileHeight": 512,
353
- "tileCount": 1,
354
- "durationMs": 28.599999994039536,
355
- "tileTimeMs": {
356
- "min": 28.599999994039536,
357
- "median": 28.599999994039536,
358
- "mean": 28.599999994039536,
359
- "max": 28.599999994039536
360
- }
361
- }
362
- },
363
- "supportsFP16": true,
364
- "adapter": {
365
- "vendor": "apple",
366
- "architecture": "metal-3",
367
- "device": "",
368
- "description": ""
369
- },
370
- "summary": {
371
- "minMs": 27.5,
372
- "medianMs": 27.600000001490116,
373
- "meanMs": 27.620000000298024,
374
- "p95Ms": 27.700000002980232,
375
- "maxMs": 27.700000002980232
376
- },
377
- "messages": [],
378
- "validation": {
379
- "sampleCount": 6144,
380
- "meanAbsoluteError": 0.0010210334021394374,
381
- "rootMeanSquaredError": 0.001609680379854656,
382
- "maxAbsoluteError": 0.012395620346069336,
383
- "passed": true,
384
- "thresholds": {
385
- "maxMeanError": 0.005,
386
- "maxAbsoluteError": 0.05
387
- }
388
- }
389
- }
390
- ]
391
- }
@@ -1,47 +0,0 @@
1
- # oidn-web benchmark
2
-
3
- - Current: `5d9c1c8771e2a03c90bfadafec4b5dd28fada446`
4
- - TFJS baseline: `136c00c34aa5cf4561b4137034dbd643177f0a5f`
5
- - Input: 512x512, fixed tile 512, 5 runs after 1 warmup(s)
6
- - Adapter: apple
7
-
8
- | Runtime | Init ms | Median ms | P95 ms | Speedup | Precision |
9
- | --- | ---: | ---: | ---: | ---: | --- |
10
- | TFJS (136c00c) | 9.10 | 34.60 | 34.80 | 1.00x | fp32 |
11
- | WGSL FP32 | 36.20 | 35.70 | 35.80 | 0.97x | fp32 |
12
- | WGSL FP16 | 27.80 | 27.60 | 27.70 | 1.25x | fp16 |
13
-
14
- ## Output validation
15
-
16
- Compared against sampled TFJS FP32 output.
17
-
18
- | Runtime | Status | MAE | RMSE | Max error | Samples |
19
- | --- | --- | ---: | ---: | ---: | ---: |
20
- | WGSL FP32 | pass | 1.11e-6 | 1.81e-6 | 1.36e-5 | 6144 |
21
- | WGSL FP16 | pass | 1.02e-3 | 1.61e-3 | 1.24e-2 | 6144 |
22
-
23
- ## GPU hot layers
24
-
25
- ### WGSL FP32
26
-
27
- Profiled GPU total: 35.26 ms
28
-
29
- | Node | GPU ms |
30
- | --- | ---: |
31
- | dec_conv1a | 6.84 |
32
- | dec_conv2a | 4.44 |
33
- | dec_conv1b | 3.76 |
34
- | enc_conv1b | 3.70 |
35
- | dec_conv3a | 2.35 |
36
-
37
- ### WGSL FP16
38
-
39
- Profiled GPU total: 27.00 ms
40
-
41
- | Node | GPU ms |
42
- | --- | ---: |
43
- | dec_conv1a | 4.43 |
44
- | dec_conv1b | 3.11 |
45
- | enc_conv1b | 3.10 |
46
- | dec_conv2a | 3.04 |
47
- | enc_conv2b | 2.06 |