doppler-gpu 0.2.0 → 0.2.2

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 (607) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/README.md +97 -29
  3. package/package.json +40 -27
  4. package/src/cli/config/doppler-quickstart.json +10 -0
  5. package/src/cli/doppler-cli.js +66 -22
  6. package/src/cli/doppler-quickstart.d.ts +61 -0
  7. package/src/cli/doppler-quickstart.js +299 -0
  8. package/src/cli/doppler-serve.js +395 -0
  9. package/src/client/doppler-api.browser.js +13 -377
  10. package/src/client/doppler-api.d.ts +35 -56
  11. package/src/client/doppler-api.js +12 -363
  12. package/src/client/doppler-registry.json +55 -2
  13. package/src/client/runtime/index.d.ts +63 -0
  14. package/src/client/runtime/index.js +173 -0
  15. package/src/client/runtime/lora.d.ts +36 -0
  16. package/src/client/runtime/lora.js +165 -0
  17. package/src/client/{doppler-provider → runtime}/model-manager.d.ts +1 -1
  18. package/src/client/{doppler-provider → runtime}/model-manager.js +56 -30
  19. package/src/client/runtime/model-session.d.ts +72 -0
  20. package/src/client/runtime/model-session.js +122 -0
  21. package/src/client/runtime/model-source.d.ts +43 -0
  22. package/src/client/runtime/model-source.js +101 -0
  23. package/src/client/{doppler-provider → runtime}/source-runtime.d.ts +8 -5
  24. package/src/client/runtime/source-runtime.js +919 -0
  25. package/src/client/runtime/storage.d.ts +5 -0
  26. package/src/client/runtime/storage.js +51 -0
  27. package/src/client/{doppler-provider → runtime}/types.d.ts +14 -2
  28. package/src/config/README.md +2 -0
  29. package/src/config/conversion/README.md +47 -7
  30. package/src/config/conversion/embeddinggemma/google-embeddinggemma-300m-q4k-ehf16-af32.json +67 -5
  31. package/src/config/conversion/gemma3/gemma-3-1b-it-f16-af32.json +62 -11
  32. package/src/config/conversion/gemma3/gemma-3-1b-it-q4k-ehf16-af32.json +79 -18
  33. package/src/config/conversion/gemma3/gemma-3-270m-it-q4k-ehf16-af32.json +61 -13
  34. package/src/config/conversion/gemma3/translategemma-4b-1b-enes-q4k-ehf16-af32.json +53 -10
  35. package/src/config/conversion/gemma3/translategemma-4b-it-q4k-ehf16-af32.json +66 -18
  36. package/src/config/conversion/gemma4/gemma-4-e2b-it-q4k-ehf16-af32.json +256 -0
  37. package/src/config/conversion/gemma4/gemma-4-moe-q4k-ehf16-af32.json +49 -8
  38. package/src/config/conversion/gpt-oss-20b-f16-xmxfp4.json +45 -6
  39. package/src/config/conversion/janus/janus-pro-1b-text-q4k-ehaf16.json +45 -6
  40. package/src/config/conversion/lfm2/lfm2.5-1.2b-instruct-q4k-ehf16-af32.json +57 -9
  41. package/src/config/conversion/qwen3/qwen-3-5-0-8b-q4k-ehaf16.json +105 -26
  42. package/src/config/conversion/qwen3/qwen-3-5-2b-q4k-ehaf16.json +83 -33
  43. package/src/config/conversion/sana/sana-sprint-0.6b-f16.json +33 -5
  44. package/src/config/execution-contract-check.d.ts +2 -1
  45. package/src/config/execution-contract-check.js +187 -53
  46. package/src/config/kernel-path-loader.d.ts +36 -0
  47. package/src/config/kernel-path-loader.js +97 -10
  48. package/src/config/kernels/kernel-ref-digests.js +40 -24
  49. package/src/config/kernels/registry.js +0 -1
  50. package/src/config/kernels/registry.json +772 -66
  51. package/src/config/merge-contract-check.js +3 -0
  52. package/src/config/merge.d.ts +18 -1
  53. package/src/config/merge.js +56 -0
  54. package/src/config/param-categories.js +5 -0
  55. package/src/config/param-validator.js +42 -26
  56. package/src/config/platforms/apple-m3.json +1 -1
  57. package/src/config/platforms/loader.js +21 -16
  58. package/src/config/required-inference-fields-contract-check.js +16 -0
  59. package/src/config/runtime/compute/f16-batched.json +2 -0
  60. package/src/config/runtime/default.json +1 -0
  61. package/src/config/runtime/experiments/bench/gemma3-bench-q4k-alt.json +57 -0
  62. package/src/config/runtime/experiments/bench/gemma3-bench-q4k-batched.json +57 -0
  63. package/src/config/runtime/experiments/bench/gemma3-bench-q4k.json +2 -0
  64. package/src/config/runtime/experiments/bench/qwen3-bench-q4k-alt.json +57 -0
  65. package/src/config/runtime/experiments/bench/qwen3-bench-q4k-batched.json +57 -0
  66. package/src/config/runtime/experiments/debug/gemma3-browser-diagnose-q4k.json +81 -0
  67. package/src/config/runtime/experiments/debug/gemma3-debug-q4k.json +5 -0
  68. package/src/config/runtime/experiments/debug/qwen35-browser-diagnose-q4k.json +81 -0
  69. package/src/config/runtime/experiments/verify/gemma4-e2b-verify.json +38 -0
  70. package/src/config/runtime/profiles/gemma4-e2b-low-memory.json +63 -0
  71. package/src/config/runtime/profiles/gemma4-e2b-throughput.json +39 -0
  72. package/src/config/runtime/profiles/low-memory.json +1 -0
  73. package/src/config/runtime/profiles/turboquant-contiguous-prod.json +29 -0
  74. package/src/config/runtime/profiles/turboquant-contiguous.json +29 -0
  75. package/src/config/runtime/profiles/turboquant.json +36 -0
  76. package/src/config/runtime/profiles/vector-stability.json +1 -0
  77. package/src/config/runtime/tiers/gemma4-128gb.json +79 -0
  78. package/src/config/runtime/tiers/gemma4-16gb.json +15 -2
  79. package/src/config/runtime/tiers/gemma4-24gb.json +15 -2
  80. package/src/config/runtime/tiers/gemma4-32gb.json +15 -2
  81. package/src/config/runtime.js +11 -4
  82. package/src/config/schema/converter.schema.d.ts +4 -2
  83. package/src/config/schema/converter.schema.js +7 -5
  84. package/src/config/schema/doppler.schema.d.ts +26 -2
  85. package/src/config/schema/doppler.schema.js +77 -28
  86. package/src/config/schema/execution-v1.schema.d.ts +78 -5
  87. package/src/config/schema/execution-v1.schema.js +62 -1
  88. package/src/config/schema/index.d.ts +22 -29
  89. package/src/config/schema/index.js +15 -17
  90. package/src/config/schema/inference.schema.d.ts +26 -4
  91. package/src/config/schema/kernel-path.schema.d.ts +30 -3
  92. package/src/config/schema/kernel-registry.schema.d.ts +1 -1
  93. package/src/config/schema/kernel-registry.schema.js +1 -0
  94. package/src/config/schema/kvcache.schema.js +7 -0
  95. package/src/config/schema/loading.schema.d.ts +28 -0
  96. package/src/config/schema/loading.schema.js +9 -0
  97. package/src/config/schema/manifest.schema.d.ts +79 -5
  98. package/src/config/schema/manifest.schema.js +7 -1
  99. package/src/config/schema/platform.schema.d.ts +10 -8
  100. package/src/config/schema/speculation-self.schema.js +0 -5
  101. package/src/config/schema/support-tiers.schema.d.ts +53 -0
  102. package/src/config/schema/support-tiers.schema.js +128 -0
  103. package/src/config/source-packages/litert/gemma-4-e2b-it.json +622 -0
  104. package/src/config/source-packages/registry.json +15 -0
  105. package/src/config/support-tiers/subsystems.json +502 -0
  106. package/src/config/transforms/capability-transform-resolver.d.ts +16 -5
  107. package/src/config/transforms/capability-transform-resolver.js +44 -9
  108. package/src/config/transforms/execution-graph-transforms.d.ts +113 -2
  109. package/src/config/transforms/execution-graph-transforms.js +1220 -8
  110. package/src/converter/conversion-plan.js +20 -8
  111. package/src/converter/core.d.ts +48 -1
  112. package/src/converter/core.js +249 -62
  113. package/src/converter/parsers/gguf.d.ts +10 -1
  114. package/src/converter/rope-config.d.ts +1 -0
  115. package/src/converter/rope-config.js +75 -5
  116. package/src/converter/shard-packer.js +2 -2
  117. package/src/debug/tensor.js +13 -1
  118. package/src/{adapters → experimental/adapters}/adapter-manager.d.ts +1 -1
  119. package/src/{adapters → experimental/adapters}/adapter-manager.js +2 -2
  120. package/src/{adapters → experimental/adapters}/adapter-manifest.d.ts +1 -1
  121. package/src/{adapters → experimental/adapters}/adapter-manifest.js +1 -1
  122. package/src/{adapters → experimental/adapters}/adapter-registry.d.ts +1 -1
  123. package/src/{adapters → experimental/adapters}/adapter-registry.js +1 -1
  124. package/src/{adapters → experimental/adapters}/lora-loader.d.ts +1 -1
  125. package/src/{adapters → experimental/adapters}/lora-loader.js +2 -2
  126. package/src/{bridge → experimental/bridge}/extension-client.js +2 -2
  127. package/src/{bridge → experimental/bridge}/node-bridge.js +2 -4
  128. package/src/{bridge → experimental/bridge}/protocol.js +1 -1
  129. package/src/{browser → experimental/browser}/browser-converter.d.ts +4 -4
  130. package/src/{browser → experimental/browser}/browser-converter.js +12 -12
  131. package/src/{browser → experimental/browser}/gguf-importer.d.ts +1 -1
  132. package/src/{browser → experimental/browser}/gguf-importer.js +8 -8
  133. package/src/{browser → experimental/browser}/gguf-parser-browser.d.ts +2 -2
  134. package/src/{browser → experimental/browser}/gguf-parser-browser.js +3 -3
  135. package/src/{browser → experimental/browser}/quantization.d.ts +3 -3
  136. package/src/{browser → experimental/browser}/quantization.js +4 -4
  137. package/src/{browser → experimental/browser}/safetensors-parser-browser.d.ts +3 -3
  138. package/src/{browser → experimental/browser}/safetensors-parser-browser.js +3 -3
  139. package/src/{browser → experimental/browser}/shard-io-browser.d.ts +1 -1
  140. package/src/{browser → experimental/browser}/shard-io-browser.js +2 -2
  141. package/src/{browser → experimental/browser}/tensor-source-download.js +3 -3
  142. package/src/experimental/diffusion/index.d.ts +8 -0
  143. package/src/experimental/diffusion/index.js +8 -0
  144. package/src/{distribution → experimental/distribution}/p2p-transport-contract.js +1 -1
  145. package/src/{distribution → experimental/distribution}/p2p-transport.js +1 -1
  146. package/src/{distribution → experimental/distribution}/shard-delivery.js +5 -5
  147. package/src/experimental/energy/index.d.ts +2 -0
  148. package/src/experimental/energy/index.js +2 -0
  149. package/src/{hotswap → experimental/hotswap}/intent-bundle.d.ts +1 -1
  150. package/src/{hotswap → experimental/hotswap}/intent-bundle.js +2 -2
  151. package/src/{hotswap → experimental/hotswap}/manifest.d.ts +2 -2
  152. package/src/{hotswap → experimental/hotswap}/manifest.js +1 -1
  153. package/src/{hotswap → experimental/hotswap}/model-swap.js +1 -1
  154. package/src/{hotswap → experimental/hotswap}/runtime.d.ts +1 -1
  155. package/src/experimental/orchestration/index.d.ts +12 -0
  156. package/src/experimental/orchestration/index.js +12 -0
  157. package/src/{training → experimental/training}/README.md +1 -1
  158. package/src/{training → experimental/training}/artifacts.d.ts +3 -3
  159. package/src/{training → experimental/training}/artifacts.js +3 -3
  160. package/src/{training → experimental/training}/attention-backward.d.ts +1 -1
  161. package/src/{training → experimental/training}/attention-backward.js +3 -3
  162. package/src/{training → experimental/training}/attention-forward.d.ts +2 -2
  163. package/src/{training → experimental/training}/attention-forward.js +1 -1
  164. package/src/{training → experimental/training}/autograd.d.ts +2 -2
  165. package/src/{training → experimental/training}/autograd.js +7 -7
  166. package/src/{training → experimental/training}/backward-kernels.js +1 -1
  167. package/src/{training → experimental/training}/checkpoint.js +1 -1
  168. package/src/{training → experimental/training}/clip.d.ts +2 -2
  169. package/src/{training → experimental/training}/clip.js +3 -3
  170. package/src/{training → experimental/training}/export.d.ts +2 -2
  171. package/src/{training → experimental/training}/export.js +2 -2
  172. package/src/{training → experimental/training}/lora-pipeline.js +4 -4
  173. package/src/{training → experimental/training}/lora.d.ts +1 -1
  174. package/src/{training → experimental/training}/lora.js +4 -4
  175. package/src/{training → experimental/training}/loss-scaling.d.ts +2 -2
  176. package/src/{training → experimental/training}/loss-scaling.js +3 -3
  177. package/src/{training → experimental/training}/loss.d.ts +2 -2
  178. package/src/{training → experimental/training}/loss.js +1 -1
  179. package/src/{training → experimental/training}/operator-artifacts.js +1 -1
  180. package/src/{training → experimental/training}/optimizer.d.ts +2 -2
  181. package/src/{training → experimental/training}/optimizer.js +3 -3
  182. package/src/{training → experimental/training}/runner.d.ts +2 -2
  183. package/src/{training → experimental/training}/runner.js +5 -5
  184. package/src/{training → experimental/training}/suite.js +16 -16
  185. package/src/{training → experimental/training}/tensor-factory.d.ts +1 -1
  186. package/src/{training → experimental/training}/tensor-factory.js +2 -2
  187. package/src/{training → experimental/training}/trainer.d.ts +3 -3
  188. package/src/{training → experimental/training}/trainer.js +3 -3
  189. package/src/{training → experimental/training}/ul_dataset.d.ts +2 -2
  190. package/src/{training → experimental/training}/ul_dataset.js +1 -1
  191. package/src/{training → experimental/training}/ul_schedule.d.ts +1 -1
  192. package/src/{training → experimental/training}/workloads.js +4 -4
  193. package/src/formats/index.d.ts +24 -0
  194. package/src/formats/index.js +6 -0
  195. package/src/formats/litert/index.d.ts +1 -0
  196. package/src/formats/litert/index.js +1 -0
  197. package/src/formats/litert/types.d.ts +87 -0
  198. package/src/formats/litert/types.js +568 -0
  199. package/src/formats/rdrr/classification.js +16 -8
  200. package/src/formats/rdrr/parsing.d.ts +3 -2
  201. package/src/formats/rdrr/types.d.ts +33 -0
  202. package/src/formats/rdrr/validation.js +16 -5
  203. package/src/formats/tflite/index.d.ts +1 -0
  204. package/src/formats/tflite/index.js +1 -0
  205. package/src/formats/tflite/types.d.ts +84 -0
  206. package/src/formats/tflite/types.js +633 -0
  207. package/src/generation/index.d.ts +16 -14
  208. package/src/generation/index.js +1 -32
  209. package/src/gpu/command-recorder.d.ts +17 -1
  210. package/src/gpu/command-recorder.js +47 -10
  211. package/src/gpu/device.d.ts +3 -1
  212. package/src/gpu/device.js +17 -11
  213. package/src/gpu/kernel-selector.js +3 -1
  214. package/src/gpu/kernels/attention.d.ts +2 -0
  215. package/src/gpu/kernels/attention.js +359 -14
  216. package/src/gpu/kernels/attention.wgsl +20 -1
  217. package/src/gpu/kernels/attention_decode_contiguous_turboquant_f16kv.wgsl +180 -0
  218. package/src/gpu/kernels/attention_decode_contiguous_turboquant_prod_f16kv.wgsl +192 -0
  219. package/src/gpu/kernels/attention_decode_online_f16.wgsl +36 -18
  220. package/src/gpu/kernels/attention_decode_online_f16kv.wgsl +36 -18
  221. package/src/gpu/kernels/attention_decode_tiered_turboquant_f16kv.wgsl +269 -0
  222. package/src/gpu/kernels/attention_decode_tiered_turboquant_prod_f16kv.wgsl +281 -0
  223. package/src/gpu/kernels/attention_head256_f16kv.wgsl +269 -0
  224. package/src/gpu/kernels/attention_streaming.wgsl +22 -3
  225. package/src/gpu/kernels/attention_streaming_f16.wgsl +1 -1
  226. package/src/gpu/kernels/attention_streaming_f16kv.wgsl +1 -1
  227. package/src/gpu/kernels/backward/attention_backward.d.ts +14 -1
  228. package/src/gpu/kernels/check-hot-vocab-stop.d.ts +18 -0
  229. package/src/gpu/kernels/check-hot-vocab-stop.js +108 -0
  230. package/src/gpu/kernels/codegen/patches/attention_streaming_f16.from.attention_streaming.diff +1 -1
  231. package/src/gpu/kernels/codegen/patches/attention_streaming_f16kv.from.attention_streaming.diff +1 -1
  232. package/src/gpu/kernels/codegen/patches/rope_f16.from.rope.diff +126 -194
  233. package/src/gpu/kernels/codegen/wgsl-variants.js +24 -6
  234. package/src/gpu/kernels/depthwise_conv1d.d.ts +23 -0
  235. package/src/gpu/kernels/depthwise_conv1d.js +51 -0
  236. package/src/gpu/kernels/depthwise_conv1d.wgsl +46 -0
  237. package/src/gpu/kernels/feature-check.js +0 -1
  238. package/src/gpu/kernels/fused_ffn.js +67 -22
  239. package/src/gpu/kernels/fused_ffn_q4k.wgsl +48 -43
  240. package/src/gpu/kernels/fused_ffn_q4k_f16.wgsl +329 -0
  241. package/src/gpu/kernels/fused_matmul_q4.wgsl +417 -0
  242. package/src/gpu/kernels/fused_matmul_q4_batched_multicol_shared.wgsl +174 -0
  243. package/src/gpu/kernels/gather.d.ts +4 -0
  244. package/src/gpu/kernels/gather.js +13 -2
  245. package/src/gpu/kernels/gather.wgsl +5 -3
  246. package/src/gpu/kernels/gather_f16.wgsl +5 -3
  247. package/src/gpu/kernels/index.d.ts +7 -0
  248. package/src/gpu/kernels/index.js +6 -0
  249. package/src/gpu/kernels/kernel-configs.js +1 -0
  250. package/src/gpu/kernels/kv-quantize.js +87 -55
  251. package/src/gpu/kernels/kv_quantize_turboquant.wgsl +153 -0
  252. package/src/gpu/kernels/kv_quantize_turboquant_prod.wgsl +230 -0
  253. package/src/gpu/kernels/linear-attention-core.d.ts +3 -0
  254. package/src/gpu/kernels/linear-attention-core.js +145 -56
  255. package/src/gpu/kernels/matmul-dispatch.js +3 -0
  256. package/src/gpu/kernels/matmul-selection.js +31 -42
  257. package/src/gpu/kernels/matmul.d.ts +3 -0
  258. package/src/gpu/kernels/matmul.js +72 -34
  259. package/src/gpu/kernels/residual.d.ts +2 -0
  260. package/src/gpu/kernels/residual.js +43 -4
  261. package/src/gpu/kernels/rope.d.ts +2 -0
  262. package/src/gpu/kernels/rope.js +19 -6
  263. package/src/gpu/kernels/rope.wgsl +24 -12
  264. package/src/gpu/kernels/rope_f16.wgsl +97 -38
  265. package/src/gpu/kernels/scale.d.ts +5 -0
  266. package/src/gpu/kernels/scale.js +6 -1
  267. package/src/gpu/kernels/scale.wgsl +3 -1
  268. package/src/gpu/kernels/scale_f16.wgsl +32 -0
  269. package/src/gpu/kernels/turboquant-codebook.js +564 -0
  270. package/src/gpu/kernels/uniform-utils.js +26 -0
  271. package/src/gpu/kernels/utils.js +6 -1
  272. package/src/gpu/submit-probe.d.ts +12 -0
  273. package/src/gpu/submit-probe.js +77 -0
  274. package/src/gpu/weight-buffer.d.ts +26 -3
  275. package/src/gpu/weight-buffer.js +62 -2
  276. package/src/index-browser.d.ts +1 -91
  277. package/src/index-browser.js +0 -66
  278. package/src/index.d.ts +1 -102
  279. package/src/index.js +0 -74
  280. package/src/inference/browser-harness-model-helpers.d.ts +3 -0
  281. package/src/inference/browser-harness-model-helpers.js +134 -11
  282. package/src/inference/browser-harness-runtime-helpers.js +1 -9
  283. package/src/inference/browser-harness-text-helpers.js +441 -70
  284. package/src/inference/browser-harness.js +61 -4
  285. package/src/inference/decode-ring.d.ts +2 -0
  286. package/src/inference/decode-ring.js +20 -0
  287. package/src/inference/kv-cache/index.d.ts +3 -0
  288. package/src/inference/kv-cache/index.js +2 -0
  289. package/src/inference/kv-cache/mixed-geometry.d.ts +84 -0
  290. package/src/inference/kv-cache/mixed-geometry.js +422 -0
  291. package/src/inference/kv-cache/quantized.d.ts +56 -0
  292. package/src/inference/kv-cache/quantized.js +383 -0
  293. package/src/inference/kv-cache/tiered.d.ts +20 -3
  294. package/src/inference/kv-cache/tiered.js +203 -65
  295. package/src/inference/kv-cache/types.d.ts +49 -6
  296. package/src/inference/kv-cache.d.ts +3 -0
  297. package/src/inference/kv-cache.js +2 -0
  298. package/src/inference/multi-model-network.js +2 -1
  299. package/src/inference/pipelines/audio/gemma4.js +655 -0
  300. package/src/inference/pipelines/audio/index.js +39 -0
  301. package/src/inference/pipelines/audio/mel.js +171 -0
  302. package/src/inference/pipelines/context.js +9 -1
  303. package/src/inference/pipelines/diffusion/text-encoder-gpu.js +2 -0
  304. package/src/inference/pipelines/shared/clipped-linear.js +46 -0
  305. package/src/inference/pipelines/text/attention/dispatch-params.d.ts +2 -1
  306. package/src/inference/pipelines/text/attention/dispatch-params.js +52 -8
  307. package/src/inference/pipelines/text/attention/output-projection.js +3 -3
  308. package/src/inference/pipelines/text/attention/precision-contract.d.ts +36 -0
  309. package/src/inference/pipelines/text/attention/precision-contract.js +115 -0
  310. package/src/inference/pipelines/text/attention/projections.d.ts +23 -0
  311. package/src/inference/pipelines/text/attention/projections.js +182 -15
  312. package/src/inference/pipelines/text/attention/quant-options.js +54 -0
  313. package/src/inference/pipelines/text/attention/record.js +257 -69
  314. package/src/inference/pipelines/text/attention/run.js +306 -94
  315. package/src/inference/pipelines/text/attention/types.d.ts +11 -0
  316. package/src/inference/pipelines/text/chat-format.d.ts +8 -1
  317. package/src/inference/pipelines/text/chat-format.js +89 -5
  318. package/src/inference/pipelines/text/config.d.ts +78 -26
  319. package/src/inference/pipelines/text/config.js +722 -28
  320. package/src/inference/pipelines/text/dtype-contract.d.ts +15 -0
  321. package/src/inference/pipelines/text/dtype-contract.js +38 -0
  322. package/src/inference/pipelines/text/embed.d.ts +4 -0
  323. package/src/inference/pipelines/text/embed.js +165 -172
  324. package/src/inference/pipelines/text/execution-plan.d.ts +19 -0
  325. package/src/inference/pipelines/text/execution-plan.js +112 -20
  326. package/src/inference/pipelines/text/execution-runtime-builders.d.ts +8 -4
  327. package/src/inference/pipelines/text/execution-runtime-builders.js +90 -49
  328. package/src/inference/pipelines/text/execution-v1.d.ts +23 -4
  329. package/src/inference/pipelines/text/execution-v1.js +411 -33
  330. package/src/inference/pipelines/text/ffn/dense.d.ts +59 -0
  331. package/src/inference/pipelines/text/ffn/dense.js +575 -63
  332. package/src/inference/pipelines/text/ffn/moe.js +1 -0
  333. package/src/inference/pipelines/text/ffn/sandwich.js +20 -4
  334. package/src/inference/pipelines/text/ffn/standard.js +28 -4
  335. package/src/inference/pipelines/text/finiteness-policy.d.ts +4 -0
  336. package/src/inference/pipelines/text/finiteness-policy.js +14 -11
  337. package/src/inference/pipelines/text/generator-helpers.d.ts +7 -0
  338. package/src/inference/pipelines/text/generator-helpers.js +39 -4
  339. package/src/inference/pipelines/text/generator-runtime.js +45 -8
  340. package/src/inference/pipelines/text/generator-steps.js +407 -75
  341. package/src/inference/pipelines/text/generator.d.ts +6 -0
  342. package/src/inference/pipelines/text/generator.js +1179 -305
  343. package/src/inference/pipelines/text/init.d.ts +39 -7
  344. package/src/inference/pipelines/text/init.js +525 -110
  345. package/src/inference/pipelines/text/layer-plan.d.ts +1 -0
  346. package/src/inference/pipelines/text/layer-plan.js +2 -0
  347. package/src/inference/pipelines/text/layer.js +402 -19
  348. package/src/inference/pipelines/text/linear-attention.d.ts +4 -0
  349. package/src/inference/pipelines/text/linear-attention.js +112 -41
  350. package/src/inference/pipelines/text/logits/gpu.d.ts +2 -1
  351. package/src/inference/pipelines/text/logits/gpu.js +334 -15
  352. package/src/inference/pipelines/text/logits/index.d.ts +11 -0
  353. package/src/inference/pipelines/text/logits/index.js +227 -29
  354. package/src/inference/pipelines/text/logits/types.d.ts +3 -0
  355. package/src/inference/pipelines/text/logits/utils.js +3 -1
  356. package/src/inference/pipelines/text/lora-apply.js +3 -3
  357. package/src/inference/pipelines/text/model-load.d.ts +2 -1
  358. package/src/inference/pipelines/text/model-load.js +205 -178
  359. package/src/inference/pipelines/text/moe-gpu.js +8 -0
  360. package/src/inference/pipelines/text/moe-impl.d.ts +2 -0
  361. package/src/inference/pipelines/text/ops.d.ts +16 -2
  362. package/src/inference/pipelines/text/ops.js +11 -2
  363. package/src/inference/pipelines/text/per-layer-inputs.d.ts +107 -0
  364. package/src/inference/pipelines/text/per-layer-inputs.js +1581 -0
  365. package/src/inference/pipelines/text/probes.js +6 -0
  366. package/src/inference/pipelines/text/sampling-config.js +9 -1
  367. package/src/inference/pipelines/text/stage-names.js +3 -0
  368. package/src/inference/pipelines/text/state.d.ts +12 -3
  369. package/src/inference/pipelines/text/state.js +19 -0
  370. package/src/inference/pipelines/text/types.d.ts +79 -7
  371. package/src/inference/pipelines/text/weights.d.ts +2 -2
  372. package/src/inference/pipelines/text/weights.js +4 -0
  373. package/src/inference/pipelines/text.d.ts +6 -0
  374. package/src/inference/pipelines/text.js +860 -11
  375. package/src/inference/pipelines/video/frame-sampler.js +36 -0
  376. package/src/inference/pipelines/video/index.js +87 -0
  377. package/src/inference/pipelines/vision/encoder.js +27 -6
  378. package/src/inference/pipelines/vision/gemma4.js +731 -0
  379. package/src/inference/pipelines/vision/image-preprocess.js +22 -7
  380. package/src/inference/pipelines/vision/index.js +35 -10
  381. package/src/inference/pipelines/vision/ops.js +31 -26
  382. package/src/inference/pipelines/vision/patch-embed.js +22 -10
  383. package/src/inference/runtime-model.d.ts +89 -0
  384. package/src/inference/runtime-model.js +152 -0
  385. package/src/inference/test-harness.d.ts +8 -1
  386. package/src/inference/test-harness.js +54 -20
  387. package/src/inference/tokenizer.d.ts +5 -0
  388. package/src/inference/tokenizer.js +43 -0
  389. package/src/inference/tokenizers/base.d.ts +5 -0
  390. package/src/inference/tokenizers/base.js +5 -0
  391. package/src/inference/tokenizers/behavior-flags.d.ts +9 -0
  392. package/src/inference/tokenizers/behavior-flags.js +100 -0
  393. package/src/inference/tokenizers/bundled.d.ts +4 -0
  394. package/src/inference/tokenizers/bundled.js +110 -0
  395. package/src/inference/tokenizers/sentencepiece.d.ts +2 -0
  396. package/src/inference/tokenizers/sentencepiece.js +16 -0
  397. package/src/inference/tokenizers/types.d.ts +2 -0
  398. package/src/loader/doppler-loader.d.ts +10 -3
  399. package/src/loader/doppler-loader.js +103 -5
  400. package/src/loader/embedding-loader.d.ts +5 -1
  401. package/src/loader/embedding-loader.js +57 -6
  402. package/src/loader/final-weights-loader.js +44 -5
  403. package/src/loader/layer-loader.js +210 -8
  404. package/src/loader/loader-state.js +2 -2
  405. package/src/loader/loader-types.d.ts +17 -1
  406. package/src/loader/memory-monitor.d.ts +8 -0
  407. package/src/loader/memory-monitor.js +21 -0
  408. package/src/loader/multi-model-loader.d.ts +9 -1
  409. package/src/loader/multi-model-loader.js +9 -1
  410. package/src/loader/per-layer-input-loader.d.ts +30 -0
  411. package/src/loader/per-layer-input-loader.js +478 -0
  412. package/src/loader/shard-cache.d.ts +4 -3
  413. package/src/loader/shard-resolver.js +2 -0
  414. package/src/loader/tensors/source-transform.d.ts +50 -0
  415. package/src/loader/tensors/source-transform.js +776 -0
  416. package/src/loader/tensors/tensor-loader.d.ts +12 -0
  417. package/src/loader/tensors/tensor-loader.js +208 -123
  418. package/src/loader/tensors/tensor-reader.d.ts +8 -0
  419. package/src/loader/tensors/tensor-reader.js +283 -15
  420. package/src/loaders/index.d.ts +4 -0
  421. package/src/loaders/index.js +4 -0
  422. package/src/memory/buffer-pool.d.ts +4 -0
  423. package/src/memory/buffer-pool.js +36 -0
  424. package/src/rules/execution-rules-contract-check.d.ts +4 -0
  425. package/src/rules/execution-rules-contract-check.js +150 -24
  426. package/src/rules/inference/attention.rules.json +15 -0
  427. package/src/rules/inference/capability-transforms.rules.json +30 -0
  428. package/src/rules/inference/execution.rules.json +54 -2
  429. package/src/rules/inference/ffn.rules.json +33 -0
  430. package/src/rules/kernels/attention.rules.json +7 -0
  431. package/src/rules/kernels/fused-ffn.rules.json +4 -2
  432. package/src/rules/kernels/kv_quantize.rules.json +2 -0
  433. package/src/rules/kernels/matmul.rules.json +14 -0
  434. package/src/rules/kernels/scale.rules.json +2 -0
  435. package/src/rules/loader/tensor-loader.rules.json +1 -0
  436. package/src/storage/artifact-storage-context.d.ts +53 -0
  437. package/src/storage/artifact-storage-context.js +560 -0
  438. package/src/storage/downloader.js +7 -1
  439. package/src/storage/index.d.ts +18 -0
  440. package/src/storage/index.js +13 -0
  441. package/src/storage/preflight.js +22 -0
  442. package/src/storage/quickstart-downloader.js +35 -2
  443. package/src/storage/registry.d.ts +1 -0
  444. package/src/storage/registry.js +26 -4
  445. package/src/storage/shard-manager.d.ts +4 -0
  446. package/src/storage/shard-manager.js +25 -6
  447. package/src/storage/source-artifact-store.d.ts +9 -0
  448. package/src/storage/source-artifact-store.js +134 -0
  449. package/src/tooling/browser-command-runner.js +12 -5
  450. package/src/tooling/command-api-family-normalizers.js +144 -0
  451. package/src/tooling/command-api-helpers.js +1 -0
  452. package/src/tooling/command-api.d.ts +32 -9
  453. package/src/tooling/command-api.js +0 -25
  454. package/src/tooling/command-runner-shared.js +1 -2
  455. package/src/tooling/command-runner.html +5 -2
  456. package/src/tooling/diagnose-runner.js +1 -1
  457. package/src/tooling/kernel-path-builder/index.js +48 -32
  458. package/src/tooling/lean-execution-contract.d.ts +1 -1
  459. package/src/tooling/lean-execution-contract.js +2 -149
  460. package/src/tooling/litert-package-runtime.d.ts +46 -0
  461. package/src/tooling/litert-package-runtime.js +950 -0
  462. package/src/tooling/node-browser-command-runner.d.ts +13 -0
  463. package/src/tooling/node-browser-command-runner.js +163 -3
  464. package/src/tooling/node-command-runner.js +14 -5
  465. package/src/tooling/node-converter.js +226 -63
  466. package/src/tooling/node-source-runtime.d.ts +8 -3
  467. package/src/tooling/node-source-runtime.js +561 -236
  468. package/src/tooling/node-webgpu.js +7 -30
  469. package/src/tooling/opfs-cache.d.ts +18 -1
  470. package/src/tooling/opfs-cache.js +126 -9
  471. package/src/tooling/runtime-input-composition.d.ts +0 -1
  472. package/src/tooling/runtime-input-composition.js +0 -5
  473. package/src/tooling/source-artifact-adapter.d.ts +134 -0
  474. package/src/tooling/source-artifact-adapter.js +366 -0
  475. package/src/tooling/source-package-profiles.d.ts +33 -0
  476. package/src/tooling/source-package-profiles.js +57 -0
  477. package/src/tooling/source-runtime-bundle.d.ts +46 -6
  478. package/src/tooling/source-runtime-bundle.js +371 -60
  479. package/src/tooling/source-runtime-converter-config.d.ts +24 -0
  480. package/src/tooling/source-runtime-converter-config.js +297 -0
  481. package/src/tooling-experimental-exports.browser.js +2 -0
  482. package/src/tooling-experimental-exports.d.ts +7 -0
  483. package/src/tooling-experimental-exports.js +7 -0
  484. package/src/tooling-experimental-exports.shared.d.ts +26 -0
  485. package/src/tooling-experimental-exports.shared.js +29 -0
  486. package/src/tooling-exports.shared.d.ts +0 -23
  487. package/src/tooling-exports.shared.js +6 -28
  488. package/src/version.js +1 -1
  489. package/src/client/doppler-provider/generation.d.ts +0 -25
  490. package/src/client/doppler-provider/generation.js +0 -126
  491. package/src/client/doppler-provider/index.d.ts +0 -2
  492. package/src/client/doppler-provider/index.js +0 -3
  493. package/src/client/doppler-provider/provider.d.ts +0 -5
  494. package/src/client/doppler-provider/provider.js +0 -102
  495. package/src/client/doppler-provider/source-runtime.js +0 -677
  496. package/src/client/doppler-provider.d.ts +0 -46
  497. package/src/client/doppler-provider.js +0 -36
  498. package/src/config/schema/inference-defaults.schema.d.ts +0 -276
  499. package/src/config/schema/inference-defaults.schema.js +0 -189
  500. package/src/diffusion/index.d.ts +0 -8
  501. package/src/diffusion/index.js +0 -8
  502. package/src/energy/index.d.ts +0 -2
  503. package/src/energy/index.js +0 -2
  504. package/src/index-internal.d.ts +0 -2
  505. package/src/index-internal.js +0 -2
  506. /package/src/client/{doppler-provider → runtime}/types.js +0 -0
  507. /package/src/{adapters → experimental/adapters}/index.d.ts +0 -0
  508. /package/src/{adapters → experimental/adapters}/index.js +0 -0
  509. /package/src/{bridge → experimental/bridge}/extension/background.d.ts +0 -0
  510. /package/src/{bridge → experimental/bridge}/extension/background.js +0 -0
  511. /package/src/{bridge → experimental/bridge}/extension/manifest.json +0 -0
  512. /package/src/{bridge → experimental/bridge}/extension-client.d.ts +0 -0
  513. /package/src/{bridge → experimental/bridge}/index.d.ts +0 -0
  514. /package/src/{bridge → experimental/bridge}/index.js +0 -0
  515. /package/src/{bridge → experimental/bridge}/protocol.d.ts +0 -0
  516. /package/src/{browser → experimental/browser}/file-picker.d.ts +0 -0
  517. /package/src/{browser → experimental/browser}/file-picker.js +0 -0
  518. /package/src/{browser → experimental/browser}/tensor-source-download.d.ts +0 -0
  519. /package/src/{browser → experimental/browser}/tensor-source-file.d.ts +0 -0
  520. /package/src/{browser → experimental/browser}/tensor-source-file.js +0 -0
  521. /package/src/{browser → experimental/browser}/tensor-source-http.d.ts +0 -0
  522. /package/src/{browser → experimental/browser}/tensor-source-http.js +0 -0
  523. /package/src/{diffusion → experimental/diffusion}/config/expansion-lanes.json +0 -0
  524. /package/src/{diffusion → experimental/diffusion}/image-regression.d.ts +0 -0
  525. /package/src/{diffusion → experimental/diffusion}/image-regression.js +0 -0
  526. /package/src/{distribution → experimental/distribution}/p2p-control-plane.d.ts +0 -0
  527. /package/src/{distribution → experimental/distribution}/p2p-control-plane.js +0 -0
  528. /package/src/{distribution → experimental/distribution}/p2p-observability.d.ts +0 -0
  529. /package/src/{distribution → experimental/distribution}/p2p-observability.js +0 -0
  530. /package/src/{distribution → experimental/distribution}/p2p-transport-contract.d.ts +0 -0
  531. /package/src/{distribution → experimental/distribution}/p2p-webrtc-browser.d.ts +0 -0
  532. /package/src/{distribution → experimental/distribution}/p2p-webrtc-browser.js +0 -0
  533. /package/src/{distribution → experimental/distribution}/shard-delivery.d.ts +0 -0
  534. /package/src/{hotswap → experimental/hotswap}/runtime.js +0 -0
  535. /package/src/{training → experimental/training}/checkpoint-watch.d.ts +0 -0
  536. /package/src/{training → experimental/training}/checkpoint-watch.js +0 -0
  537. /package/src/{training → experimental/training}/checkpoint.d.ts +0 -0
  538. /package/src/{training → experimental/training}/dataloader.d.ts +0 -0
  539. /package/src/{training → experimental/training}/dataloader.js +0 -0
  540. /package/src/{training → experimental/training}/datasets/index.d.ts +0 -0
  541. /package/src/{training → experimental/training}/datasets/index.js +0 -0
  542. /package/src/{training → experimental/training}/datasets/jsonl.d.ts +0 -0
  543. /package/src/{training → experimental/training}/datasets/jsonl.js +0 -0
  544. /package/src/{training → experimental/training}/datasets/reploid.d.ts +0 -0
  545. /package/src/{training → experimental/training}/datasets/reploid.js +0 -0
  546. /package/src/{training → experimental/training}/datasets/text-pairs.d.ts +0 -0
  547. /package/src/{training → experimental/training}/datasets/text-pairs.js +0 -0
  548. /package/src/{training → experimental/training}/datasets/token-batch.d.ts +0 -0
  549. /package/src/{training → experimental/training}/datasets/token-batch.js +0 -0
  550. /package/src/{training → experimental/training}/datasets/translation-pairs.d.ts +0 -0
  551. /package/src/{training → experimental/training}/datasets/translation-pairs.js +0 -0
  552. /package/src/{training → experimental/training}/distillation/artifacts.d.ts +0 -0
  553. /package/src/{training → experimental/training}/distillation/artifacts.js +0 -0
  554. /package/src/{training → experimental/training}/distillation/checkpoint-watch.d.ts +0 -0
  555. /package/src/{training → experimental/training}/distillation/checkpoint-watch.js +0 -0
  556. /package/src/{training → experimental/training}/distillation/dataset.d.ts +0 -0
  557. /package/src/{training → experimental/training}/distillation/dataset.js +0 -0
  558. /package/src/{training → experimental/training}/distillation/eval.d.ts +0 -0
  559. /package/src/{training → experimental/training}/distillation/eval.js +0 -0
  560. /package/src/{training → experimental/training}/distillation/index.d.ts +0 -0
  561. /package/src/{training → experimental/training}/distillation/index.js +0 -0
  562. /package/src/{training → experimental/training}/distillation/runtime.d.ts +0 -0
  563. /package/src/{training → experimental/training}/distillation/runtime.js +0 -0
  564. /package/src/{training → experimental/training}/distillation/scoreboard.d.ts +0 -0
  565. /package/src/{training → experimental/training}/distillation/scoreboard.js +0 -0
  566. /package/src/{training → experimental/training}/distillation/stage-a.d.ts +0 -0
  567. /package/src/{training → experimental/training}/distillation/stage-a.js +0 -0
  568. /package/src/{training → experimental/training}/distillation/stage-b.d.ts +0 -0
  569. /package/src/{training → experimental/training}/distillation/stage-b.js +0 -0
  570. /package/src/{training → experimental/training}/distillation/student-fixture.d.ts +0 -0
  571. /package/src/{training → experimental/training}/distillation/student-fixture.js +0 -0
  572. /package/src/{training → experimental/training}/distillation/suite-data.d.ts +0 -0
  573. /package/src/{training → experimental/training}/distillation/suite-data.js +0 -0
  574. /package/src/{training → experimental/training}/index.d.ts +0 -0
  575. /package/src/{training → experimental/training}/index.js +0 -0
  576. /package/src/{training → experimental/training}/lora-pipeline.d.ts +0 -0
  577. /package/src/{training → experimental/training}/objectives/base.d.ts +0 -0
  578. /package/src/{training → experimental/training}/objectives/base.js +0 -0
  579. /package/src/{training → experimental/training}/objectives/cross_entropy.d.ts +0 -0
  580. /package/src/{training → experimental/training}/objectives/cross_entropy.js +0 -0
  581. /package/src/{training → experimental/training}/objectives/distill_kd.d.ts +0 -0
  582. /package/src/{training → experimental/training}/objectives/distill_kd.js +0 -0
  583. /package/src/{training → experimental/training}/objectives/distill_triplet.d.ts +0 -0
  584. /package/src/{training → experimental/training}/objectives/distill_triplet.js +0 -0
  585. /package/src/{training → experimental/training}/objectives/index.d.ts +0 -0
  586. /package/src/{training → experimental/training}/objectives/index.js +0 -0
  587. /package/src/{training → experimental/training}/objectives/ul_stage1_joint.d.ts +0 -0
  588. /package/src/{training → experimental/training}/objectives/ul_stage1_joint.js +0 -0
  589. /package/src/{training → experimental/training}/objectives/ul_stage2_base.d.ts +0 -0
  590. /package/src/{training → experimental/training}/objectives/ul_stage2_base.js +0 -0
  591. /package/src/{training → experimental/training}/operator-artifacts.d.ts +0 -0
  592. /package/src/{training → experimental/training}/operator-command.d.ts +0 -0
  593. /package/src/{training → experimental/training}/operator-command.js +0 -0
  594. /package/src/{training → experimental/training}/operator-eval.d.ts +0 -0
  595. /package/src/{training → experimental/training}/operator-eval.js +0 -0
  596. /package/src/{training → experimental/training}/operator-scoreboard.d.ts +0 -0
  597. /package/src/{training → experimental/training}/operator-scoreboard.js +0 -0
  598. /package/src/{training → experimental/training}/suite.d.ts +0 -0
  599. /package/src/{training → experimental/training}/ul_schedule.js +0 -0
  600. /package/src/{training → experimental/training}/workload-packs/distill-translategemma-medium.json +0 -0
  601. /package/src/{training → experimental/training}/workload-packs/distill-translategemma-tiny.json +0 -0
  602. /package/src/{training → experimental/training}/workload-packs/lora-toy-medium.json +0 -0
  603. /package/src/{training → experimental/training}/workload-packs/lora-toy-tiny.json +0 -0
  604. /package/src/{training → experimental/training}/workload-packs/registry.json +0 -0
  605. /package/src/{training → experimental/training}/workload-packs/ul-training-medium.json +0 -0
  606. /package/src/{training → experimental/training}/workload-packs/ul-training-tiny.json +0 -0
  607. /package/src/{training → experimental/training}/workloads.d.ts +0 -0
