doppler-gpu 0.4.8 → 0.4.10

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 (66) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +62 -12
  3. package/models/catalog.json +21 -7
  4. package/package.json +25 -1
  5. package/src/config/conversion/qwen3/qwen-3-5-9b-f16-af32.json +474 -0
  6. package/src/config/conversion/qwen3/qwen-3-5-9b-q4k-ehaf16.json +509 -0
  7. package/src/config/kernels/backward-registry.json +13 -2
  8. package/src/config/kernels/kernel-ref-digests.js +8 -4
  9. package/src/config/kernels/registry.json +1035 -2677
  10. package/src/config/runtime/profiles/qwen-3-5-9b-metal-correctness.json +46 -0
  11. package/src/config/schema/training-metrics.schema.js +4 -0
  12. package/src/experimental/bridge/trainer-artifact-bridge.d.ts +161 -0
  13. package/src/experimental/bridge/trainer-artifact-bridge.js +573 -0
  14. package/src/experimental/training/attention-backward.js +123 -55
  15. package/src/experimental/training/autograd.js +101 -5
  16. package/src/experimental/training/clip.js +6 -1
  17. package/src/experimental/training/datasets/text-pairs.js +80 -8
  18. package/src/experimental/training/distillation/student-fixture.js +470 -114
  19. package/src/experimental/training/lora-pipeline.js +202 -27
  20. package/src/experimental/training/lora.js +10 -4
  21. package/src/experimental/training/optimizer.js +9 -1
  22. package/src/experimental/training/runner.js +18 -4
  23. package/src/experimental/training/workloads.js +11 -0
  24. package/src/gpu/device.js +100 -32
  25. package/src/gpu/kernels/backward/adam.js +6 -4
  26. package/src/gpu/kernels/backward/causal_conv1d_silu_backward.d.ts +24 -0
  27. package/src/gpu/kernels/backward/causal_conv1d_silu_backward.js +74 -0
  28. package/src/gpu/kernels/backward/causal_conv1d_silu_backward.wgsl +59 -0
  29. package/src/gpu/kernels/backward/cross_entropy_backward.wgsl +4 -0
  30. package/src/gpu/kernels/backward/gated_delta_recurrent_backward.d.ts +39 -0
  31. package/src/gpu/kernels/backward/gated_delta_recurrent_backward.js +124 -0
  32. package/src/gpu/kernels/backward/gated_delta_recurrent_backward.wgsl +177 -0
  33. package/src/gpu/kernels/backward/gated_rmsnorm_backward.d.ts +32 -0
  34. package/src/gpu/kernels/backward/gated_rmsnorm_backward.js +90 -0
  35. package/src/gpu/kernels/backward/gated_rmsnorm_backward.wgsl +86 -0
  36. package/src/gpu/kernels/backward/index.d.ts +3 -0
  37. package/src/gpu/kernels/backward/index.js +3 -0
  38. package/src/gpu/kernels/backward/matmul_backward.wgsl +6 -6
  39. package/src/gpu/kernels/backward/matmul_backward_f16w.wgsl +82 -0
  40. package/src/gpu/kernels/backward/rmsnorm_backward.js +26 -4
  41. package/src/gpu/kernels/backward/rmsnorm_backward.wgsl +6 -3
  42. package/src/gpu/kernels/backward/utils.d.ts +12 -2
  43. package/src/gpu/kernels/backward/utils.js +9 -2
  44. package/src/gpu/kernels/cast_f16_to_f32.wgsl +6 -2
  45. package/src/gpu/kernels/index.d.ts +5 -0
  46. package/src/gpu/kernels/index.js +5 -0
  47. package/src/gpu/kernels/matmul-selection.js +5 -0
  48. package/src/gpu/kernels/silu.d.ts +1 -0
  49. package/src/gpu/kernels/silu.js +19 -4
  50. package/src/inference/pipelines/text/embed.js +1 -1
  51. package/src/inference/pipelines/text/execution-v1.js +8 -2
  52. package/src/inference/pipelines/text/ffn/dense.js +2 -0
  53. package/src/inference/pipelines/text/generator.js +29 -0
  54. package/src/inference/pipelines/text/lora-apply.js +4 -4
  55. package/src/inference/pipelines/text/moe-cpu.js +1 -0
  56. package/src/inference/pipelines/text/moe-gpu.js +1 -0
  57. package/src/inference/tokenizers/bundled.js +105 -32
  58. package/src/rules/kernels/matmul.rules.json +1 -0
  59. package/src/tooling/node-converter.js +20 -5
  60. package/src/tooling/runtime-optimization.d.ts +109 -0
  61. package/src/tooling/runtime-optimization.js +872 -0
  62. package/src/tooling-experimental-exports.shared.d.ts +25 -0
  63. package/src/tooling-experimental-exports.shared.js +18 -0
  64. package/src/tooling-exports.shared.d.ts +19 -0
  65. package/src/tooling-exports.shared.js +11 -0
  66. package/src/version.js +1 -1
