File size: 2,878 Bytes
e49b028
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{
  "schema_version": 1,
  "_comment": "Bonsai-27B (prism-ml) qwen3_5 GatedDeltaNet hybrid TEXT decoder at TRUE 1-BIT (Q1_0_g128, 1.125 bit/weight) for v81. 48 recurrent gated delta-rule linear-attn layers (+ short conv state) + 16 full gated softmax-attn layers (partial-rotary M-RoPE rot 64, output gate). Every Linear is the device-verified BonsaiBitnetOpPkg::BitnetLinear 1-bit op; norms/conv/SSM stay native. Weights come from the Q1_0 GGUF (dequant is the oracle). Decode is sharded (decode_shards) to fit the per-context cDSP memory wall; the qwen3_5_generate host-op (device-validated on qwen3.5-0.8b @ 25 tok/s) threads conv/SSM/KV state + drives the decode loop unchanged.",
  "model": {
    "name": "bonsai-27b-1bit",
    "family": "llm",
    "dsp_arch": "v81",
    "tokenizer_pre": "qwen2"
  },
  "chat": {
    "system": {
      "prefix": "<|im_start|>system\n",
      "suffix": "<|im_end|>\n"
    },
    "user": {
      "prefix": "<|im_start|>user\n",
      "suffix": "<|im_end|>\n"
    },
    "assistant": {
      "prefix": "<|im_start|>assistant\n",
      "suffix": "<|im_end|>\n"
    }
  },
  "params": {
    "hidden": 5120,
    "vocab": 248320,
    "n_layers": 64,
    "max_ctx": 2048,
    "kv_dim": 1024,
    "head_dim": 256,
    "rope_theta": 10000000.0,
    "eos_token_id": 248044,
    "gated_delta": {
      "q_heads": 24,
      "kv_heads": 4,
      "lin_k_heads": 16,
      "lin_v_heads": 48,
      "lin_k_dim": 128,
      "lin_v_dim": 128,
      "conv_kernel": 4,
      "full_every": 4,
      "rot_dim": 64,
      "attn_gate": true,
      "full_attn_idx": [
        3,
        7,
        11,
        15,
        19,
        23,
        27,
        31,
        35,
        39,
        43,
        47,
        51,
        55,
        59,
        63
      ]
    }
  },
  "artifacts": {
    "contexts": {
      "decode_s0": {
        "bin": "bonsai27b_decode_s0_bitnet.bin",
        "op_packages": [
          {
            "path": "libQnnBonsaiBitnet.so",
            "interface": "exampleInterfaceProvider",
            "targets": [
              "CPU",
              "HTP"
            ]
          }
        ]
      },
      "decode_s1": {
        "bin": "bonsai27b_decode_s1_bitnet.bin"
      },
      "decode_s2": {
        "bin": "bonsai27b_decode_s2_bitnet.bin"
      },
      "decode_s3": {
        "bin": "bonsai27b_decode_s3_bitnet.bin"
      },
      "lmhead": {
        "bin": "bonsai27b_lmhead_bitnet.bin"
      }
    },
    "embed": "bonsai27b_embed_f16.bin",
    "tokenizer": "tokenizer.json"
  },
  "plan": {
    "steps": [
      {
        "host": "qwen3_5_generate",
        "params": {
          "decode": "bonsai27b_decode_s0_bitnet,bonsai27b_decode_s1_bitnet,bonsai27b_decode_s2_bitnet,bonsai27b_decode_s3_bitnet",
          "lmhead": "bonsai27b_lmhead_bitnet",
          "max_new": 64,
          "neg": -50000
        }
      }
    ]
  }
}