@@ -64,6 +64,7 @@
64
64
  "shader-f16"
65
65
  ],
66
66
  "outputDtype": "f16",
67
+ "weightDtype": "f16",
67
68
  "reachability": {
68
69
  "status": "model-selectable",
69
70
  "inlineConfigs": [],
@@ -85,6 +86,7 @@
85
86
  "shader-f16"
86
87
  ],
87
88
  "outputDtype": "f16",
89
+ "weightDtype": "f16",
88
90
  "variantMetadata": {
89
91
  "colsPerThread": 4
90
92
  },
@@ -109,6 +111,7 @@
109
111
  "shader-f16"
110
112
  ],
111
113
  "outputDtype": "f16",
114
+ "weightDtype": "f16",
112
115
  "variantMetadata": {
113
116
  "tileM": 64,
114
117
  "tileN": 64
@@ -135,6 +138,7 @@
135
138
  "shader-f16"
136
139
  ],
137
140
  "outputDtype": "f32",
141
+ "weightDtype": "f16",
138
142
  "reachability": {
139
143
  "status": "pinned",
140
144
  "inlineConfigs": [
@@ -167,6 +171,7 @@
167
171
  "shader-f16"
168
172
  ],
169
173
  "outputDtype": "f32",
174
+ "weightDtype": "f16",
170
175
  "variantMetadata": {
171
176
  "tileM": 64,
172
177
  "tileN": 64
@@ -195,6 +200,7 @@
195
200
  "shader-f16"
196
201
  ],
197
202
  "outputDtype": "f32",
203
+ "weightDtype": "f16",
198
204
  "description": "Optimized GEMV for M=1 decode: uses shared memory for A vector",
199
205
  "reachability": {
200
206
  "status": "model-selectable",
@@ -217,6 +223,7 @@
217
223
  "shader-f16"
218
224
  ],
219
225
  "outputDtype": "f16",
226
+ "weightDtype": "f16",
220
227
  "description": "Optimized GEMV for M=1 decode with f16 activations + f16 output",
221
228
  "reachability": {
222
229
  "status": "model-selectable",
@@ -240,6 +247,7 @@
240
247
  "subgroups"
241
248
  ],
242
249
  "outputDtype": "f32",
250
+ "weightDtype": "f16",
243
251
  "variantMetadata": {
244
252
  "colsPerWg": 4
245
253
  },
@@ -267,6 +275,7 @@
267
275
  "subgroups"
268
276
  ],