package/CHANGELOG.md CHANGED
@@ -8,6 +8,35 @@ docs so the `0.1.x` line has one conventional npm-visible history surface.
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.4.10] - 2026-07-18
12
+
13
+ ### Fixed
14
+
15
+ - Unified duplicate runtime module instances behind one authoritative WebGPU
16
+ device state and one in-flight initialization, preventing concurrent model
17
+ handles from creating incompatible devices.
18
+ - Rejected tracked cross-device GPU buffers before native bind-group creation
19
+ and prevented stale device-loss callbacks from clearing a replacement device.
20
+
21
+ ### Changed
22
+
23
+ - Included the WGSL Writer V3 package and campaign schemas in the generated npm
24
+ source closure.
25
+ - Retained the experimental
26
+ `translategemma-4b-1b-enes-q4k-ehf16-af32` NativeKD2 EN/ES candidate first
27
+ shipped in `0.4.8`, without changing its weights, evidence boundary, or
28
+ promotion status. Version `0.4.10` makes no new translation-model claim.
29
+
30
+ ## [0.4.9] - 2026-07-14
31
+
32
+ ### Fixed
33
+
34
+ - Corrected split gated SiLU/SwiGLU inference so dense and MoE FFNs compute
35
+ `SiLU(gate) * up` instead of applying SiLU to the up branch a second time.
36
+ Gated callers now fail closed unless the input-branch activation is explicit.
37
+ - Restored Qwen 3.5 9B F16 base and PEFT adapter parity with Transformers on the
38
+ frozen WGSL-repair probe without changing model, tokenizer, or adapter bytes.
39
+
11
40
  ## [0.4.8] - 2026-07-11
12
41
 
13
42
  ### Added
package/README.md CHANGED
@@ -24,13 +24,13 @@ npx doppler-gpu
24
24
 
25
25
  ## Evidence
26
26
 
27
- Doppler has lower steady-state inference latency than Transformers.js in each
27
+ Doppler has higher steady-state inference throughput than Transformers.js in each
28
28
  of the comparable browser WebGPU results indexed below.
29
29
 
