bitgpu 0.14.0 → 0.16.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.
@@ -54,6 +54,28 @@ interface ManifestArch {
54
54
  };
55
55
  /** position cap for synthesized rope (GGUF context_length) */
56
56
  max_positions?: number;
57
+ /** Hybrid backbone (qwen3_5 / GGUF `qwen35`): a per-layer mix of gated-DeltaNet linear
58
+ * attention and gated full attention. Absent for the dense qwen3 models. When present, the
59
+ * full-attention layers use partial RoPE ({@link HybridArch.rotary_dim}) and an output gate. */
60
+ hybrid?: HybridArch;
61
+ }
62
+ /** The extra architecture contract for the hybrid qwen3_5 backbone. `heads`/`kv_heads`/`head_dim`
63
+ * on {@link ManifestArch} describe the FULL-attention layers; the linear layers are described here. */
64
+ interface HybridArch {
65
+ /** Per-layer token mixer, length = {@link ManifestArch.layers}: `'linear'` = gated DeltaNet,
66
+ * `'full'` = gated attention. Derived from the 3:1 `full_attention_interval` pattern. */
67
+ layer_types: ('linear' | 'full')[];
68
+ /** Number of key/query heads in the gated-DeltaNet layers (GGUF `ssm.group_count`). */
69
+ linear_key_heads: number;
70
+ /** Number of value heads (>= key heads; query/key are repeat-interleaved to match). GGUF `ssm.time_step_rank`. */
71
+ linear_value_heads: number;
72
+ /** Head dim of the linear-attention keys and values (they share it). GGUF `ssm.state_size`. */
73
+ linear_head_dim: number;
74
+ /** Depthwise causal conv1d kernel width applied to the q/k/v stream (GGUF `ssm.conv_kernel`). */
75
+ conv_kernel: number;
76
+ /** Rotary dims actually rotated in the full-attention layers (partial RoPE, GGUF `rope.dimension_count`);
77
+ * the remaining `head_dim - rotary_dim` dims pass through unrotated. */
78
+ rotary_dim: number;
57
79
  }
58
80
  /** The small model-description file bitgpu loads (see docs/FORMAT.md). Usually fetched as
59
81
  * `manifest.json`; `bitgpu/gguf` builds one in memory straight from a GGUF header. */
@@ -351,7 +373,8 @@ interface KvSnapshot {
351
373
  * full snapshot (all positions in `data`). Restore validates the target is exactly at the base
352
374
  * boundary with a matching token prefix. */
353
375
  base?: number;
354
- /** Packed per-layer cached K/V bytes (and q8 block scales) for the stored positions. */
376
+ /** Packed cached K/V bytes (and q8 block scales) for the stored positions, per KV-bearing layer;
377
+ * for the qwen3_5 hybrid the DeltaNet recurrent + conv state of each linear layer is appended. */
355
378
  data: ArrayBuffer;
356
379
  }
357
380
  /** A loaded model ready to generate. Create one with {@link createEngine}. */
@@ -401,4 +424,4 @@ interface Engine {
401
424
  }
402
425
  //#endregion
403
426
  export { ForwardResult as a, KvSnapshot as c, ManifestArch as d, ManifestRef as f, EngineOptions as i, LoadProgress as l, TokenLogprobs as m, Engine as n, GenerateOptions as o, ManifestTensor as p, EngineCapabilities as r, GenerateResult as s, DeviceLostInfo as t, Manifest as u };
404
- //# sourceMappingURL=types-iFADjEuf.d.ts.map
427
+ //# sourceMappingURL=types-Wg8VrdrL.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitgpu",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "description": "Fast WebGPU runtime for 1-bit (binary-weight) LLMs in the browser. Bit-exact, zero runtime dependencies.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -56,6 +56,8 @@
56
56
  "prepare": "npm run build",
57
57
  "prepublishOnly": "npm run build && npm run check:publish",
58
58
  "test:gguf": "tsx scripts/verify-gguf.ts",
59
+ "test:kernels": "python3 tools/gen-kernel-cases.py && node scripts/verify-kernels.mjs",
60
+ "test:hybrid": "python3 tools/gen-synth-qwen35.py && npm run build && node scripts/verify-hybrid.mjs",
59
61
  "profile": "node scripts/profile.mjs",
60
62
  "bench": "node scripts/benchmark.mjs"
61
63
  },