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,379 +0,0 @@
1
- {
2
- "generatedAt": "2026-08-20T03:55:26.300Z",
3
- "currentCommit": "5d9c1c8771e2a03c90bfadafec4b5dd28fada446",
4
- "baselineCommit": "136c00c34aa5cf4561b4137034dbd643177f0a5f",
5
- "settings": {
6
- "width": 512,
7
- "height": 512,
8
- "tileSize": 512,
9
- "warmup": 1,
10
- "runs": 3,
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": 8.299999997019768,
27
- "timesMs": [
28
- 34.79999999701977,
29
- 34.80000000447035,
30
- 35.099999994039536
31
- ],
32
- "supportsFP16": true,
33
- "adapter": {
34
- "vendor": "apple",
35
- "architecture": "metal-3",
36
- "device": "",
37
- "description": ""
38
- },
39
- "summary": {
40
- "minMs": 34.79999999701977,
41
- "medianMs": 34.80000000447035,
42
- "meanMs": 34.899999998509884,
43
- "p95Ms": 35.099999994039536,
44
- "maxMs": 35.099999994039536
45
- },
46
- "messages": []
47
- },
48
- {
49
- "label": "WGSL FP32",
50
- "bundle": "current",
51
- "baseline": false,
52
- "precision": "fp32",
53
- "initializationMs": 364.1000000014901,
54
- "timesMs": [
55
- 44.399999998509884,
56
- 44.29999999701977,
57
- 44.30000000447035
58
- ],
59
- "executionProfile": {
60
- "totalMs": 43.114608999999994,
61
- "layers": [
62
- {
63
- "id": "input-pack",
64
- "durationMs": 0.051331
65
- },
66
- {
67
- "id": "enc_conv1a",
68
- "durationMs": 1.075535
69
- },
70
- {
71
- "id": "enc_conv1b",
72
- "durationMs": 4.384257
73
- },
74
- {
75
- "id": "pool1",
76
- "durationMs": 0.427856
77
- },
78
- {
79
- "id": "enc_conv2a",
80
- "durationMs": 1.691547
81
- },
82
- {
83
- "id": "enc_conv2b",
84
- "durationMs": 2.616881
85
- },
86
- {
87
- "id": "pool2",
88
- "durationMs": 0.058622
89
- },
90
- {
91
- "id": "enc_conv3a",
92
- "durationMs": 0.879335
93
- },
94
- {
95
- "id": "enc_conv3b",
96
- "durationMs": 1.164155
97
- },
98
- {
99
- "id": "pool3",
100
- "durationMs": 0.018041
101
- },
102
- {
103
- "id": "enc_conv4a",
104
- "durationMs": 0.479519
105
- },
106
- {
107
- "id": "enc_conv4b",
108
- "durationMs": 0.718842
109
- },
110
- {
111
- "id": "pool4",
112
- "durationMs": 0.008333
113
- },
114
- {
115
- "id": "enc_conv5a",
116
- "durationMs": 0.290444
117
- },
118
- {
119
- "id": "enc_conv5b",
120
- "durationMs": 0.399815
121
- },
122
- {
123
- "id": "up4",
124
- "durationMs": 0.012708
125
- },
126
- {
127
- "id": "concat4",
128
- "durationMs": 0.028624
129
- },
130
- {
131
- "id": "dec_conv4a",
132
- "durationMs": 1.42856
133
- },
134
- {
135
- "id": "dec_conv4b",
136
- "durationMs": 0.71805
137
- },
138
- {
139
- "id": "up3",
140
- "durationMs": 0.027998
141
- },
142
- {
143
- "id": "concat3",
144
- "durationMs": 0.077538
145
- },
146
- {
147
- "id": "dec_conv3a",
148
- "durationMs": 2.706668
149
- },
150
- {
151
- "id": "dec_conv3b",
152
- "durationMs": 1.165947
153
- },
154
- {
155
- "id": "up2",
156
- "durationMs": 0.105162
157
- },
158
- {
159
- "id": "concat2",
160
- "durationMs": 0.323193
161
- },
162
- {
163
- "id": "dec_conv2a",
164
- "durationMs": 5.015021
165
- },
166
- {
167
- "id": "dec_conv2b",
168
- "durationMs": 2.499719
169
- },
170
- {
171
- "id": "up1",
172
- "durationMs": 0.605389
173
- },
174
- {
175
- "id": "concat1",
176
- "durationMs": 1.633925
177
- },
178
- {
179
- "id": "dec_conv1a",
180
- "durationMs": 7.587153
181
- },
182
- {
183
- "id": "dec_conv1b",
184
- "durationMs": 4.422256
185
- },
186
- {
187
- "id": "dec_conv1c",
188
- "durationMs": 0.492185
189
- }
190
- ]
191
- },
192
- "runtimeInfo": {
193
- "configuredEngine": "wgsl",
194
- "gpuEngine": "wgsl",
195
- "precision": "fp32",
196
- "model": "oidn-unet-large-v1",
197
- "modelFamily": "oidn-unet-large",
198
- "inputChannels": 9,
199
- "dynamicTile": {
200
- "enabled": false,
201
- "currentTileSize": 512,
202
- "minTileSize": 256,
203
- "maxTileSize": 512,
204
- "targetTileTimeMs": 16
205
- },
206
- "lastExecution": {
207
- "width": 512,
208
- "height": 512,
209
- "tileWidth": 512,
210
- "tileHeight": 512,
211
- "tileCount": 1,
212
- "durationMs": 44.899999998509884,
213
- "tileTimeMs": {
214
- "min": 44.899999998509884,
215
- "median": 44.899999998509884,
216
- "mean": 44.899999998509884,
217
- "max": 44.899999998509884
218
- }
219
- }
220
- },
221
- "supportsFP16": true,
222
- "adapter": {
223
- "vendor": "apple",
224
- "architecture": "metal-3",
225
- "device": "",
226
- "description": ""
227
- },
228
- "summary": {
229
- "minMs": 44.29999999701977,
230
- "medianMs": 44.30000000447035,
231
- "meanMs": 44.333333333333336,
232
- "p95Ms": 44.399999998509884,
233
- "maxMs": 44.399999998509884
234
- },
235
- "messages": []
236
- },
237
- {
238
- "label": "WGSL FP16",
239
- "bundle": "current",
240
- "baseline": false,
241
- "precision": "fp16",
242
- "initializationMs": 24.400000005960464,
243
- "timesMs": [
244
- 32.20000000298023,
245
- 32,
246
- 31.700000002980232
247
- ],
248
- "executionProfile": {
249
- "totalMs": 30.610730000000004,
250
- "layers": [
251
- {
252
- "id": "input-pack",
253
- "durationMs": 0.044912
254
- },
255
- {
256
- "id": "enc_conv1a",
257
- "durationMs": 0.736504
258
- },
259
- {
260
- "id": "pool1",
261
- "durationMs": 4.125226
262
- },
263
- {
264
- "id": "enc_conv2a",
265
- "durationMs": 1.511755
266
- },
267
- {
268
- "id": "pool2",
269
- "durationMs": 2.272299
270
- },
271
- {
272
- "id": "enc_conv3a",
273
- "durationMs": 0.756544
274
- },
275
- {
276
- "id": "pool3",
277
- "durationMs": 0.952523
278
- },
279
- {
280
- "id": "enc_conv4a",
281
- "durationMs": 0.358379
282
- },
283
- {
284
- "id": "pool4",
285
- "durationMs": 0.594353
286
- },
287
- {
288
- "id": "enc_conv5a",
289
- "durationMs": 0.195479
290
- },
291
- {
292
- "id": "enc_conv5b",
293
- "durationMs": 0.254514
294
- },
295
- {
296
- "id": "dec_conv4a",
297
- "durationMs": 0.958315
298
- },
299
- {
300
- "id": "dec_conv4b",
301
- "durationMs": 0.53736
302
- },
303
- {
304
- "id": "dec_conv3a",
305
- "durationMs": 1.762187
306
- },
307
- {
308
- "id": "dec_conv3b",
309
- "durationMs": 0.986186
310
- },
311
- {
312
- "id": "dec_conv2a",
313
- "durationMs": 3.202408
314
- },
315
- {
316
- "id": "dec_conv2b",
317
- "durationMs": 2.344416
318
- },
319
- {
320
- "id": "dec_conv1a",
321
- "durationMs": 4.699998
322
- },
323
- {
324
- "id": "dec_conv1b",
325
- "durationMs": 4.069482
326
- },
327
- {
328
- "id": "dec_conv1c",
329
- "durationMs": 0.24789
330
- }
331
- ]
332
- },
333
- "runtimeInfo": {
334
- "configuredEngine": "wgsl",
335
- "gpuEngine": "wgsl",
336
- "precision": "fp16",
337
- "model": "oidn-unet-large-v1",
338
- "modelFamily": "oidn-unet-large",
339
- "inputChannels": 9,
340
- "dynamicTile": {
341
- "enabled": false,
342
- "currentTileSize": 512,
343
- "minTileSize": 256,
344
- "maxTileSize": 512,
345
- "targetTileTimeMs": 16
346
- },
347
- "lastExecution": {
348
- "width": 512,
349
- "height": 512,
350
- "tileWidth": 512,
351
- "tileHeight": 512,
352
- "tileCount": 1,
353
- "durationMs": 32.19999999552965,
354
- "tileTimeMs": {
355
- "min": 32.19999999552965,
356
- "median": 32.19999999552965,
357
- "mean": 32.19999999552965,
358
- "max": 32.19999999552965
359
- }
360
- }
361
- },
362
- "supportsFP16": true,
363
- "adapter": {
364
- "vendor": "apple",
365
- "architecture": "metal-3",
366
- "device": "",
367
- "description": ""
368
- },
369
- "summary": {
370
- "minMs": 31.700000002980232,
371
- "medianMs": 32,
372
- "meanMs": 31.966666668653488,
373
- "p95Ms": 32.20000000298023,
374
- "maxMs": 32.20000000298023
375
- },
376
- "messages": []
377
- }
378
- ]
379
- }
@@ -1,12 +0,0 @@
1
- # oidn-web benchmark
2
-
3
- - Current: `5d9c1c8771e2a03c90bfadafec4b5dd28fada446`
4
- - TFJS baseline: `136c00c34aa5cf4561b4137034dbd643177f0a5f`
5
- - Input: 512x512, fixed tile 512, 3 runs after 1 warmup(s)
6
- - Adapter: apple
7
-
8
- | Runtime | Init ms | Median ms | P95 ms | Speedup | Precision |
9
- | --- | ---: | ---: | ---: | ---: | --- |
10
- | TFJS (136c00c) | 8.30 | 34.80 | 35.10 | 1.00x | fp32 |
11
- | WGSL FP32 | 364.10 | 44.30 | 44.40 | 0.79x | fp32 |
12
- | WGSL FP16 | 24.40 | 32.00 | 32.20 | 1.09x | fp16 |