269
277
  "outputDtype": "f16",
278
+ "weightDtype": "f16",
270
279
  "variantMetadata": {
271
280
  "colsPerWg": 4
272
281
  },
@@ -294,6 +303,7 @@
294
303
  "subgroups"
295
304
  ],
296
305
  "outputDtype": "f32",
306
+ "weightDtype": "f16",
297
307
  "variantMetadata": {
298
308
  "colsPerWg": 4
299
309
  },
@@ -329,6 +339,7 @@
329
339
  "subgroups"
330
340
  ],
331
341
  "outputDtype": "f16",
342
+ "weightDtype": "f16",
332
343
  "variantMetadata": {
333
344
  "colsPerWg": 4
334
345
  },
@@ -354,6 +365,7 @@
354
365
  "subgroups"
355
366
  ],
356
367
  "outputDtype": "f16",
368
+ "weightDtype": "f16",
357
369
  "variantMetadata": {
358
370
  "colsPerWg": 8
359
371
  },
@@ -378,6 +390,7 @@
378
390
  "subgroups"
379
391
  ],
380
392
  "outputDtype": "f16",
393
+ "weightDtype": "f16",
381
394
  "variantMetadata": {
382
395
  "colsPerWg": 8
383
396
  },
@@ -402,6 +415,7 @@
402
415
  "subgroups"