30
- ![Metal and Vulkan browser WebGPU latency distributions](https://raw.githubusercontent.com/clocksmith/doppler/main/assets/doppler-webgpu-evidence.svg)
30
+ ![Metal and Vulkan browser WebGPU throughput distributions](https://raw.githubusercontent.com/clocksmith/doppler/main/assets/doppler-webgpu-evidence.svg)
31
31
 
32
- For text, faster means lower decode ms/token; for retrieval it means lower
33
- ms/embedding or ms/rerank. Every comparison passes its declared workload
32
+ Text uses tok/s, embeddings use embedding/s, and reranking uses rerank/s;
33
+ higher is faster. Every comparison passes its declared workload
34
34
  correctness gate. Model loading is separate: Transformers.js loads the Vulkan
35
35
  embedding and reranker artifacts faster. The
36
36
  [competition scoreboard](https://github.com/clocksmith/doppler/blob/main/docs/model-competition-scoreboard.md) links every
@@ -68,14 +68,64 @@ benchmark gates.
68
68
 
69
69
  ## How it works
70
70
 
71
- ```text
72
- +----------+ +------------------+ +--------------+ +-----------------+ +------------------+
73
- | Contract | --> | Candidate | --> | Parity gate | --> | Benchmark gate | --> | Retain or reject |
74
- | RDRR / | | model / plan / | | correctness | | comparable | | receipts / |
75
- | request | | kernel edit | | vs reference | | speed vs prior | | findings |
76
- +----------+ +------------------+ +--------------+ +-----------------+ +--------+---------+
77
- |
78
- next search <------+
71
+ ```mermaid
72
+ flowchart TB
73
+ subgraph Propose["1 · Propose"]
74
+ direction LR
75
+ HUMAN["Engineer or optimizer"]
76
+ CANDIDATE["Candidate edit<br/>manifest · plan · WGSL"]
77
+ HUMAN --> CANDIDATE
78
+ end
79
+
80
+ subgraph Run["2 · Resolve and run"]
81
+ direction LR
82
+ ARTIFACT["RDRR artifact<br/>manifest · weights · tokenizer"]
83
+ REQUEST["Request + runtime profile"]
84
+ VALIDATE["Validate contracts"]
85
+ RESOLVE["Resolve execution graph<br/>kernel refs · session"]
86
+ LOAD["Load + bind<br/>GPU buffers · cache"]
87
+ DISPATCH["Dispatch WGSL<br/>prefill · decode · retrieval"]
88
+ OUTPUT["Tokens · embeddings · scores"]
89
+
90
+ ARTIFACT --> VALIDATE
91
+ REQUEST --> VALIDATE
92
+ CANDIDATE --> VALIDATE
93
+ VALIDATE --> RESOLVE --> LOAD --> DISPATCH --> OUTPUT
94
+ end
95
+
96
+ subgraph Verify["3 · Evidence disposes"]
97
+ direction LR
98
+ PARITY{"Parity gate<br/>correct vs reference"}
99
+ BENCH{"Benchmark gate<br/>comparable speed vs prior"}
100
+ RETAIN["Retain<br/>versioned lane + receipt"]
101
+ REJECT["Reject<br/>finding + negative result"]
102
+
103
+ OUTPUT --> PARITY
104
+ PARITY -- pass --> BENCH
105
+ PARITY -- mismatch --> REJECT
106
+ BENCH -- pass --> RETAIN
107
+ BENCH -- fail --> REJECT
108
+ end
109
+
110
+ RETAIN -. reusable asset .-> HUMAN
111
+ REJECT -. search memory .-> HUMAN
112
+
113
+ classDef proposal fill:#fff1f3,stroke:#ff6b7a,color:#08090c,stroke-width:2px;
114
+ classDef runtime fill:#eef4ff,stroke:#5d8dff,color:#08090c,stroke-width:2px;
115
+ classDef gate fill:#f7f1ff,stroke:#b98cff,color:#08090c,stroke-width:2px;
116
+ classDef accepted fill:#08090c,stroke:#5d8dff,color:#ffffff,stroke-width:3px;
117
+ classDef rejected fill:#fff1f3,stroke:#ff6b7a,color:#08090c,stroke-width:2px;
118
+
119
+ class HUMAN,CANDIDATE proposal;
120
+ class ARTIFACT,REQUEST,VALIDATE,RESOLVE,LOAD,DISPATCH,OUTPUT runtime;
121
+ class PARITY,BENCH gate;
122
+ class RETAIN accepted;
123
+ class REJECT rejected;
124
+
125
+ style Propose fill:#fffafa,stroke:#ff6b7a,stroke-width:1px
126
+ style Run fill:#f8faff,stroke:#5d8dff,stroke-width:1px
127
+ style Verify fill:#fcfaff,stroke:#b98cff,stroke-width:1px
128
+ linkStyle default stroke:#5d8dff,stroke-width:2px;
79
129
  ```
80
130
 
81
131
  The full resolve, load, bind, dispatch, and readback flow lives in the
@@ -29,6 +29,10 @@
29
29
  },
30
30
  "baseUrl": null,
31
31
  "quickstart": true,
32
+ "demoVisible": true,
33
+ "demoLabel": "Gemma 3 270M",
34
+ "demoRole": "Stable F32 browser lane",
35
+ "demoSortOrder": 10,
32
36
  "sizeBytes": 418518521,
33
37
  "recommended": false,
34
38
  "sortOrder": 10,
@@ -228,6 +232,8 @@
228
232
  },
229
233
  "baseUrl": null,
230
234
  "quickstart": true,
235
+ "demoLabel": "Gemma 3 1B",
236
+ "demoRole": "Larger Gemma text model",
231
237
  "sizeBytes": 1044786820,
232
238
  "recommended": false,
233
239
  "sortOrder": 12,
@@ -359,6 +365,9 @@
359
365
  },
360
366
  "baseUrl": null,
361
367
  "quickstart": true,
368
+ "demoLabel": "Gemma 4 E2B",
369
+ "demoRole": "Gemma 4 text and vision",
370
+ "demoSortOrder": 14,
362
371
  "demoPreferredVariantId": "gemma-4-e2b-it-q4k-ehf16-af16-int4ple",
363
372
  "sizeBytes": 4009916310,
364
373
  "recommended": false,
@@ -719,7 +728,7 @@
719
728
  },
720
729
  "baseUrl": null,
721
730
  "quickstart": false,
722
- "demoVisible": true,
731
+ "demoVisible": false,
723
732
  "demoPreferredVariantId": "gemma-4-31b-it-text-q4k-ehf16-af16",
724
733
  "demoWarningBadges": [
725
734
  "19.3 GB / High RAM"
@@ -846,11 +855,8 @@
846
855
  "baseUrl": null,
847
856
  "quickstart": false,
848
857
  "demoVisible": true,
849
- "demoWarningBadges": [
850
- "Experimental",
851
- "EN ↔ ES only"
852
- ],
853
- "demoWarningText": "Experimental translation specialist. Public evidence is limited to EN/ES and does not establish general multilingual quality.",
858
+ "demoLabel": "TranslateGemma EN/ES",
859
+ "demoRole": "English and Spanish translation",
854
860
  "sizeBytes": 1025493248,
855
861
  "recommended": false,
856
862
  "sortOrder": 14.9,
@@ -1272,6 +1278,10 @@
1272
1278
  },
1273
1279
  "baseUrl": null,
1274
1280
  "quickstart": true,
1281
+ "demoVisible": true,
1282
+ "demoLabel": "Qwen 3.5 0.8B",
1283
+ "demoRole": "Compact general text",
1284
+ "demoSortOrder": 20,
1275
1285
  "sizeBytes": 1155348912,
1276
1286
  "recommended": false,
1277
1287
  "sortOrder": 20,
@@ -1357,6 +1367,10 @@
1357
1367
  },
1358
1368
  "baseUrl": null,
1359
1369
  "quickstart": true,
1370
+ "demoVisible": true,
1371
+ "demoLabel": "Qwen 3.5 2B",
1372
+ "demoRole": "Higher-capacity text",
1373
+ "demoSortOrder": 30,
1360
1374
  "sizeBytes": 2496068973,
1361
1375
  "recommended": false,
1362
1376
  "sortOrder": 21,
@@ -1423,7 +1437,7 @@
1423
1437
  },
1424
1438
  "baseUrl": null,
1425
1439
  "quickstart": false,
1426
- "demoVisible": true,
1440
+ "demoVisible": false,
1427
1441
  "demoPreferredVariantId": "qwen-3-6-27b-q4k-eaf16",
1428
1442
  "demoWarningBadges": [
1429
1443
  "15.8 GB / High RAM"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doppler-gpu",
3
- "version": "0.4.8",
3
+ "version": "0.4.10",
4
4
  "description": "Browser-native WebGPU inference engine for local intent and inference loops",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -21,6 +21,8 @@
21
21
  "lean:check": "./lean/check.sh",
22
22
  "ci:lean:execution-contract:configs": "node tools/lean-execution-contract-config-sweep.js --config-root src/config/conversion --manifest-root models --require-manifest-match",
23
23
  "contracts:check": "node tools/check-contract-artifacts.js",
24
+ "trainer-handoff:verify": "node tools/verify-trainer-artifact-handoff.js verify --contract tools/policies/nativekd2-bf16-baseline-handoff.json --repo-root clocksmith/doppler=. --repo-root clocksmith/gamma=../gamma",
25
+ "trainer-handoff:import": "node tools/verify-trainer-artifact-handoff.js import --contract tools/policies/nativekd2-bf16-baseline-handoff.json --repo-root clocksmith/doppler=. --repo-root clocksmith/gamma=../gamma",
24
26
  "program-bundle:export": "node tools/export-program-bundle.js",
25
27
  "program-bundle:reference": "node tools/run-program-bundle-reference.js",
26
28
  "program-bundle:reference:gemma4-int4ple": "node tools/run-program-bundle-reference.js --manifest models/local/gemma-4-e2b-it-q4k-ehf16-af32-int4ple/manifest.json --conversion-config src/config/conversion/gemma4/gemma-4-e2b-it-q4k-ehf16-af32-int4ple.json --out examples/program-bundles/gemma-4-e2b-it-q4k-ehf16-af32-int4ple.program-bundle.json --surface browser --prompt \"The color of the sky is\" --max-tokens 8",
@@ -34,6 +36,28 @@
34
36
  "ci:training:contract": "node tools/ci-training-contract-gates.js",
35
37
  "training:teachers:verify": "node tools/verify-host-teacher-contracts.js",
36
38
  "training:teachers:qualify": "node tools/qualify-code-teachers.js",
39
+ "training:students:verify": "node tools/verify-student-code-experiment.js",
40
+ "training:students:run": "node tools/run-student-code-experiment.js",
41
+ "training:wgsl:corpus": "node tools/build-wgsl-repair-corpus.js",
42
+ "training:wgsl:experiment": "node tools/run-wgsl-repair-experiment.js",
43
+ "training:wgsl:rollouts": "node tools/run-wgsl-repair-rollouts.js",
44
+ "training:wgsl:semantic": "node tools/run-wgsl-repair-semantic-harness.js",
45
+ "training:wgsl:writer:semantic": "node tools/run-wgsl-writer-semantic-harness.js",
46
+ "training:wgsl:writer:candidate": "node tools/run-wgsl-writer-candidate.js",
47
+ "training:wgsl:writer:corpus": "node tools/build-wgsl-writer-corpus.js",
48
+ "training:wgsl:writer:corpus:check": "node tools/build-wgsl-writer-corpus.js --check",
49
+ "training:wgsl:writer:corpus:qualify": "node tools/qualify-wgsl-writer-corpus.js",
50
+ "training:wgsl:writer:workloads:check": "node tools/materialize-wgsl-writer-v2-seed-workloads.js --check",
51
+ "training:wgsl:writer:train": "node tools/run-wgsl-writer-v2-training.js",
52
+ "training:wgsl:writer:evaluate": "node tools/run-wgsl-writer-v2-evaluation.js",
53
+ "training:wgsl:writer:select": "node tools/select-wgsl-writer-v2-seed.js",
54
+ "training:wgsl:writer:confirm": "node tools/finalize-wgsl-writer-v2-confirmation.js",
55
+ "training:wgsl:writer:parity": "node tools/run-wgsl-writer-v2-parity.js",
56
+ "training:wgsl:writer:result": "node tools/finalize-wgsl-writer-v2-result.js",
57
+ "training:wgsl:author:contract": "node tools/run-node-tests.js tests/tooling/wgsl-author-package.test.js tests/tooling/wgsl-author-execution-plan.test.js tests/tooling/wgsl-author-browser-executor.test.js tests/tooling/wgsl-author-reference.test.js tests/training/wgsl-writer-v3-contract.test.js",
58
+ "training:wgsl:author:reference": "node tools/run-wgsl-author-v3-reference.js",
59
+ "training:wgsl:seed-candidates": "node tools/run-wgsl-repair-seed-candidates.js",
60
+ "training:wgsl:seed-select": "node tools/select-wgsl-repair-v13-seed.js",
37
61
  "training:contract:delta": "node tools/emit-training-contract-delta.js",
38
62
  "training:workloads:verify": "node tools/verify-training-workload-packs.js --registry src/experimental/training/workload-packs/registry.json",
39
63
  "training:report-ids:publish": "node tools/publish-training-report-ids.js --registry src/experimental/training/workload-packs/registry.json",