@clutor/core 0.2.0 → 0.3.1
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.
- package/dist/index.cjs +39 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -36,6 +36,8 @@ interface ArchitectureSpec {
|
|
|
36
36
|
sharedExperts: number;
|
|
37
37
|
expertFfn: number;
|
|
38
38
|
maxContext: number;
|
|
39
|
+
/** The output projection is the embedding matrix itself (small Qwen2.5 models), so the vocabulary matrix is counted once. */
|
|
40
|
+
tiedEmbeddings?: boolean;
|
|
39
41
|
/** The headline parameter count the vendor publishes, to check the computation against. */
|
|
40
42
|
publishedParamsB: number;
|
|
41
43
|
source: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ interface ArchitectureSpec {
|
|
|
36
36
|
sharedExperts: number;
|
|
37
37
|
expertFfn: number;
|
|
38
38
|
maxContext: number;
|
|
39
|
+
/** The output projection is the embedding matrix itself (small Qwen2.5 models), so the vocabulary matrix is counted once. */
|
|
40
|
+
tiedEmbeddings?: boolean;
|
|
39
41
|
/** The headline parameter count the vendor publishes, to check the computation against. */
|
|
40
42
|
publishedParamsB: number;
|
|
41
43
|
source: string;
|
package/dist/index.js
CHANGED
|
@@ -238,6 +238,24 @@ var CATALOG = [
|
|
|
238
238
|
publishedParamsB: 6.9,
|
|
239
239
|
source: "OLMoE paper (Muennighoff et al., 2024)"
|
|
240
240
|
},
|
|
241
|
+
{
|
|
242
|
+
id: "granite-3.0-3b-a800m",
|
|
243
|
+
name: "Granite 3.0 3B-A800M (IBM)",
|
|
244
|
+
family: "granite-moe",
|
|
245
|
+
layers: 32,
|
|
246
|
+
denseLayers: 0,
|
|
247
|
+
hidden: 1536,
|
|
248
|
+
vocab: 49155,
|
|
249
|
+
denseFfn: 0,
|
|
250
|
+
attention: { kind: "gqa", heads: 24, kvHeads: 8, headDim: 64 },
|
|
251
|
+
experts: 40,
|
|
252
|
+
expertsUsed: 8,
|
|
253
|
+
sharedExperts: 0,
|
|
254
|
+
expertFfn: 512,
|
|
255
|
+
maxContext: 4096,
|
|
256
|
+
publishedParamsB: 3.4,
|
|
257
|
+
source: "IBM Granite 3.0 model card; shapes read from the GGUF header of granite-3.0-3b-a800m-instruct"
|
|
258
|
+
},
|
|
241
259
|
{
|
|
242
260
|
id: "qwen2.5-coder-7b",
|
|
243
261
|
name: "Qwen2.5-Coder-7B (dense)",
|
|
@@ -255,6 +273,25 @@ var CATALOG = [
|
|
|
255
273
|
maxContext: 131072,
|
|
256
274
|
publishedParamsB: 7.6,
|
|
257
275
|
source: "Qwen2.5-Coder model card"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
id: "qwen2.5-1.5b",
|
|
279
|
+
name: "Qwen2.5-1.5B-Instruct (dense)",
|
|
280
|
+
family: "qwen2",
|
|
281
|
+
layers: 28,
|
|
282
|
+
denseLayers: 28,
|
|
283
|
+
hidden: 1536,
|
|
284
|
+
vocab: 151936,
|
|
285
|
+
denseFfn: 8960,
|
|
286
|
+
attention: { kind: "gqa", heads: 12, kvHeads: 2, headDim: 128 },
|
|
287
|
+
experts: 0,
|
|
288
|
+
expertsUsed: 0,
|
|
289
|
+
sharedExperts: 0,
|
|
290
|
+
expertFfn: 0,
|
|
291
|
+
maxContext: 32768,
|
|
292
|
+
tiedEmbeddings: true,
|
|
293
|
+
publishedParamsB: 1.54,
|
|
294
|
+
source: "Qwen2.5 model card; shapes read from the GGUF header of qwen2.5-1.5b-instruct"
|
|
258
295
|
}
|
|
259
296
|
];
|
|
260
297
|
function layerParams(s, moe) {
|
|
@@ -271,7 +308,7 @@ function layerParams(s, moe) {
|
|
|
271
308
|
};
|
|
272
309
|
}
|
|
273
310
|
function totalParams(s) {
|
|
274
|
-
let n = 2 * s.vocab * s.hidden;
|
|
311
|
+
let n = (s.tiedEmbeddings ? 1 : 2) * s.vocab * s.hidden;
|
|
275
312
|
for (let l = 0; l < s.layers; l++) {
|
|
276
313
|
const p = layerParams(s, s.experts > 0 && l >= s.denseLayers);
|
|
277
314
|
n += p.attention + p.denseFfn + p.routed + p.shared + p.router;
|
|
@@ -284,7 +321,7 @@ function approximateLayout(s, bitsPerWeight2) {
|
|
|
284
321
|
let offset = 0;
|
|
285
322
|
const layers = [];
|
|
286
323
|
let total = 0;
|
|
287
|
-
const resident = bytes(2 * s.vocab * s.hidden);
|
|
324
|
+
const resident = bytes((s.tiedEmbeddings ? 1 : 2) * s.vocab * s.hidden);
|
|
288
325
|
for (let l = 0; l < s.layers; l++) {
|
|
289
326
|
const moe = s.experts > 0 && l >= s.denseLayers;
|
|
290
327
|
const p = layerParams(s, moe);
|