403
416
  ],
404
417
  "outputDtype": "f32",
418
+ "weightDtype": "f16",
405
419
  "variantMetadata": {
406
420
  "colsPerWg": 32
407
421
  },
@@ -441,6 +455,7 @@
441
455
  "subgroups"
442
456
  ],
443
457
  "outputDtype": "f16",
458
+ "weightDtype": "f16",
444
459
  "variantMetadata": {
445
460
  "colsPerWg": 32
446
461
  },
@@ -468,6 +483,7 @@
468
483
  "subgroups"
469
484
  ],
470
485
  "outputDtype": "f32",
486
+ "weightDtype": "f16",
471
487
  "variantMetadata": {
472
488
  "colsPerWg": 64
473
489
  },
@@ -492,6 +508,7 @@
492
508
  "subgroups"
493
509
  ],
494
510
  "outputDtype": "f16",
511
+ "weightDtype": "f16",
495
512
  "variantMetadata": {
496
513
  "colsPerWg": 64
497
514
  },
@@ -516,6 +533,7 @@
516
533
  "subgroups"
517
534
  ],
518
535
  "outputDtype": "f16",
536
+ "weightDtype": "f16",
519
537
  "variantMetadata": {
520
538
  "colsPerWg": 64
521
539
  },
@@ -539,6 +557,7 @@
539
557
  "subgroups"
540
558
  ],
541
559
  "outputDtype": "f32",
560
+ "weightDtype": "q4k",
542
561
  "description": "Fused Q4_K dequant + matmul - 2-3x faster (no separate dequant pass)",
543
562
  "reachability": {
544
563
  "status": "unused",
@@ -560,6 +579,7 @@
560
579
  "subgroups"
561
580
  ],
562
581
  "outputDtype": "f16",
582
+ "weightDtype": "q4k",
563
583
  "reachability": {
564
584
  "status": "unused",
565
585
  "inlineConfigs": [],
@@ -579,6 +599,7 @@
579
599
  "subgroups"
580
600
  ],
581
601
  "outputDtype": "f32",
602
+ "weightDtype": "q4k",
582
603
  "variantMetadata": {
583
604
  "tileM": 4
584
605
  },
@@ -594,6 +615,31 @@
594
615
  "wgslOnDisk": true
595
616
  }
596
617
  },
618
+ "q4_fused_batched_multicol_shared": {
619
+ "wgsl": "fused_matmul_q4_batched_multicol_shared.wgsl",
620
+ "entryPoint": "main",
621
+ "workgroup": [
622
+ 32,
623
+ 4,
624
+ 1
625
+ ],
626
+ "requires": [],
627
+ "outputDtype": "f32",
628
+ "weightDtype": "q4k",
629
+ "variantMetadata": {
630
+ "tileM": 4,
631
+ "colsPerWg": 8
632
+ },
633
+ "description": "Shared-A Q4_K prefill matmul: 4 rows x 8 columns per workgroup while preserving block/subblock traversal",
634
+ "reachability": {
635
+ "status": "pinned",
636
+ "inlineConfigs": [],
637
+ "ruleChains": [
638
+ "capability-transforms.rules.json#remapDenseQ4KPrefillToQ4Native"
639
+ ],
640
+ "wgslOnDisk": true
641
+ }
642
+ },
597
643
  "q4_fused_multicol": {
598
644
  "wgsl": "fused_matmul_q4.wgsl",
599
645
  "entryPoint": "main_multicol",
@@ -606,6 +652,7 @@
606
652
  "subgroups"
607
653
  ],
608
654
  "outputDtype": "f32",
655
+ "weightDtype": "q4k",
609
656
  "variantMetadata": {
610
657
  "colsPerWg": 32
611
658
  },
@@ -613,6 +660,7 @@
613
660
  "reachability": {
614
661
  "status": "pinned",
615
662
  "inlineConfigs": [
663
+ "gemma3/gemma-3-1b-it-q4k-ehf16-af32",
616
664
  "qwen3/qwen-3-5-0-8b-q4k-ehaf16",
617
665
  "qwen3/qwen-3-5-2b-q4k-ehaf16"
618
666
  ],
@@ -622,6 +670,86 @@
622
670
  "wgslOnDisk": true
623
671
  }
624
672
  },
673
+ "q4_fused_multicol_fast": {
674
+ "wgsl": "fused_matmul_q4.wgsl",
675
+ "entryPoint": "main_multicol_fast",
676
+ "workgroup": [
677
+ 256,
678
+ 1,
679
+ 1
680
+ ],
681
+ "requires": [
682
+ "subgroups"
683
+ ],
684
+ "outputDtype": "f32",
685
+ "weightDtype": "q4k",
686
+ "variantMetadata": {
687
+ "colsPerWg": 32
688
+ },
689
+ "description": "Fast-dequant multi-column GEMV - direct word extraction replaces per-element get_q4 calls",
690
+ "reachability": {
691
+ "status": "pinned",
692
+ "inlineConfigs": [
693
+ "qwen3/qwen-3-5-0-8b-q4k-ehaf16"
694
+ ],
695
+ "ruleChains": [],
696
+ "wgslOnDisk": true
697
+ }
698
+ },
699
+ "q4_fused_multicol_shared": {
700
+ "wgsl": "fused_matmul_q4.wgsl",
701
+ "entryPoint": "main_multicol_shared",
702
+ "workgroup": [
703
+ 256,
704
+ 1,
705
+ 1
706
+ ],
707
+ "requires": [
708
+ "subgroups"
709
+ ],
710
+ "outputDtype": "f32",
711
+ "weightDtype": "q4k",
712
+ "variantMetadata": {
713
+ "colsPerWg": 32
714
+ },
715
+ "description": "Shared-A multi-column GEMV - cooperative A load eliminates redundant global reads across 32 columns",
716
+ "reachability": {
717
+ "status": "pinned",
718
+ "inlineConfigs": [
719
+ "qwen3/qwen-3-5-0-8b-q4k-ehaf16"
720
+ ],
721
+ "ruleChains": [],
722
+ "wgslOnDisk": true
723
+ }
724
+ },
725
+ "q4_fused_gemv": {
726
+ "wgsl": "fused_matmul_q4.wgsl",
727
+ "entryPoint": "main_gemv",
728
+ "workgroup": [
729
+ 256,
730
+ 1,
731
+ 1
732
+ ],
733
+ "requires": [
734
+ "subgroups"
735
+ ],
736
+ "outputDtype": "f32",
737
+ "weightDtype": "q4k",
738
+ "variantMetadata": {
739
+ "colsPerWg": 32
740
+ },
741
+ "description": "Optimised fused Q4K GEMV - shared-A cooperative load + fast nibble extraction for maximum M=1 decode throughput without f16 precision loss",
742
+ "reachability": {
743
+ "status": "pinned",
744
+ "inlineConfigs": [
745
+ "qwen3/qwen-3-5-0-8b-q4k-ehaf16"
746
+ ],
747
+ "ruleChains": [
748
+ "capabilityTransforms"
749
+ ],
750
+ "wgslOnDisk": true
751
+ }
752
+ },
625
753
  "q4_fused_multicol_f16": {
626
754
  "wgsl": "fused_matmul_q4_multicol_f16.wgsl",
627
755
  "entryPoint": "main_multicol_f16",
@@ -635,6 +763,7 @@
635
763
  "subgroups"
636
764
  ],
637
765
  "outputDtype": "f16",
766
+ "weightDtype": "q4k",
638
767
  "variantMetadata": {
639
768
  "colsPerWg": 32
640
769
  },
@@ -661,6 +790,7 @@
661
790
  "subgroups"
662
791
  ],
663
792
  "outputDtype": "f16",
793
+ "weightDtype": "q4k",
664
794
  "variantMetadata": {
665
795
  "colsPerWg": 32
666
796
  },
@@ -687,6 +817,7 @@
687
817
  "subgroups"
688
818
  ],
689
819
  "outputDtype": "f16",
820
+ "weightDtype": "q4k",
690
821
  "variantMetadata": {
691
822
  "tileM": 4
692
823
  },
@@ -712,6 +843,7 @@
712
843
  "subgroups"
713
844
  ],
714
845
  "outputDtype": "f16",
846
+ "weightDtype": "q4k",
715
847
  "variantMetadata": {
716
848
  "tileM": 4
717
849
  },
@@ -734,6 +866,7 @@
734
866
  ],
735
867
  "requires": [],
736
868
  "outputDtype": "f32",
869
+ "weightDtype": "f32",
737
870
  "reachability": {
738
871
  "status": "model-selectable",
739
872
  "inlineConfigs": [],
@@ -776,7 +909,7 @@
776
909
  }
777
910
  ],
778
911
  "baseUniforms": {
779
- "size": 32,
912
+ "size": 36,
780
913
  "fields": [
781
914
  {
782
915
  "name": "M",
@@ -950,6 +1083,28 @@
950
1083
  "wgslOnDisk": true
951
1084
  }
952
1085
  },
1086
+ "q4k_f16a": {
1087
+ "wgsl": "fused_ffn_q4k_f16.wgsl",
1088
+ "entryPoint": "main",
1089
+ "workgroup": [
1090
+ 256,
1091
+ 1,
1092
+ 1
1093
+ ],
1094
+ "requires": [
1095
+ "shader-f16",
1096
+ "subgroups"
1097
+ ],
1098
+ "description": "Q4K fused FFN with f16 activation reads and f32 output",
1099
+ "reachability": {
1100
+ "status": "selectable",
1101
+ "inlineConfigs": [],
1102
+ "ruleChains": [
1103
+ "fused-ffn.rules.json#variant"
1104
+ ],
1105
+ "wgslOnDisk": true
1106
+ }
1107
+ },
953
1108
  "q4k_batched": {
954
1109
  "wgsl": "fused_ffn_q4k.wgsl",
955
1110
  "entryPoint": "main_batched",
@@ -969,6 +1124,28 @@
969
1124
  ],
970
1125
  "wgslOnDisk": true
971
1126
  }
1127
+ },
1128
+ "q4k_batched_f16a": {
1129
+ "wgsl": "fused_ffn_q4k_f16.wgsl",
1130
+ "entryPoint": "main_batched",
1131
+ "workgroup": [
1132
+ 256,
1133
+ 1,
1134
+ 1
1135
+ ],
1136
+ "requires": [
1137
+ "shader-f16",
1138
+ "subgroups"
1139
+ ],
1140
+ "description": "Q4K fused FFN batched path with f16 activation reads and f32 output",
1141
+ "reachability": {
1142
+ "status": "selectable",
1143
+ "inlineConfigs": [],
1144
+ "ruleChains": [
1145
+ "fused-ffn.rules.json#variant"
1146
+ ],
1147
+ "wgslOnDisk": true
1148
+ }
972
1149
  }
973
1150
  }
974
1151
  },
@@ -1007,7 +1184,7 @@
1007
1184
  }
1008
1185
  ],
1009
1186
  "baseUniforms": {
1010
- "size": 32,
1187
+ "size": 36,
1011
1188
  "fields": [
1012
1189
  {
1013
1190
  "name": "seq_len",
@@ -1681,6 +1858,26 @@
1681
1858
  "wgslOnDisk": true
1682
1859
  }
1683
1860
  },
1861
+ "decode_small": {
1862
+ "wgsl": "attention_small.wgsl",
1863
+ "entryPoint": "main",
1864
+ "workgroup": [
1865
+ 32,
1866
+ 1,
1867
+ 1
1868
+ ],
1869
+ "requires": [],
1870
+ "outputDtype": "f32",
1871
+ "variantMetadata": {
1872
+ "tier": "tiled_small"
1873
+ },
1874
+ "reachability": {
1875
+ "status": "model-selectable",
1876
+ "inlineConfigs": [],
1877
+ "ruleChains": [],
1878
+ "wgslOnDisk": true
1879
+ }
1880
+ },
1684
1881
  "prefill_streaming": {
1685
1882
  "wgsl": "attention_streaming.wgsl",
1686
1883
  "entryPoint": "main",
@@ -1703,6 +1900,26 @@
1703
1900
  "wgslOnDisk": true
1704
1901
  }
1705
1902
  },
1903
+ "decode_streaming": {
1904
+ "wgsl": "attention_streaming.wgsl",
1905
+ "entryPoint": "main",
1906
+ "workgroup": [
1907
+ 1,
1908
+ 1,
1909
+ 1
1910
+ ],
1911
+ "requires": [],
1912
+ "outputDtype": "f32",
1913
+ "variantMetadata": {
1914
+ "tier": "streaming"
1915
+ },
1916
+ "reachability": {
1917
+ "status": "model-selectable",
1918
+ "inlineConfigs": [],
1919
+ "ruleChains": [],
1920
+ "wgslOnDisk": true
1921
+ }
1922
+ },
1706
1923
  "prefill_f16": {
1707
1924
  "wgsl": "attention_f16.wgsl",
1708
1925
  "entryPoint": "main",
@@ -1769,6 +1986,28 @@
1769
1986
  "wgslOnDisk": true
1770
1987
  }
1771
1988
  },
1989
+ "decode_small_f16": {
1990
+ "wgsl": "attention_small_f16.wgsl",
1991
+ "entryPoint": "main",
1992
+ "workgroup": [
1993
+ 32,
1994
+ 1,
1995
+ 1
1996
+ ],
1997
+ "requires": [
1998
+ "shader-f16"
1999
+ ],
2000
+ "outputDtype": "f16",
2001
+ "variantMetadata": {
2002
+ "tier": "tiled_small"
2003
+ },
2004
+ "reachability": {
2005
+ "status": "model-selectable",
2006
+ "inlineConfigs": [],
2007
+ "ruleChains": [],
2008
+ "wgslOnDisk": true
2009
+ }
2010
+ },
1772
2011
  "prefill_streaming_f16": {
1773
2012
  "wgsl": "attention_streaming_f16.wgsl",
1774
2013
  "entryPoint": "main",
@@ -1791,6 +2030,28 @@
1791
2030
  "wgslOnDisk": true
1792
2031
  }
1793
2032
  },
2033
+ "decode_streaming_f16": {
2034
+ "wgsl": "attention_streaming_f16.wgsl",
2035
+ "entryPoint": "main",
2036
+ "workgroup": [
2037
+ 1,
2038
+ 1,
2039
+ 1
2040
+ ],
2041
+ "requires": [
2042
+ "shader-f16"
2043
+ ],
2044
+ "outputDtype": "f16",
2045
+ "variantMetadata": {
2046
+ "tier": "streaming"
2047
+ },
2048
+ "reachability": {
2049
+ "status": "model-selectable",
2050
+ "inlineConfigs": [],
2051
+ "ruleChains": [],
2052
+ "wgslOnDisk": true
2053
+ }
2054
+ },
1794
2055
  "prefill_f16kv": {
1795
2056
  "wgsl": "attention_f16kv.wgsl",
1796
2057
  "entryPoint": "main",
@@ -1861,6 +2122,53 @@
1861
2122
  "wgslOnDisk": true
1862
2123
  }
1863
2124
  },
2125
+ "decode_small_f16kv": {
2126
+ "wgsl": "attention_small_f16kv.wgsl",
2127
+ "entryPoint": "main",
2128
+ "workgroup": [
2129
+ 32,
2130
+ 1,
2131
+ 1
2132
+ ],
2133
+ "requires": [
2134
+ "shader-f16"
2135
+ ],
2136
+ "outputDtype": "f32",
2137
+ "variantMetadata": {
2138
+ "tier": "tiled_small"
2139
+ },
2140
+ "reachability": {
2141
+ "status": "model-selectable",
2142
+ "inlineConfigs": [],
2143
+ "ruleChains": [],
2144
+ "wgslOnDisk": true
2145
+ }
2146
+ },
2147
+ "prefill_head256_f16kv": {
2148
+ "wgsl": "attention_head256_f16kv.wgsl",
2149
+ "entryPoint": "main",
2150
+ "workgroup": [
2151
+ 32,
2152
+ 1,
2153
+ 1
2154
+ ],
2155
+ "requires": [
2156
+ "shader-f16"
2157
+ ],
2158
+ "outputDtype": "f32",
2159
+ "variantMetadata": {
2160
+ "tier": "tiled_small",
2161
+ "exactHeadDim": 256,
2162
+ "maxHeadDim": 256,
2163
+ "requiredShared": 16384
2164
+ },
2165
+ "reachability": {
2166
+ "status": "experimental",
2167
+ "inlineConfigs": [],
2168
+ "ruleChains": [],
2169
+ "wgslOnDisk": true
2170
+ }
2171
+ },
1864
2172
  "prefill_streaming_f16kv": {
1865
2173
  "wgsl": "attention_streaming_f16kv.wgsl",
1866
2174
  "entryPoint": "main",
@@ -1892,6 +2200,28 @@
1892
2200
  "wgslOnDisk": true
1893
2201
  }
1894
2202
  },
2203
+ "decode_streaming_f16kv": {
2204
+ "wgsl": "attention_streaming_f16kv.wgsl",
2205
+ "entryPoint": "main",
2206
+ "workgroup": [
2207
+ 1,
2208
+ 1,
2209
+ 1
2210
+ ],
2211
+ "requires": [
2212
+ "shader-f16"
2213
+ ],
2214
+ "outputDtype": "f32",
2215
+ "variantMetadata": {
2216
+ "tier": "streaming"
2217
+ },
2218
+ "reachability": {
2219
+ "status": "model-selectable",
2220
+ "inlineConfigs": [],
2221
+ "ruleChains": [],
2222
+ "wgslOnDisk": true
2223
+ }
2224
+ },
1895
2225
  "decode_online_f16": {
1896
2226
  "wgsl": "attention_decode_online_f16.wgsl",
1897
2227
  "entryPoint": "main",
@@ -1906,7 +2236,8 @@
1906
2236
  ],
1907
2237
  "outputDtype": "f16",
1908
2238
  "variantMetadata": {
1909
- "tier": "subgroup"
2239
+ "tier": "subgroup",
2240
+ "maxHeadDim": 512
1910
2241
  },
1911
2242
  "description": "Online decode kernel - f16 QKV with subgroup reductions",
1912
2243
  "reachability": {
@@ -1932,7 +2263,8 @@
1932
2263
  ],
1933
2264
  "outputDtype": "f32",
1934
2265
  "variantMetadata": {
1935
- "tier": "subgroup"
2266
+ "tier": "subgroup",
2267
+ "maxHeadDim": 512
1936
2268
  },
1937
2269
  "description": "Online decode kernel - f32 Q with f16 KV and subgroup reductions",
1938
2270
  "reachability": {
@@ -1943,6 +2275,7 @@
1943
2275
  "gemma3/gemma-3-270m-it-q4k-ehf16-af32",
1944
2276
  "gemma3/translategemma-4b-1b-enes-q4k-ehf16-af32",
1945
2277
  "gemma3/translategemma-4b-it-q4k-ehf16-af32",
2278
+ "gemma4/gemma-4-e2b-it-q4k-ehf16-af32",
1946
2279
  "gemma4/gemma-4-moe-q4k-ehf16-af32",
1947
2280
  "gpt-oss-20b-f16-xmxfp4",
1948
2281
  "janus/janus-pro-1b-text-q4k-ehaf16",
@@ -2217,11 +2550,212 @@
2217
2550
  "type": "u32",
2218
2551
  "offset": 64
2219
2552
  }
2220
- ]
2221
- },
2222
- "variants": {
2223
- "decode_tiered_f16": {
2224
- "wgsl": "attention_decode_tiered_f16.wgsl",
2553
+ ]
2554
+ },
2555
+ "variants": {
2556
+ "decode_tiered_f16": {
2557
+ "wgsl": "attention_decode_tiered_f16.wgsl",
2558
+ "entryPoint": "main",
2559
+ "workgroup": [
2560
+ 256,
2561
+ 1,
2562
+ 1
2563
+ ],
2564
+ "requires": [
2565
+ "shader-f16"
2566
+ ],
2567
+ "outputDtype": "f16",
2568
+ "variantMetadata": {
2569
+ "maxKVLen": 2048
2570
+ },
2571
+ "description": "Tiered decode kernel - f16 QKV + f16 output",
2572
+ "reachability": {
2573
+ "status": "unused",
2574
+ "inlineConfigs": [],
2575
+ "ruleChains": [],
2576
+ "wgslOnDisk": true
2577
+ }
2578
+ },
2579
+ "decode_tiered_f16kv": {
2580
+ "wgsl": "attention_decode_tiered_f16kv.wgsl",
2581
+ "entryPoint": "main",
2582
+ "workgroup": [
2583
+ 256,
2584
+ 1,
2585
+ 1
2586
+ ],
2587
+ "requires": [
2588
+ "shader-f16"
2589
+ ],
2590
+ "outputDtype": "f32",
2591
+ "variantMetadata": {
2592
+ "maxKVLen": 2048
2593
+ },
2594
+ "description": "Tiered decode kernel - f32 Q + f16 KV",
2595
+ "reachability": {
2596
+ "status": "unused",
2597
+ "inlineConfigs": [],
2598
+ "ruleChains": [],
2599
+ "wgslOnDisk": true
2600
+ }
2601
+ }
2602
+ }
2603
+ },
2604
+ "attention_tiered_quant": {
2605
+ "description": "Tiered attention kernels with quantized cold cache",
2606
+ "baseBindings": [
2607
+ {
2608
+ "index": 0,
2609
+ "name": "uniforms",
2610
+ "type": "uniform"
2611
+ },
2612
+ {
2613
+ "index": 1,
2614
+ "name": "Q",
2615
+ "type": "read-only-storage"
2616
+ },
2617
+ {
2618
+ "index": 2,
2619
+ "name": "K_hot",
2620
+ "type": "read-only-storage"
2621
+ },
2622
+ {
2623
+ "index": 3,
2624
+ "name": "V_hot",
2625
+ "type": "read-only-storage"
2626
+ },
2627
+ {
2628
+ "index": 4,
2629
+ "name": "K_cold",
2630
+ "type": "read-only-storage"
2631
+ },
2632
+ {
2633
+ "index": 5,
2634
+ "name": "V_cold",
2635
+ "type": "read-only-storage"
2636
+ },
2637
+ {
2638
+ "index": 6,
2639
+ "name": "scales_k",
2640
+ "type": "read-only-storage"
2641
+ },
2642
+ {
2643
+ "index": 7,
2644
+ "name": "scales_v",
2645
+ "type": "read-only-storage"
2646
+ },
2647
+ {
2648
+ "index": 8,
2649
+ "name": "output",
2650
+ "type": "storage"
2651
+ }
2652
+ ],
2653
+ "baseUniforms": {
2654
+ "size": 64,
2655
+ "fields": [
2656
+ {
2657
+ "name": "num_heads",
2658
+ "type": "u32",
2659
+ "offset": 0
2660
+ },
2661
+ {
2662
+ "name": "num_kv_heads",
2663
+ "type": "u32",
2664
+ "offset": 4
2665
+ },
2666
+ {
2667
+ "name": "head_dim",
2668
+ "type": "u32",
2669
+ "offset": 8
2670
+ },
2671
+ {
2672
+ "name": "cold_len",
2673
+ "type": "u32",
2674
+ "offset": 12
2675
+ },
2676
+ {
2677
+ "name": "hot_len",
2678
+ "type": "u32",
2679
+ "offset": 16
2680
+ },
2681
+ {
2682
+ "name": "seq_len",
2683
+ "type": "u32",
2684
+ "offset": 20
2685
+ },
2686
+ {
2687
+ "name": "scale",
2688
+ "type": "f32",
2689
+ "offset": 24
2690
+ },
2691
+ {
2692
+ "name": "is_causal",
2693
+ "type": "u32",
2694
+ "offset": 28
2695
+ },
2696
+ {
2697
+ "name": "start_pos",
2698
+ "type": "u32",
2699
+ "offset": 32
2700
+ },
2701
+ {
2702
+ "name": "attn_softcap",
2703
+ "type": "f32",
2704
+ "offset": 36
2705
+ },
2706
+ {
2707
+ "name": "sliding_window",
2708
+ "type": "u32",
2709
+ "offset": 40
2710
+ },
2711
+ {
2712
+ "name": "hot_window",
2713
+ "type": "u32",
2714
+ "offset": 44
2715
+ },
2716
+ {
2717
+ "name": "hot_start",
2718
+ "type": "u32",
2719
+ "offset": 48
2720
+ },
2721
+ {
2722
+ "name": "packed_stride",
2723
+ "type": "u32",
2724
+ "offset": 52
2725
+ },
2726
+ {
2727
+ "name": "_pad",
2728
+ "type": "u32",
2729
+ "offset": 56
2730
+ }
2731
+ ]
2732
+ },
2733
+ "variants": {
2734
+ "decode_tiered_int8_f16kv": {
2735
+ "wgsl": "attention_decode_tiered_int8_f16kv.wgsl",
2736
+ "entryPoint": "main",
2737
+ "workgroup": [
2738
+ 256,
2739
+ 1,
2740
+ 1
2741
+ ],
2742
+ "requires": [
2743
+ "shader-f16"
2744
+ ],
2745
+ "outputDtype": "f32",
2746
+ "variantMetadata": {
2747
+ "maxKVLen": 2048
2748
+ },
2749
+ "description": "Tiered decode kernel - int8 cold K/V with f16 hot K/V",
2750
+ "reachability": {
2751
+ "status": "unused",
2752
+ "inlineConfigs": [],
2753
+ "ruleChains": [],
2754
+ "wgslOnDisk": true
2755
+ }
2756
+ },
2757
+ "decode_tiered_int4_f16kv": {
2758
+ "wgsl": "attention_decode_tiered_int4_f16kv.wgsl",
2225
2759
  "entryPoint": "main",
2226
2760
  "workgroup": [
2227
2761
  256,
@@ -2231,11 +2765,11 @@
2231
2765
  "requires": [
2232
2766
  "shader-f16"
2233
2767
  ],
2234
- "outputDtype": "f16",
2768
+ "outputDtype": "f32",
2235
2769
  "variantMetadata": {
2236
2770
  "maxKVLen": 2048
2237
2771
  },
2238
- "description": "Tiered decode kernel - f16 QKV + f16 output",
2772
+ "description": "Tiered decode kernel - int4 cold K/V with f16 hot K/V",
2239
2773
  "reachability": {
2240
2774
  "status": "unused",
2241
2775
  "inlineConfigs": [],
@@ -2243,8 +2777,8 @@
2243
2777
  "wgslOnDisk": true
2244
2778
  }
2245
2779
  },
2246
- "decode_tiered_f16kv": {
2247
- "wgsl": "attention_decode_tiered_f16kv.wgsl",
2780
+ "decode_tiered_turboquant_f16kv": {
2781
+ "wgsl": "attention_decode_tiered_turboquant_f16kv.wgsl",
2248
2782
  "entryPoint": "main",
2249
2783
  "workgroup": [
2250
2784
  256,
@@ -2258,18 +2792,45 @@
2258
2792
  "variantMetadata": {
2259
2793
  "maxKVLen": 2048
2260
2794
  },
2261
- "description": "Tiered decode kernel - f32 Q + f16 KV",
2795
+ "description": "Tiered decode kernel - TurboQuant MSE cold K/V with f16 hot K/V",
2262
2796
  "reachability": {
2263
- "status": "unused",
2797
+ "status": "selectable",
2264
2798
  "inlineConfigs": [],
2265
- "ruleChains": [],
2799
+ "ruleChains": [
2800
+ "attention.rules.json#tieredQuantVariant"
2801
+ ],
2802
+ "wgslOnDisk": true
2803
+ }
2804
+ },
2805
+ "decode_tiered_turboquant_prod_f16kv": {
2806
+ "wgsl": "attention_decode_tiered_turboquant_prod_f16kv.wgsl",
2807
+ "entryPoint": "main",
2808
+ "workgroup": [
2809
+ 256,
2810
+ 1,
2811
+ 1
2812
+ ],
2813
+ "requires": [
2814
+ "shader-f16"
2815
+ ],
2816
+ "outputDtype": "f32",
2817
+ "variantMetadata": {
2818
+ "maxKVLen": 2048
2819
+ },
2820
+ "description": "Tiered decode kernel - TurboQuant prod (MSE+QJL) cold K/V with f16 hot K/V",
2821
+ "reachability": {
2822
+ "status": "selectable",
2823
+ "inlineConfigs": [],
2824
+ "ruleChains": [
2825
+ "attention.rules.json#tieredQuantVariant"
2826
+ ],
2266
2827
  "wgslOnDisk": true
2267
2828
  }
2268
2829
  }
2269
2830
  }
2270
2831
  },
2271
- "attention_tiered_quant": {
2272
- "description": "Tiered attention kernels with quantized cold cache",
2832
+ "attention_contiguous_quant": {
2833
+ "description": "Contiguous quantized attention kernels for full-attention models",
2273
2834
  "baseBindings": [
2274
2835
  {
2275
2836
  "index": 0,
@@ -2283,42 +2844,42 @@
2283
2844
  },
2284
2845
  {
2285
2846
  "index": 2,
2286
- "name": "K_hot",
2847
+ "name": "K_packed",
2287
2848
  "type": "read-only-storage"
2288
2849
  },
2289
2850
  {
2290
2851
  "index": 3,
2291
- "name": "V_hot",
2852
+ "name": "V_packed",
2292
2853
  "type": "read-only-storage"
2293
2854
  },
2294
2855
  {
2295
2856
  "index": 4,
2296
- "name": "K_cold",
2857
+ "name": "scales_k",
2297
2858
  "type": "read-only-storage"
2298
2859
  },
2299
2860
  {
2300
2861
  "index": 5,
2301
- "name": "V_cold",
2862
+ "name": "scales_v",
2302
2863
  "type": "read-only-storage"
2303
2864
  },
2304
2865
  {
2305
2866
  "index": 6,
2306
- "name": "scales_k",
2307
- "type": "read-only-storage"
2867
+ "name": "output",
2868
+ "type": "storage"
2308
2869
  },
2309
2870
  {
2310
2871
  "index": 7,
2311
- "name": "scales_v",
2872
+ "name": "rotation_matrix",
2312
2873
  "type": "read-only-storage"
2313
2874
  },
2314
2875
  {
2315
2876
  "index": 8,
2316
- "name": "output",
2317
- "type": "storage"
2877
+ "name": "codebook_centroids",
2878
+ "type": "read-only-storage"
2318
2879
  }
2319
2880
  ],
2320
2881
  "baseUniforms": {
2321
- "size": 64,
2882
+ "size": 48,
2322
2883
  "fields": [
2323
2884
  {
2324
2885
  "name": "num_heads",
@@ -2336,70 +2897,55 @@
2336
2897
  "offset": 8
2337
2898
  },
2338
2899
  {
2339
- "name": "cold_len",
2900
+ "name": "kv_len",
2340
2901
  "type": "u32",
2341
2902
  "offset": 12
2342
2903
  },
2343
- {
2344
- "name": "hot_len",
2345
- "type": "u32",
2346
- "offset": 16
2347
- },
2348
2904
  {
2349
2905
  "name": "seq_len",
2350
2906
  "type": "u32",
2351
- "offset": 20
2907
+ "offset": 16
2352
2908
  },
2353
2909
  {
2354
2910
  "name": "scale",
2355
2911
  "type": "f32",
2356
- "offset": 24
2912
+ "offset": 20
2357
2913
  },
2358
2914
  {
2359
2915
  "name": "is_causal",
2360
2916
  "type": "u32",
2361
- "offset": 28
2917
+ "offset": 24
2362
2918
  },
2363
2919
  {
2364
2920
  "name": "start_pos",
2365
2921
  "type": "u32",
2366
- "offset": 32
2922
+ "offset": 28
2367
2923
  },
2368
2924
  {
2369
2925
  "name": "attn_softcap",
2370
2926
  "type": "f32",
2371
- "offset": 36
2927
+ "offset": 32
2372
2928
  },
2373
2929
  {
2374
2930
  "name": "sliding_window",
2375
2931
  "type": "u32",
2376
- "offset": 40
2377
- },
2378
- {
2379
- "name": "hot_window",
2380
- "type": "u32",
2381
- "offset": 44
2382
- },
2383
- {
2384
- "name": "hot_start",
2385
- "type": "u32",
2386
- "offset": 48
2932
+ "offset": 36
2387
2933
  },
2388
2934
  {
2389
2935
  "name": "packed_stride",
2390
2936
  "type": "u32",
2391
- "offset": 52
2937
+ "offset": 40
2392
2938
  },
2393
2939
  {
2394
2940
  "name": "_pad",
2395
2941
  "type": "u32",
2396
- "offset": 56
2942
+ "offset": 44
2397
2943
  }
2398
2944
  ]
2399
2945
  },
2400
2946
  "variants": {
2401
- "decode_tiered_int8_f16kv": {
2402
- "wgsl": "attention_decode_tiered_int8_f16kv.wgsl",
2947
+ "decode_contiguous_turboquant_f16kv": {
2948
+ "wgsl": "attention_decode_contiguous_turboquant_f16kv.wgsl",
2403
2949
  "entryPoint": "main",
2404
2950
  "workgroup": [
2405
2951
  256,
@@ -2413,16 +2959,18 @@
2413
2959
  "variantMetadata": {
2414
2960
  "maxKVLen": 2048
2415
2961
  },
2416
- "description": "Tiered decode kernel - int8 cold K/V with f16 hot K/V",
2962
+ "description": "Contiguous decode kernel - TurboQuant MSE quantized K/V",
2417
2963
  "reachability": {
2418
- "status": "unused",
2964
+ "status": "selectable",
2419
2965
  "inlineConfigs": [],
2420
- "ruleChains": [],
2966
+ "ruleChains": [
2967
+ "attention.rules.json#contiguousQuantVariant"
2968
+ ],
2421
2969
  "wgslOnDisk": true
2422
2970
  }
2423
2971
  },
2424
- "decode_tiered_int4_f16kv": {
2425
- "wgsl": "attention_decode_tiered_int4_f16kv.wgsl",
2972
+ "decode_contiguous_turboquant_prod_f16kv": {
2973
+ "wgsl": "attention_decode_contiguous_turboquant_prod_f16kv.wgsl",
2426
2974
  "entryPoint": "main",
2427
2975
  "workgroup": [
2428
2976
  256,
@@ -2436,11 +2984,13 @@
2436
2984
  "variantMetadata": {
2437
2985
  "maxKVLen": 2048
2438
2986
  },
2439
- "description": "Tiered decode kernel - int4 cold K/V with f16 hot K/V",
2987
+ "description": "Contiguous decode kernel - TurboQuant prod (MSE+QJL) quantized K/V",
2440
2988
  "reachability": {
2441
- "status": "unused",
2989
+ "status": "selectable",
2442
2990
  "inlineConfigs": [],
2443
- "ruleChains": [],
2991
+ "ruleChains": [
2992
+ "attention.rules.json#contiguousQuantVariant"
2993
+ ],
2444
2994
  "wgslOnDisk": true
2445
2995
  }
2446
2996
  }
@@ -2562,6 +3112,48 @@
2562
3112
  ],
2563
3113
  "wgslOnDisk": true
2564
3114
  }
3115
+ },
3116
+ "turboquant": {
3117
+ "wgsl": "kv_quantize_turboquant.wgsl",
3118
+ "entryPoint": "main",
3119
+ "workgroup": [
3120
+ 256,
3121
+ 1,
3122
+ 1
3123
+ ],
3124
+ "requires": [
3125
+ "shader-f16"
3126
+ ],
3127
+ "description": "TurboQuant MSE: rotation + codebook quantize with per-head norm",
3128
+ "reachability": {
3129
+ "status": "selectable",
3130
+ "inlineConfigs": [],
3131
+ "ruleChains": [
3132
+ "kv_quantize.rules.json#variant"
3133
+ ],
3134
+ "wgslOnDisk": true
3135
+ }
3136
+ },
3137
+ "turboquant_prod": {
3138
+ "wgsl": "kv_quantize_turboquant_prod.wgsl",
3139
+ "entryPoint": "main",
3140
+ "workgroup": [
3141
+ 256,
3142
+ 1,
3143
+ 1
3144
+ ],
3145
+ "requires": [
3146
+ "shader-f16"
3147
+ ],
3148
+ "description": "TurboQuant prod: MSE at (b-1) bits + 1-bit QJL residual for unbiased inner products",
3149
+ "reachability": {
3150
+ "status": "selectable",
3151
+ "inlineConfigs": [],
3152
+ "ruleChains": [
3153
+ "kv_quantize.rules.json#variant"
3154
+ ],
3155
+ "wgslOnDisk": true
3156
+ }
2565
3157
  }
2566
3158
  }
2567
3159
  },
@@ -3757,6 +4349,26 @@
3757
4349
  "wgslOnDisk": true
3758
4350
  }
3759
4351
  },
4352
+ "default_f16": {
4353
+ "wgsl": "scale_f16.wgsl",
4354
+ "entryPoint": "main",
4355
+ "workgroup": [
4356
+ 256,
4357
+ 1,
4358
+ 1
4359
+ ],
4360
+ "requires": [
4361
+ "shader-f16"
4362
+ ],
4363
+ "reachability": {
4364
+ "status": "selectable",
4365
+ "inlineConfigs": [],
4366
+ "ruleChains": [
4367
+ "scale.rules.json#variant"
4368
+ ],
4369
+ "wgslOnDisk": true
4370
+ }
4371
+ },
3760
4372
  "inplace": {
3761
4373
  "wgsl": "scale.wgsl",
3762
4374
  "entryPoint": "main_inplace",
@@ -3774,6 +4386,26 @@
3774
4386
  ],
3775
4387
  "wgslOnDisk": true
3776
4388
  }
4389
+ },
4390
+ "inplace_f16": {
4391
+ "wgsl": "scale_f16.wgsl",
4392
+ "entryPoint": "main_inplace",
4393
+ "workgroup": [
4394
+ 256,
4395
+ 1,
4396
+ 1
4397
+ ],
4398
+ "requires": [
4399
+ "shader-f16"
4400
+ ],
4401
+ "reachability": {
4402
+ "status": "selectable",
4403
+ "inlineConfigs": [],
4404
+ "ruleChains": [
4405
+ "scale.rules.json#variant"
4406
+ ],
4407
+ "wgslOnDisk": true
4408
+ }
3777
4409
  }
3778
4410
  }
3779
4411
  },
@@ -4436,7 +5068,7 @@
4436
5068
  }
4437
5069
  ],
4438
5070
  "baseUniforms": {
4439
- "size": 32,
5071
+ "size": 36,
4440
5072
  "fields": [
4441
5073
  {
4442
5074
  "name": "num_tokens",
@@ -4464,19 +5096,24 @@
4464
5096
  "offset": 16
4465
5097
  },
4466
5098
  {
4467
- "name": "_pad0",
5099
+ "name": "input_hidden_size",
4468
5100
  "type": "u32",
4469
5101
  "offset": 20
4470
5102
  },
4471
5103
  {
4472
- "name": "_pad1",
5104
+ "name": "hidden_offset",
4473
5105
  "type": "u32",
4474
5106
  "offset": 24
4475
5107
  },
4476
5108
  {
4477
- "name": "_pad2",
5109
+ "name": "_pad0",
4478
5110
  "type": "u32",
4479
5111
  "offset": 28
5112
+ },
5113
+ {
5114
+ "name": "_pad1",
5115
+ "type": "u32",
5116
+ "offset": 32
4480
5117
  }
4481
5118
  ]
4482
5119
  },
@@ -7559,6 +8196,75 @@
7559
8196
  }
7560
8197
  }
7561
8198
  },
8199
+ "depthwise_conv1d": {
8200
+ "description": "Depthwise Conv1D (channels-first, same-padded)",
8201
+ "baseBindings": [
8202
+ {
8203
+ "index": 0,
8204
+ "name": "uniforms",
8205
+ "type": "uniform"
8206
+ },
8207
+ {
8208
+ "index": 1,
8209
+ "name": "input",
8210
+ "type": "read-only-storage"
8211
+ },
8212
+ {
8213
+ "index": 2,
8214
+ "name": "weight",
8215
+ "type": "read-only-storage"
8216
+ },
8217
+ {
8218
+ "index": 3,
8219
+ "name": "output",
8220
+ "type": "storage"
8221
+ }
8222
+ ],
8223
+ "baseUniforms": {
8224
+ "size": 16,
8225
+ "fields": [
8226
+ {
8227
+ "name": "channels",
8228
+ "type": "u32",
8229
+ "offset": 0
8230
+ },
8231
+ {
8232
+ "name": "length",
8233
+ "type": "u32",
8234
+ "offset": 4
8235
+ },
8236
+ {
8237
+ "name": "kernel_size",
8238
+ "type": "u32",
8239
+ "offset": 8
8240
+ },
8241
+ {
8242
+ "name": "_pad0",
8243
+ "type": "u32",
8244
+ "offset": 12
8245
+ }
8246
+ ]
8247
+ },
8248
+ "variants": {
8249
+ "depthwise_conv1d": {
8250
+ "wgsl": "depthwise_conv1d.wgsl",
8251
+ "entryPoint": "main",
8252
+ "workgroup": [
8253
+ 256,
8254
+ 1,
8255
+ 1
8256
+ ],
8257
+ "requires": [],
8258
+ "outputDtype": "f32",
8259
+ "reachability": {
8260
+ "status": "pinned",
8261
+ "inlineConfigs": [],
8262
+ "ruleChains": [],
8263
+ "wgslOnDisk": true
8264
+ }
8265
+ }
8266
+ }
8267
+ },
7562
8268
  "grouped_pointwise_conv2d": {
7563
8269
  "description": "Grouped Pointwise Conv2D (NCHW)",
7564
8270
  "baseBindings": [