aiinfra-tools 0.3.0 → 0.4.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.
- package/CHANGELOG.md +58 -0
- package/README.md +13 -0
- package/fleetops/deploy/shadow-live/README.md +8 -0
- package/fleetops/deploy/shadow-live/kit.yaml +2 -0
- package/fleetops/deploy/shadow-live/run.sh +6 -1
- package/fleetops/package.json +1 -1
- package/fleetops/src/ingest.mjs +9 -2
- package/fleetops/src/serving.mjs +11 -1
- package/fleetscope/build.mjs +3 -0
- package/fleetscope/dist/index.html +719 -3
- package/fleetscope/package.json +1 -1
- package/fleetscope/src/engine.js +19 -2
- package/fleetscope/src/index.src.html +6 -0
- package/gpu-health/package.json +1 -1
- package/gpu-ledger/package.json +1 -1
- package/harness-ledger/package.json +1 -1
- package/hybrid-tracing/package.json +1 -1
- package/inference-sizer/dist/index.html +97 -12
- package/inference-sizer/docs/CATALOG.md +71 -0
- package/inference-sizer/docs/METHOD.md +1 -1
- package/inference-sizer/package.json +1 -1
- package/inference-sizer/src/accelerators.js +23 -1
- package/inference-sizer/src/catalog.js +49 -3
- package/inference-sizer/src/model.js +24 -7
- package/inference-sizer/src/ui.js +1 -1
- package/inference-sizer/tools/validate-agentx.mjs +8 -2
- package/inference-sizer/tools/validate-inferencex.mjs +1 -1
- package/package.json +2 -3
package/fleetscope/package.json
CHANGED
package/fleetscope/src/engine.js
CHANGED
|
@@ -42,14 +42,31 @@
|
|
|
42
42
|
'llama-405b': { label: 'Llama 3.1 405B', params: 405, active: 405, layers: 126, kvHeads: 8, headDim: 128, mla: 0 },
|
|
43
43
|
'moe-671b': { label: 'MoE 671B, 37B active (MLA)', params: 671, active: 37, layers: 61, kvHeads: 0, headDim: 0, mla: 576 }
|
|
44
44
|
};
|
|
45
|
+
// Every other model in the Inference Sizer's catalog (one list for both tools, kept current there). kvScale: the KV a
|
|
46
|
+
// token holds, averaged over a 32K context, against the plain kvDim × layers figure, so sliding-window, linear-attention
|
|
47
|
+
// and compressed layers count; it scales with the layers and heads if they are edited.
|
|
48
|
+
const node = typeof module !== 'undefined' && module.exports;
|
|
49
|
+
const CAT = node ? require('../../inference-sizer/src/catalog.js') : root.SizerCatalog, SZ = node ? require('../../inference-sizer/src/model.js') : root.SizerModel;
|
|
50
|
+
const kvDimTotal = m => (m.mla ? m.layers * m.mla : 2 * m.layers * m.kvHeads * m.headDim);
|
|
51
|
+
for (const k of Object.keys(MODELS)) MODELS[k].kvScale = 1;
|
|
52
|
+
const IN_LIST = { 'llama31-8b': 'llama-8b', 'llama33-70b': 'llama-70b', 'llama31-405b': 'llama-405b', 'deepseek-v3': 'moe-671b' };
|
|
53
|
+
if (CAT && SZ) {
|
|
54
|
+
for (const c of CAT.MODELS) {
|
|
55
|
+
if (IN_LIST[c.id] || MODELS[c.id]) continue;
|
|
56
|
+
const m = { label: c.name, params: c.total, active: c.active, layers: c.layers, kvHeads: c.attn === 'mla' ? 0 : c.kvHeads, headDim: c.attn === 'mla' ? 0 : c.headDim, mla: c.attn === 'mla' ? (c.mlaLatent || 512) + (c.mlaRope == null ? 64 : c.mlaRope) : 0 };
|
|
57
|
+
const md = SZ.derive(Object.assign({}, SZ.SETTINGS, CAT.MODEL_DEFAULTS, c, { kvprec: 'fp8', tfBf16: 1, hbmTBs: 1, scaleUpGBs: 1, nicGbps: 1, hbmGB: 1 }));
|
|
58
|
+
m.kvScale = +(SZ.kvBytes(md, 32768) / 32768 / kvDimTotal(m)).toFixed(4);
|
|
59
|
+
MODELS[c.id] = m;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
45
62
|
|
|
46
63
|
// ---------- performance profile ----------
|
|
47
64
|
// tpFixed: GPUs per instance set on the pool (0 or absent = smallest power of two whose share of the weights fits).
|
|
48
65
|
function profile(gpuKey, m, tpFixed) {
|
|
49
66
|
const G = GPUS[gpuKey];
|
|
50
|
-
const wBytes = m.params * 1e9 * (m.wPrec === 'bf16' ? 2 : 1);
|
|
67
|
+
const wBytes = m.params * 1e9 * (m.wPrec === 'bf16' ? 2 : m.wPrec === 'fp4' ? 0.5625 : 1);
|
|
51
68
|
const kvElem = m.kvPrec === 'bf16' ? 2 : 1;
|
|
52
|
-
const kvBytesPerToken = m
|
|
69
|
+
const kvBytesPerToken = kvDimTotal(m) * kvElem * (m.kvScale > 0 ? m.kvScale : 1);
|
|
53
70
|
let tp = 1;
|
|
54
71
|
if (tpFixed > 0) tp = Math.round(tpFixed);
|
|
55
72
|
else while (tp < 16 && wBytes / tp > 0.65 * G.hbm * 1e9) tp *= 2;
|
package/gpu-health/package.json
CHANGED
package/gpu-ledger/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "harness-ledger",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"private": true,
|
|
6
6
|
"description": "Where agent harnesses waste model resources, across harnesses: cache misses, bloated tool output, repeats, retries, unused tools; in tokens, dollars and GPU time.",
|
|
@@ -272,6 +272,11 @@ nav.views .chip { font-size: 12.5px; padding: 4px 12px; }
|
|
|
272
272
|
|
|
273
273
|
const A = (o) => Object.assign({ kind: 'gpu', tfFp4: 0 }, o);
|
|
274
274
|
const ACCELERATORS = [
|
|
275
|
+
// Vera Rubin NVL72 (VR200; first called NVL144 for its 144 dies): per Rubin package, 288 GB HBM4 at 22 TB/s; dense
|
|
276
|
+
// NVFP4 35 PF (the 50 PF inference figure uses adaptive compression), FP8 17.5 PF, BF16 4 PF; NVLink 6 3.6 TB/s
|
|
277
|
+
// bidirectional; ConnectX-9 1.6 Tb/s. NVIDIA publishes no board power: 2.3 kW is the reported Max-P TGP.
|
|
278
|
+
A({ id: 'VR200-NVL72', short: 'VR200', label: 'NVIDIA Vera Rubin NVL72 (72-GPU rack)', vendor: 'NVIDIA', vendorKey: 'nvidia', hbmGB: 288, hbmTBs: 22, tfBf16: 4000, tfFp8: 17500, tfFp4: 35000, scaleUpGBs: 1800, domain: 72, nicGbps: 1600, tdpW: 2300, price: 11.0, onprem: 6.5, match: 'Rubin(?!.*CPX)|VR200|\\bR200\\b',
|
|
279
|
+
source: 'https://developer.nvidia.com/blog/inside-the-NVIDIA-rubin-platform-six-new-chips-one-ai-supercomputer' }),
|
|
275
280
|
A({ id: 'GB300-NVL72', short: 'GB300', label: 'NVIDIA GB300 NVL72 (72-GPU rack)', vendor: 'NVIDIA', vendorKey: 'nvidia', hbmGB: 278, hbmTBs: 8, tfBf16: 2500, tfFp8: 5000, tfFp4: 15000, scaleUpGBs: 900, domain: 72, nicGbps: 800, tdpW: 1400, price: 7.5, onprem: 4.4, match: 'GB300',
|
|
276
281
|
// rack figures ÷ 72: 20 TB HBM, 576 TB/s, 360/720/1080 PFLOPS BF16 (sparse)/FP8 (sparse)/FP4 (dense); board power from InferenceX's chip page
|
|
277
282
|
source: 'https://www.nvidia.com/en-us/data-center/gb300-nvl72/' }),
|
|
@@ -287,8 +292,17 @@ nav.views .chip { font-size: 12.5px; padding: 4px 12px; }
|
|
|
287
292
|
source: 'https://www.nvidia.com/en-us/data-center/h100/' }),
|
|
288
293
|
A({ id: 'A100', label: 'NVIDIA A100 80GB SXM (8-GPU)', vendor: 'NVIDIA', vendorKey: 'nvidia', hbmGB: 80, hbmTBs: 2.0, tfBf16: 312, tfFp8: 0, scaleUpGBs: 300, domain: 8, nicGbps: 200, nodeKW: 6.5, tdpW: 400, price: 1.6, onprem: 0.9, match: 'A100(?!.*PCIe)|A800',
|
|
289
294
|
source: 'https://www.nvidia.com/en-us/data-center/a100/' }),
|
|
295
|
+
// RTX PRO 6000 Blackwell Server Edition: 96 GB GDDR7 at 1.6 TB/s; 4 / 2 / 1 PF FP4 / FP8 / BF16 with sparsity
|
|
296
|
+
// (halved here); PCIe 5.0 x16 between cards; up to 600 W
|
|
297
|
+
A({ id: 'RTX-PRO-6000', short: 'RTXPRO6000', label: 'NVIDIA RTX PRO 6000 Blackwell Server (PCIe, 8 per server)', vendor: 'NVIDIA', vendorKey: 'nvidia', hbmGB: 96, hbmTBs: 1.6, tfBf16: 500, tfFp8: 1000, tfFp4: 2000, scaleUpGBs: 64, domain: 8, nicGbps: 400, tdpW: 600, price: 1.8, onprem: 1.0, match: 'RTX ?PRO ?6000|RTX-PRO-6000',
|
|
298
|
+
source: 'https://www.nvidia.com/en-us/data-center/rtx-pro-6000-blackwell-server-edition/' }),
|
|
290
299
|
A({ id: 'L40S', label: 'NVIDIA L40S (PCIe, 8 per server)', vendor: 'NVIDIA', vendorKey: 'nvidia', hbmGB: 48, hbmTBs: 0.864, tfBf16: 362, tfFp8: 733, scaleUpGBs: 32, domain: 8, nicGbps: 200, nodeKW: 5, tdpW: 350, price: 1.1, onprem: 0.7, match: 'L40S',
|
|
291
300
|
source: 'https://www.nvidia.com/en-us/data-center/l40s/' }),
|
|
301
|
+
// Helios rack: 72 MI455X, 432 GB HBM4 at 23.3 TB/s, 40 / 20 / 5 PF MXFP4 / MXFP8 / BF16, 3.6 TB/s scale-up
|
|
302
|
+
// (UALink over Ethernet, bidirectional), 43 TB/s scale-out per rack (2.4 Tb/s per GPU per direction), 246 kW per
|
|
303
|
+
// rack (AMD's validated reference design). AMD publishes no board power: ~1.7 kW is the reported projection.
|
|
304
|
+
A({ id: 'MI455X-Helios', short: 'MI455X', label: 'AMD Instinct MI455X Helios (72-GPU rack)', vendor: 'AMD', vendorKey: 'amd', hbmGB: 432, hbmTBs: 23.3, tfBf16: 5000, tfFp8: 20000, tfFp4: 40000, scaleUpGBs: 1800, domain: 72, nicGbps: 2400, nodeKW: 246, tdpW: 1700, price: 8.0, onprem: 4.8, match: 'MI455',
|
|
305
|
+
source: 'https://www.amd.com/en/products/accelerators/instinct/mi400.html' }),
|
|
292
306
|
A({ id: 'MI355X', label: 'AMD Instinct MI355X (8-GPU)', vendor: 'AMD', vendorKey: 'amd', hbmGB: 288, hbmTBs: 8, tfBf16: 2516.6, tfFp8: 5033.2, tfFp4: 10066.3, scaleUpGBs: 504, domain: 8, nicGbps: 400, tdpW: 1400, price: 4.5, onprem: 2.6, match: 'MI355',
|
|
293
307
|
// Infinity Fabric: 7 links × 144 GB/s (bidirectional) = 504 GB/s per direction
|
|
294
308
|
source: 'https://www.amd.com/en/products/accelerators/instinct/mi350/mi355x.html' }),
|
|
@@ -327,7 +341,7 @@ nav.views .chip { font-size: 12.5px; padding: 4px 12px; }
|
|
|
327
341
|
// ---------- cloud instance types ----------
|
|
328
342
|
// AWS: docs.aws.amazon.com/AWSEC2/latest/UserGuide/accelerated-computing-instances.html and aws.amazon.com/ec2/instance-types/p6/
|
|
329
343
|
const INSTANCES = {};
|
|
330
|
-
const add = (cloud, chip, list) => { for (const [type, gpus] of list) INSTANCES[type] = { cloud, chip, gpus }; };
|
|
344
|
+
const add = (cloud, chip, list) => { for (const [type, gpus] of list) INSTANCES[type.toLowerCase()] = { cloud, chip, gpus }; };
|
|
331
345
|
const sizes = (fam, one, more) => one.map(s => [`${fam}.${s}`, 1]).concat(more.map(([s, n]) => [`${fam}.${s}`, n]));
|
|
332
346
|
add('aws', 'A100-40GB', [['p4d.24xlarge', 8]]);
|
|
333
347
|
add('aws', 'A100', [['p4de.24xlarge', 8]]);
|
|
@@ -353,6 +367,14 @@ nav.views .chip { font-size: 12.5px; padding: 4px 12px; }
|
|
|
353
367
|
add('gcp', 'TPU-v5p', [['ct5p-hightpu-4t', 4]]);
|
|
354
368
|
add('gcp', 'TPU7x', [['tpu7x-standard-4t', 4]]);
|
|
355
369
|
add('gcp', 'TPU-v5e', [['ct5lp-hightpu-1t', 1], ['ct5lp-hightpu-4t', 4], ['ct5lp-hightpu-8t', 8]]);
|
|
370
|
+
// Azure: learn.microsoft.com/azure/virtual-machines/sizes/gpu-accelerated (ND H100/H200/MI300X v5, ND GB200 v6, ND A100 v4);
|
|
371
|
+
// AKS puts the size in node.kubernetes.io/instance-type with this capitalisation (matched case-insensitively)
|
|
372
|
+
add('azure', 'H100', [['Standard_ND96isr_H100_v5', 8]]);
|
|
373
|
+
add('azure', 'H200', [['Standard_ND96isr_H200_v5', 8]]);
|
|
374
|
+
add('azure', 'MI300X', [['Standard_ND96isr_MI300X_v5', 8]]);
|
|
375
|
+
add('azure', 'GB200-NVL72', [['Standard_ND128isr_NDR_GB200_v6', 4]]); // 18 VMs per NVL72 rack
|
|
376
|
+
add('azure', 'A100-40GB', [['Standard_ND96asr_v4', 8]]);
|
|
377
|
+
add('azure', 'A100', [['Standard_ND96amsr_A100_v4', 8]]);
|
|
356
378
|
const instanceOf = type => INSTANCES[String(type || '').toLowerCase()] || null;
|
|
357
379
|
// TPU slice topology for a chip count: 2D (v5e, v6e) or 3D torus (v4, v5p, 7x), as GKE's node selector wants it
|
|
358
380
|
const TOPO2 = { 1: '1x1', 4: '2x2', 8: '2x4', 16: '4x4', 32: '4x8', 64: '8x8', 128: '8x16', 256: '16x16' };
|
|
@@ -442,6 +464,10 @@ nav.views .chip { font-size: 12.5px; padding: 4px 12px; }
|
|
|
442
464
|
{ k: 'topk', label: 'Experts per token', min: 0, max: 1e4, int: true },
|
|
443
465
|
{ k: 'swaFrac', label: 'Share of sliding-window layers', min: 0, max: 1 },
|
|
444
466
|
{ k: 'swaWindow', label: 'Sliding window', unit: 'tokens', min: 0, max: 1e8, int: true },
|
|
467
|
+
{ k: 'linFrac', label: 'Share of linear-attention layers', min: 0, max: 1, hint: 'Kimi Delta Attention, Gated DeltaNet: a fixed state per sequence instead of KV per token.' },
|
|
468
|
+
{ k: 'linStateMB', label: 'Linear-attention state per layer', unit: 'MB', min: 0, max: 1e4, hint: 'Per sequence: value heads × key dim × value dim × 4 bytes (fp32).' },
|
|
469
|
+
{ k: 'kvKeep', label: 'Share of tokens whose KV is kept', min: 0.0001, max: 1, hint: 'Compressed attention (DeepSeek V4): average over layers. 1 for ordinary attention.' },
|
|
470
|
+
{ k: 'sparseTopK', label: 'Tokens attended per query (sparse attention)', unit: 'tokens', min: 0, max: 1e8, int: true, hint: 'DSA / CSA / MSA index top-k. 0 = attends every kept token.' },
|
|
445
471
|
{ k: 'maxCtx', label: 'Max context', unit: 'tokens', min: 256, max: 1e8, int: true, required: true },
|
|
446
472
|
{ k: 'wprec', type: 'enum', opts: ['bf16', 'fp8', 'fp4'], label: 'Default weight precision' },
|
|
447
473
|
{ k: 'source', type: 'text', label: 'Model card URL' },
|
|
@@ -451,7 +477,7 @@ nav.views .chip { font-size: 12.5px; padding: 4px 12px; }
|
|
|
451
477
|
// From the shared accelerator registry (accelerators.js): per-GPU dense figures, HGX/DGX system totals divided by 8
|
|
452
478
|
// (or 72 for NVL72), "with sparsity" figures halved. Prices are placeholder on-demand rents, not quotes.
|
|
453
479
|
const REG = (typeof module !== 'undefined' && module.exports) ? require('./accelerators.js') : root.AIInfraAccelerators;
|
|
454
|
-
const ORDER = ['B200', 'B300', 'GB200-NVL72', 'GB300-NVL72', 'H200', 'H100', 'A100', 'L40S', 'MI300X', 'MI325X', 'MI355X', 'TPU7x', 'TPU-v6e', 'TPU-v5p'];
|
|
480
|
+
const ORDER = ['B200', 'B300', 'GB200-NVL72', 'GB300-NVL72', 'VR200-NVL72', 'H200', 'H100', 'A100', 'L40S', 'RTX-PRO-6000', 'MI300X', 'MI325X', 'MI355X', 'MI455X-Helios', 'TPU7x', 'TPU-v6e', 'TPU-v5p'];
|
|
455
481
|
const KEEP = ['id', 'kind', 'vendorKey', 'gkeAccelerator', 'tdpW'].concat(GPU_FIELDS.map(f => f.k)); // tdpW: board power, for tokens per MW
|
|
456
482
|
const GPUS = REG.ACCELERATORS.slice().sort((a, b) => (ORDER.indexOf(a.id) + 1 || 99) - (ORDER.indexOf(b.id) + 1 || 99))
|
|
457
483
|
.map(g => Object.fromEntries(KEEP.filter(k => g[k] !== undefined).map(k => [k, g[k]])));
|
|
@@ -472,8 +498,36 @@ nav.views .chip { font-size: 12.5px; padding: 4px 12px; }
|
|
|
472
498
|
Object.assign({}, G, { id: 'qwen3-coder-480b', name: 'Qwen3-Coder 480B-A35B (MoE)', total: 480, active: 35, layers: 62, hidden: 6144, qHeads: 96, kvHeads: 8, headDim: 128, experts: 160, topk: 8, maxCtx: 262144, wprec: 'fp8', source: 'https://huggingface.co/Qwen/Qwen3-Coder-480B-A35B-Instruct' }),
|
|
473
499
|
Object.assign({}, G, MLA, { id: 'deepseek-v3', name: 'DeepSeek-V3 / R1 671B (MoE, MLA)', total: 671, active: 37, layers: 61, hidden: 7168, qHeads: 128, experts: 256, topk: 8, maxCtx: 131072, wprec: 'fp8', source: 'https://huggingface.co/deepseek-ai/DeepSeek-V3' }),
|
|
474
500
|
Object.assign({}, G, MLA, { id: 'kimi-k2', name: 'Kimi K2 1T (MoE, MLA)', total: 1040, active: 32, layers: 61, hidden: 7168, qHeads: 64, experts: 384, topk: 8, maxCtx: 131072, wprec: 'fp8', source: 'https://huggingface.co/moonshotai/Kimi-K2-Instruct' }),
|
|
501
|
+
// ---- 2026 open-weight models (config.json values; see docs/CATALOG.md for where each figure comes from) ----
|
|
502
|
+
// Kimi K3 (K3.1 Pro shares the architecture): 69 Kimi Delta Attention layers (96 heads × 128 × 128 fp32 state) and
|
|
503
|
+
// 24 gated MLA layers; MXFP4 weights from quantization-aware training.
|
|
504
|
+
Object.assign({}, G, MLA, { id: 'kimi-k3', name: 'Kimi K3 / K3.1 Pro 2.8T-A104B (MoE, KDA + MLA)', total: 2800, active: 104, layers: 93, hidden: 7168, qHeads: 96, experts: 896, topk: 16, linFrac: 69 / 93, linStateMB: 6.29, maxCtx: 1048576, wprec: 'fp4', source: 'https://huggingface.co/moonshotai/Kimi-K3' }),
|
|
505
|
+
// Kimi K2.5 / K2.6: K2's shape with 256K context and native INT4 weights (sized as 4-bit)
|
|
506
|
+
Object.assign({}, G, MLA, { id: 'kimi-k26', name: 'Kimi K2.6 1T-A32B (MoE, MLA, INT4)', total: 1000, active: 32, layers: 61, hidden: 7168, qHeads: 64, experts: 384, topk: 8, maxCtx: 262144, wprec: 'fp4', source: 'https://huggingface.co/moonshotai/Kimi-K2.6' }),
|
|
507
|
+
// DeepSeek V4: one 512-wide latent per token, kept at 1/4 (CSA) or 1/128 (HCA) on alternating layers (≈ 0.129 on
|
|
508
|
+
// average); CSA attends its index top-1024, HCA all compressed blocks: modelled as 2048 attended tokens per query.
|
|
509
|
+
// Experts in FP4, the rest FP8.
|
|
510
|
+
Object.assign({}, G, MLA, { id: 'deepseek-v4-pro', name: 'DeepSeek-V4-Pro 1.6T-A49B (MoE, compressed sparse attention)', total: 1600, active: 49, layers: 61, hidden: 7168, qHeads: 128, mlaLatent: 448, mlaRope: 64, mlaNope: 448, mlaV: 512, kvKeep: 0.129, sparseTopK: 2048, experts: 384, topk: 6, maxCtx: 1048576, wprec: 'fp4', source: 'https://huggingface.co/deepseek-ai/DeepSeek-V4-Pro' }),
|
|
511
|
+
Object.assign({}, G, MLA, { id: 'deepseek-v4-flash', name: 'DeepSeek-V4-Flash 284B-A13B (MoE, compressed sparse attention)', total: 284, active: 13, layers: 43, hidden: 4096, qHeads: 64, mlaLatent: 448, mlaRope: 64, mlaNope: 448, mlaV: 512, kvKeep: 0.129, sparseTopK: 2048, experts: 256, topk: 6, maxCtx: 1048576, wprec: 'fp8', source: 'https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash' }),
|
|
512
|
+
// GLM-5.1 and GLM-5.3: MLA with DeepSeek-style sparse attention (index top-2048); GLM-5.3 extends the context to 1M.
|
|
513
|
+
// GLM-5.3's active parameters are not published: the GLM-5 lineage's 40B is assumed.
|
|
514
|
+
Object.assign({}, G, MLA, { id: 'glm-5.1', name: 'GLM-5.1 744B-A40B (MoE, MLA, sparse)', total: 744, active: 40, layers: 78, hidden: 6144, qHeads: 64, mlaNope: 192, mlaV: 256, sparseTopK: 2048, experts: 256, topk: 8, maxCtx: 202752, wprec: 'fp8', source: 'https://huggingface.co/zai-org/GLM-5.1' }),
|
|
515
|
+
Object.assign({}, G, MLA, { id: 'glm-5.3', name: 'GLM-5.3 753B (MoE, MLA, sparse, 1M)', total: 753, active: 40, layers: 78, hidden: 6144, qHeads: 64, mlaNope: 192, mlaV: 256, sparseTopK: 2048, experts: 256, topk: 8, maxCtx: 1048576, wprec: 'fp8', source: 'https://huggingface.co/zai-org/GLM-5.3' }),
|
|
516
|
+
// Mistral Large 4: MLA with sparse token selection (top-2048); nope/v head dims not published (DeepSeek's 128 assumed)
|
|
517
|
+
Object.assign({}, G, MLA, { id: 'mistral-large-4', name: 'Mistral Large 4 1.05T-A52B (MoE, MLA, sparse)', total: 1050, active: 52, layers: 72, hidden: 6144, qHeads: 64, sparseTopK: 2048, experts: 128, topk: 4, maxCtx: 1048576, wprec: 'fp8', source: 'https://huggingface.co/mistralai/Mistral-Large-4-1T-A52B' }),
|
|
518
|
+
// Qwen3.5-397B and Qwen3.8 27B: three Gated DeltaNet layers per gated-attention layer (64 / 48 value heads × 128 × 128 fp32 state)
|
|
519
|
+
Object.assign({}, G, { id: 'qwen35-397b', name: 'Qwen3.5 397B-A17B (MoE, Gated DeltaNet hybrid)', total: 397, active: 17, layers: 60, hidden: 4096, qHeads: 32, kvHeads: 2, headDim: 256, linFrac: 0.75, linStateMB: 4.19, experts: 512, topk: 10, maxCtx: 262144, wprec: 'fp8', source: 'https://huggingface.co/Qwen/Qwen3.5-397B-A17B' }),
|
|
520
|
+
Object.assign({}, G, { id: 'qwen38-27b', name: 'Qwen3.8 27B (Gated DeltaNet hybrid)', total: 27, active: 27, layers: 64, hidden: 5120, qHeads: 24, kvHeads: 4, headDim: 256, linFrac: 0.75, linStateMB: 3.15, maxCtx: 262144, wprec: 'fp8', source: 'https://huggingface.co/Qwen/Qwen3.8-27B' }),
|
|
521
|
+
// MiniMax M3: sparse attention (16 blocks of 128 tokens) in 57 of 60 layers, modelled on all of them
|
|
522
|
+
Object.assign({}, G, { id: 'minimax-m3', name: 'MiniMax M3 428B-A23B (MoE, sparse)', total: 428, active: 23, layers: 60, hidden: 6144, qHeads: 64, kvHeads: 4, headDim: 128, sparseTopK: 2048, experts: 128, topk: 4, maxCtx: 1048576, wprec: 'fp8', source: 'https://huggingface.co/MiniMaxAI/MiniMax-M3' }),
|
|
523
|
+
Object.assign({}, G, { id: 'minimax-m27', name: 'MiniMax M2.7 229B-A10B (MoE)', total: 229, active: 10, layers: 62, hidden: 3072, qHeads: 48, kvHeads: 8, headDim: 128, experts: 256, topk: 8, maxCtx: 204800, wprec: 'fp8', source: 'https://huggingface.co/MiniMaxAI/MiniMax-M2.7' }),
|
|
524
|
+
// Muse Spark Open: 46 sliding-window layers (2048 tokens) and 16 full-attention layers
|
|
525
|
+
Object.assign({}, G, { id: 'muse-spark-open', name: 'Muse Spark Open 816B-A42B (MoE)', total: 816, active: 42, layers: 62, hidden: 8192, qHeads: 128, kvHeads: 16, headDim: 64, swaFrac: 46 / 62, swaWindow: 2048, experts: 256, topk: 8, maxCtx: 1048576, wprec: 'fp4', source: 'https://huggingface.co/meta-models/Muse-Spark-Open-816B-A42B' }),
|
|
526
|
+
// Gemma 4 31B: 50 sliding-window layers (1024 tokens) and 10 global layers with 4 KV heads of 512 and keys reused as
|
|
527
|
+
// values (the KV of 4 × 256 K+V pairs). The sliding layers' 16 heads are sized as 4: their KV is capped at 1024 tokens.
|
|
528
|
+
Object.assign({}, G, { id: 'gemma4-31b', name: 'Gemma 4 31B', total: 30.7, active: 30.7, layers: 60, hidden: 5376, qHeads: 32, kvHeads: 4, headDim: 256, swaFrac: 50 / 60, swaWindow: 1024, maxCtx: 262144, wprec: 'fp8', source: 'https://huggingface.co/google/gemma-4-31B' }),
|
|
475
529
|
];
|
|
476
|
-
const MODEL_DEFAULTS = { attn: 'gqa', experts: 0, topk: 0, swaFrac: 0, swaWindow: 0, mlaLatent: 512, mlaRope: 64, mlaNope: 128, mlaV: 128, wprec: 'fp8' };
|
|
530
|
+
const MODEL_DEFAULTS = { attn: 'gqa', experts: 0, topk: 0, swaFrac: 0, swaWindow: 0, linFrac: 0, linStateMB: 0, kvKeep: 1, sparseTopK: 0, mlaLatent: 512, mlaRope: 64, mlaNope: 128, mlaV: 128, wprec: 'fp8' };
|
|
477
531
|
const GPU_DEFAULTS = { tfFp8: 0, tfFp4: 0, nodeKW: 0, price: 0, vendor: '' };
|
|
478
532
|
|
|
479
533
|
// ---------- validation ----------
|
|
@@ -503,6 +557,7 @@ nav.views .chip { font-size: 12.5px; padding: 4px 12px; }
|
|
|
503
557
|
out[f.k] = v;
|
|
504
558
|
}
|
|
505
559
|
if (kind === 'Model' && out.active > out.total) errors.push(`Model "${out.name}": active params (${out.active}B) exceed total (${out.total}B).`);
|
|
560
|
+
if (kind === 'Model' && (out.swaFrac || 0) + (out.linFrac || 0) > 1) errors.push(`Model "${out.name}": sliding-window and linear-attention shares add up to more than all layers.`);
|
|
506
561
|
if (kind === 'Model' && out.experts > 0 && !(out.topk > 0 && out.topk < out.experts)) errors.push(`Model "${out.name}": experts per token must be between 1 and ${out.experts - 1}.`);
|
|
507
562
|
if (kind === 'Model' && out.experts > 0 && out.active >= out.total) errors.push(`Model "${out.name}": an MoE model needs active params below total params.`);
|
|
508
563
|
return { ok: errors.length === 0, errors, value: out };
|
|
@@ -585,6 +640,19 @@ nav.views .chip { font-size: 12.5px; padding: 4px 12px; }
|
|
|
585
640
|
notes.push('Chunked-attention layers modelled as sliding-window layers.');
|
|
586
641
|
}
|
|
587
642
|
if (c.sliding_window && !swaFrac) notes.push('sliding_window is set but not enabled for these layers; KV is sized for full attention.');
|
|
643
|
+
// linear-attention layers (Qwen3-Next / Qwen3.5 Gated DeltaNet: layer_types "linear_attention" or full_attention_interval)
|
|
644
|
+
let linFrac = 0, linStateMB = 0;
|
|
645
|
+
const linN = Array.isArray(c.layer_types) ? c.layer_types.filter(t => /linear/i.test(String(t))).length
|
|
646
|
+
: c.full_attention_interval > 1 ? layers - Math.floor(layers / c.full_attention_interval) : 0;
|
|
647
|
+
if (linN) {
|
|
648
|
+
linFrac = +(linN / layers).toFixed(4);
|
|
649
|
+
const vh = +first(c, ['linear_num_value_heads'], qHeads), kd = +first(c, ['linear_key_head_dim'], 128), vd = +first(c, ['linear_value_head_dim'], 128);
|
|
650
|
+
linStateMB = +(vh * kd * vd * 4 / 1e6).toFixed(3);
|
|
651
|
+
notes.push(`${linN} linear-attention layers: a ${linStateMB} MB state per layer per sequence (fp32), no KV per token.`);
|
|
652
|
+
}
|
|
653
|
+
// sparse attention: an index picks the tokens each query attends (DeepSeek Sparse Attention and its descendants)
|
|
654
|
+
const sparseTopK = c.index_topk ? +c.index_topk : 0;
|
|
655
|
+
if (sparseTopK) notes.push(`Sparse attention: each query attends ${sparseTopK} selected tokens.`);
|
|
588
656
|
// context
|
|
589
657
|
let maxCtx = +first(c, ['max_position_embeddings', 'n_positions', 'seq_length', 'max_sequence_length'], 4096);
|
|
590
658
|
const rs = c.rope_scaling;
|
|
@@ -619,7 +687,7 @@ nav.views .chip { font-size: 12.5px; padding: 4px 12px; }
|
|
|
619
687
|
const name = String(first(j, ['_name_or_path', 'name_or_path'], '') || '').split('/').pop() || (c.model_type ? c.model_type + ' ' + (total / 1e9).toFixed(0) + 'B' : 'Imported model');
|
|
620
688
|
const model = {
|
|
621
689
|
name, total: +(total / 1e9).toFixed(2), active: +(active / 1e9).toFixed(2), layers, hidden, qHeads, kvHeads, headDim,
|
|
622
|
-
attn: mla ? 'mla' : 'gqa', mlaLatent, mlaRope, mlaNope, mlaV, experts, topk, swaFrac, swaWindow, maxCtx,
|
|
690
|
+
attn: mla ? 'mla' : 'gqa', mlaLatent, mlaRope, mlaNope, mlaV, experts, topk, swaFrac, swaWindow, linFrac, linStateMB, sparseTopK, maxCtx,
|
|
623
691
|
wprec: /fp8|float8/i.test(JSON.stringify(j.quantization_config || '')) ? 'fp8' : /mxfp4|nvfp4|fp4/i.test(JSON.stringify(j.quantization_config || '')) ? 'fp4' : 'fp8',
|
|
624
692
|
};
|
|
625
693
|
return { model, notes };
|
|
@@ -658,6 +726,12 @@ nav.views .chip { font-size: 12.5px; padding: 4px 12px; }
|
|
|
658
726
|
const mla = s.attn === 'mla';
|
|
659
727
|
const lat = s.mlaLatent || 512, rope = s.mlaRope == null ? 64 : s.mlaRope, nope = s.mlaNope == null ? 128 : s.mlaNope, vh = s.mlaV || 128;
|
|
660
728
|
const swaLayers = s.swaWindow > 0 ? Math.round(s.layers * (s.swaFrac || 0)) : 0;
|
|
729
|
+
// linear-attention layers (Kimi Delta Attention, Gated DeltaNet): a fixed recurrent state per sequence, no KV per token
|
|
730
|
+
const linLayers = s.linFrac > 0 ? Math.min(s.layers - swaLayers, Math.round(s.layers * s.linFrac)) : 0;
|
|
731
|
+
const linState = linLayers * (s.linStateMB || 0) * 1e6;
|
|
732
|
+
// compressed attention keeps the KV of a share of the tokens (DeepSeek V4: 1/4 or 1/128 per layer); sparse attention
|
|
733
|
+
// (DSA, CSA, MSA) attends a fixed number of selected tokens per query instead of all of them
|
|
734
|
+
const keep = s.kvKeep > 0 && s.kvKeep < 1 ? s.kvKeep : 1, topK = s.sparseTopK > 0 ? s.sparseTopK : 0;
|
|
661
735
|
// tensor-core rate for the weight precision; fall back when the GPU lacks that precision
|
|
662
736
|
const tf = { bf16: s.tfBf16, fp8: s.tfFp8 || s.tfBf16, fp4: s.tfFp4 || s.tfFp8 || s.tfBf16 }[s.wprec] || s.tfBf16;
|
|
663
737
|
const computeFallback = (s.wprec === 'fp4' && !s.tfFp4) ? (s.tfFp8 ? 'fp8' : 'bf16') : (s.wprec === 'fp8' && !s.tfFp8) ? 'bf16' : null;
|
|
@@ -666,7 +740,9 @@ nav.views .chip { font-size: 12.5px; padding: 4px 12px; }
|
|
|
666
740
|
Wd: dense * 1e9 * bpp, We: Eall * 1e9 * bpp,
|
|
667
741
|
denseP: dense * 1e9, activeP: (isMoE ? s.active : s.total) * 1e9,
|
|
668
742
|
kvTokLayer: mla ? (lat + rope) * kvb : 2 * s.kvHeads * s.headDim * kvb,
|
|
669
|
-
swaLayers, fullLayers: s.layers - swaLayers, win: s.swaWindow || 0,
|
|
743
|
+
swaLayers, linLayers, fullLayers: s.layers - swaLayers - linLayers, win: s.swaWindow || 0, keep, topK, linState,
|
|
744
|
+
// FLOPs per token per linear-attention layer: read and update the state (fp32, 4 bytes an element), ~4 FLOPs an element
|
|
745
|
+
Alin: (s.linStateMB || 0) * 1e6,
|
|
670
746
|
// attention FLOPs per (query token, context token) per layer
|
|
671
747
|
Apre: mla ? s.qHeads * (2 * (nope + rope) + 2 * vh) : 4 * s.qHeads * s.headDim,
|
|
672
748
|
Adec: mla ? s.qHeads * (2 * (lat + rope) + 2 * lat) : 4 * s.qHeads * s.headDim,
|
|
@@ -677,17 +753,26 @@ nav.views .chip { font-size: 12.5px; padding: 4px 12px; }
|
|
|
677
753
|
};
|
|
678
754
|
}
|
|
679
755
|
|
|
756
|
+
// KV bytes one sequence of L tokens holds: full-attention layers keep (a share of) every token, sliding-window layers
|
|
757
|
+
// the last W, linear-attention layers a fixed state
|
|
680
758
|
function kvBytes(md, L) {
|
|
681
|
-
const w = md.win || L;
|
|
682
|
-
return md.kvTokLayer * (md.fullLayers * L + md.swaLayers * Math.min(L, w));
|
|
759
|
+
const w = md.win || L, keep = md.keep || 1;
|
|
760
|
+
return md.kvTokLayer * (md.fullLayers * L * keep + md.swaLayers * Math.min(L, w)) + (md.linState || 0);
|
|
761
|
+
}
|
|
762
|
+
// context tokens one query attends in a full-attention layer, and its integral over query positions 0..x
|
|
763
|
+
const attended = (md, L) => { const n = L * (md.keep || 1); return md.topK ? Math.min(n, md.topK) : n; };
|
|
764
|
+
function attendedSum(md, x) {
|
|
765
|
+
const k = md.keep || 1;
|
|
766
|
+
if (!md.topK) return k * x * x / 2;
|
|
767
|
+
const t = md.topK / k;
|
|
768
|
+
return x <= t ? k * x * x / 2 : k * t * t / 2 + md.topK * (x - t);
|
|
683
769
|
}
|
|
684
770
|
function attnPre(md, Lc, L) {
|
|
685
771
|
const W = md.win;
|
|
686
|
-
const f = x => x * x / 2;
|
|
687
772
|
const g = x => x <= W ? x * x / 2 : W * W / 2 + W * (x - W);
|
|
688
|
-
return md.Apre * (md.fullLayers * (
|
|
773
|
+
return md.Apre * (md.fullLayers * (attendedSum(md, L) - attendedSum(md, Lc)) + md.swaLayers * (g(L) - g(Lc))) + (md.linLayers || 0) * (md.Alin || 0) * (L - Lc);
|
|
689
774
|
}
|
|
690
|
-
function attnDec(md, L) { return md.Adec * (md.fullLayers * L + md.swaLayers * Math.min(L, md.win || L)); }
|
|
775
|
+
function attnDec(md, L) { return md.Adec * (md.fullLayers * attended(md, L) + md.swaLayers * Math.min(L, md.win || L)) + (md.linLayers || 0) * (md.Alin || 0); }
|
|
691
776
|
|
|
692
777
|
// ---------- parallel layouts ----------
|
|
693
778
|
// Instances of g GPUs. Inside one scale-up domain (D GPUs): TP, or TP+EP for MoE, or DP-attention+EP for MLA.
|
|
@@ -1009,7 +1094,7 @@ nav.views .chip { font-size: 12.5px; padding: 4px 12px; }
|
|
|
1009
1094
|
return res;
|
|
1010
1095
|
}
|
|
1011
1096
|
|
|
1012
|
-
const api = { SETTINGS, plan, derive, kvBytes, decodeStep, memInfo, prefillStats, prefillTime, configs, computeLoad, decodeLabel, prefillLabel, decodeCap, packNodes, operatingPoint };
|
|
1097
|
+
const api = { SETTINGS, plan, derive, kvBytes, attnPre, attnDec, decodeStep, memInfo, prefillStats, prefillTime, configs, computeLoad, decodeLabel, prefillLabel, decodeCap, packNodes, operatingPoint };
|
|
1013
1098
|
if (typeof module !== 'undefined' && module.exports) module.exports = api; else root.SizerModel = api;
|
|
1014
1099
|
})(this);
|
|
1015
1100
|
|
|
@@ -1565,7 +1650,7 @@ function memoryHTML(r) {
|
|
|
1565
1650
|
<div class="membar">${parts.map(p => `<div style="width:${Math.max(0, 100 * p[1] / hbm).toFixed(2)}%;background:${p[2]}" title="${p[0]}"></div>`).join('')}</div>
|
|
1566
1651
|
<div class="memlegend">${parts.map(p => `<i style="background:${p[2]}"></i><span>${p[0]}</span><span class="mono">${fGB(p[1])}</span>`).join('')}</div>
|
|
1567
1652
|
<dl class="kv" style="margin-top:14px">
|
|
1568
|
-
<dt>KV per token (all layers)</dt><dd>${fGB(md.
|
|
1653
|
+
<dt>KV per token (all layers, averaged over a full context)</dt><dd>${fGB(M.kvBytes(md, s.ctx) / s.ctx)}</dd>
|
|
1569
1654
|
<dt>KV for one ${fCtx(s.ctx)} full-context request</dt><dd>${fGB(mi.ctxBytes)}</dd>
|
|
1570
1655
|
<dt>KV for an average request (${fInt(s.avgIn + s.avgOut)} tokens)</dt><dd>${fGB(M.kvBytes(md, Math.min(s.ctx, s.avgIn + s.avgOut)))}</dd>
|
|
1571
1656
|
<dt>KV capacity per instance</dt><dd>${fGB(mi.cap)}</dd>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Keeping the model and hardware lists current
|
|
2
|
+
|
|
3
|
+
The Inference Sizer's catalog (`src/catalog.js`, `MODELS`) and the accelerator registry (`src/accelerators.js`) are
|
|
4
|
+
the lists behind every model and GPU menu in the repo:
|
|
5
|
+
- the Inference Sizer page and CLI;
|
|
6
|
+
- FleetScope's model menus, which take every catalog model FleetScope doesn't already have;
|
|
7
|
+
- harness-ledger's self-hosting economics;
|
|
8
|
+
- fleetops' power model and serving manifests.
|
|
9
|
+
|
|
10
|
+
They are refreshed weekly: a scheduled task looks for new open-weight models and inference chips and opens a pull
|
|
11
|
+
request against `main`. Anyone can do the same by hand with this checklist.
|
|
12
|
+
|
|
13
|
+
## Where figures come from
|
|
14
|
+
|
|
15
|
+
Use these sources, most trusted first:
|
|
16
|
+
|
|
17
|
+
1. The model's Hugging Face `config.json` and model card, or the vendor's spec page or datasheet.
|
|
18
|
+
2. The model's technical report.
|
|
19
|
+
3. Pages that reproduce the config with a link to it, such as SemiAnalysis InferenceX's model pages
|
|
20
|
+
(`inferencex.semianalysis.com/model/...`), Sebastian Raschka's LLM Architecture Gallery, or cloud model libraries.
|
|
21
|
+
|
|
22
|
+
Rules:
|
|
23
|
+
|
|
24
|
+
- **Name the source.** Put it in `source`, and say in the comment above the entry where any figure that isn't in the
|
|
25
|
+
config comes from.
|
|
26
|
+
- **Don't guess a missing figure.** Either leave the model out, or use the closest published figure and say so in the
|
|
27
|
+
comment. For example, GLM-5.3's active parameters aren't published, so the GLM-5 lineage's 40B is used, and the
|
|
28
|
+
comment says that.
|
|
29
|
+
- **Use dense chip figures.** Halve "with sparsity" numbers, and divide rack totals by the chip count. When a vendor
|
|
30
|
+
publishes no board power, give the reported figure and say it is reported, not a spec-sheet value.
|
|
31
|
+
- **Prices are placeholders,** not quotes.
|
|
32
|
+
|
|
33
|
+
## Model fields beyond plain attention
|
|
34
|
+
|
|
35
|
+
| Field | Use it for | How to fill it |
|
|
36
|
+
| --- | --- | --- |
|
|
37
|
+
| `swaFrac`, `swaWindow` | Sliding-window layers (gpt-oss, Gemma, Muse Spark) | Share of layers that use a window, and the window in tokens |
|
|
38
|
+
| `linFrac`, `linStateMB` | Linear-attention layers (Kimi Delta Attention, Gated DeltaNet) | Share of such layers; state per layer per sequence = value heads × key dim × value dim × 4 bytes |
|
|
39
|
+
| `kvKeep` | Compressed attention (DeepSeek V4's CSA/HCA) | Average share of tokens whose KV is kept (V4: 1/4 and 1/128 on alternating layers ≈ 0.129) |
|
|
40
|
+
| `sparseTopK` | Sparse attention (DSA, GLM's IndexShare, MiniMax MSA, Mistral Large 4) | Tokens each query attends (the index top-k) |
|
|
41
|
+
|
|
42
|
+
A linear-attention layer holds a fixed state per sequence rather than KV per token. Its compute per token doesn't grow
|
|
43
|
+
with context. When a model mixes kinds that one entry can't hold exactly, size it on the kind that dominates at long
|
|
44
|
+
context and say what was approximated. For example, Gemma 4's sliding-window layers have more KV heads than its global
|
|
45
|
+
layers, but their KV is capped at the window, so the entry uses the global layers' heads.
|
|
46
|
+
|
|
47
|
+
`fromHFConfig` reads these from a config: `layer_types` with sliding or linear layers, `full_attention_interval`,
|
|
48
|
+
`linear_num_value_heads` and the linear head dims, and `index_topk`.
|
|
49
|
+
|
|
50
|
+
## Checklist for an update
|
|
51
|
+
|
|
52
|
+
1. **Models:** find open-weight releases since the last update (Hugging Face trending, the labs' release notes,
|
|
53
|
+
open-weight leaderboards) and their config values. Add each to `MODELS` with a stable `id`, and never rename an
|
|
54
|
+
existing id: saved inputs and FleetScope graphs refer to them.
|
|
55
|
+
2. **Chips:** find announced or shipping accelerators with published memory, bandwidth and dense FLOPS. Add each to
|
|
56
|
+
`ACCELERATORS` (see [ACCELERATORS.md](ACCELERATORS.md)), with a `match` that doesn't catch other SKUs.
|
|
57
|
+
3. **Tests:** add the new SKU names to `tests/accelerators.test.mjs`. Check any published KV-per-token figure in
|
|
58
|
+
`inference-sizer/tests/attention.test.mjs`.
|
|
59
|
+
4. **Build and check:** run `npm run build` in `inference-sizer/` and `fleetscope/`. Then run `npm test` at the root,
|
|
60
|
+
in `inference-sizer/` and in `fleetscope/`. Run `node scripts/schemas.mjs --update` if `sizer list` output changed.
|
|
61
|
+
5. **Changelog:** add a line under "Unreleased".
|
|
62
|
+
|
|
63
|
+
## Not in the lists yet, and why
|
|
64
|
+
|
|
65
|
+
| Item | Why it isn't in yet |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| AWS Trainium3 | Needs a Neuron vendor adapter: Kubernetes resource, exporter, vLLM image and a gpu-health profile |
|
|
68
|
+
| Google TPU 8i / 8t | FP8, BF16 and ICI figures are unpublished, as is the GKE accelerator name |
|
|
69
|
+
| DeepSeek V4.1 Flash | Encoder-decoder with a separate Engram memory: not a shape the sizer models |
|
|
70
|
+
| Qwen3.8 2.4T-A95B, LongCat-2.5, Hunyuan Hy3, Inkling | Config values not found in a citable source yet |
|
|
71
|
+
| NVIDIA Rubin CPX | A prefill-only part: the sizer sizes one GPU type per deployment |
|
|
@@ -46,7 +46,7 @@ Engine assumptions, all editable on the page:
|
|
|
46
46
|
- MoE models: TP attention with EP experts inside a domain, and wide EP with data-parallel attention across domains.
|
|
47
47
|
- MLA models: data-parallel attention, because TP would replicate the latent KV cache.
|
|
48
48
|
- Prefill: TP inside a domain, context parallel across domains.
|
|
49
|
-
3. **Memory.** Weights per GPU follow the layout. With DP attention, the dense weights are replicated. KV per token is `2 × layers × kvHeads × headDim × bytes`, or `(latent + rope) × layers × bytes` for MLA; sliding-window layers store only the window. KV is replicated when TP exceeds the KV-head count.
|
|
49
|
+
3. **Memory.** Weights per GPU follow the layout. With DP attention, the dense weights are replicated. KV per token is `2 × layers × kvHeads × headDim × bytes`, or `(latent + rope) × layers × bytes` for MLA; sliding-window layers store only the window. Linear-attention layers (Kimi Delta Attention, Gated DeltaNet) store a fixed state per sequence instead. Compressed attention keeps a share of the tokens (`kvKeep`). Sparse attention attends at most `sparseTopK` tokens per query, which caps attention compute but not KV (see [CATALOG.md](CATALOG.md)). KV is replicated when TP exceeds the KV-head count.
|
|
50
50
|
4. **Decode step.** `max(HBM read time, compute time) + collectives + overhead`. The HBM read covers the weights, but only the experts the batch actually routes to, which is `1 − (1 − topk/experts)^B` of them, plus every stream's KV at the average context. Compute covers the linear layers at the weight precision's tensor rate and attention at BF16. Collectives are TP all-reduce or EP all-to-all over NVLink inside a domain, and over the NIC across domains. The largest batch whose step fits the TPOT target, less the margin, sets streams per instance.
|
|
51
51
|
5. **Prefill.** `2 × active params × prompt tokens` plus causal attention (sliding-window aware), at the prefill MFU and floored by one read of the weights. Short prompts batch up to 8,192 tokens. Queueing is M/D/1: utilisation is capped so that the average prompt's service time plus its wait meets TTFT. The peak prompt must meet TTFT on an idle instance. In disaggregated mode, the KV transfer to decode (over RDMA) counts against TTFT.
|
|
52
52
|
6. **Aggregated mode.** Each step carries the decode batch plus a prefill chunk sized so the step stays within TPOT. Prompts drain at that chunk rate, which sets TTFT.
|
|
@@ -44,6 +44,11 @@
|
|
|
44
44
|
|
|
45
45
|
const A = (o) => Object.assign({ kind: 'gpu', tfFp4: 0 }, o);
|
|
46
46
|
const ACCELERATORS = [
|
|
47
|
+
// Vera Rubin NVL72 (VR200; first called NVL144 for its 144 dies): per Rubin package, 288 GB HBM4 at 22 TB/s; dense
|
|
48
|
+
// NVFP4 35 PF (the 50 PF inference figure uses adaptive compression), FP8 17.5 PF, BF16 4 PF; NVLink 6 3.6 TB/s
|
|
49
|
+
// bidirectional; ConnectX-9 1.6 Tb/s. NVIDIA publishes no board power: 2.3 kW is the reported Max-P TGP.
|
|
50
|
+
A({ id: 'VR200-NVL72', short: 'VR200', label: 'NVIDIA Vera Rubin NVL72 (72-GPU rack)', vendor: 'NVIDIA', vendorKey: 'nvidia', hbmGB: 288, hbmTBs: 22, tfBf16: 4000, tfFp8: 17500, tfFp4: 35000, scaleUpGBs: 1800, domain: 72, nicGbps: 1600, tdpW: 2300, price: 11.0, onprem: 6.5, match: 'Rubin(?!.*CPX)|VR200|\\bR200\\b',
|
|
51
|
+
source: 'https://developer.nvidia.com/blog/inside-the-NVIDIA-rubin-platform-six-new-chips-one-ai-supercomputer' }),
|
|
47
52
|
A({ id: 'GB300-NVL72', short: 'GB300', label: 'NVIDIA GB300 NVL72 (72-GPU rack)', vendor: 'NVIDIA', vendorKey: 'nvidia', hbmGB: 278, hbmTBs: 8, tfBf16: 2500, tfFp8: 5000, tfFp4: 15000, scaleUpGBs: 900, domain: 72, nicGbps: 800, tdpW: 1400, price: 7.5, onprem: 4.4, match: 'GB300',
|
|
48
53
|
// rack figures ÷ 72: 20 TB HBM, 576 TB/s, 360/720/1080 PFLOPS BF16 (sparse)/FP8 (sparse)/FP4 (dense); board power from InferenceX's chip page
|
|
49
54
|
source: 'https://www.nvidia.com/en-us/data-center/gb300-nvl72/' }),
|
|
@@ -59,8 +64,17 @@
|
|
|
59
64
|
source: 'https://www.nvidia.com/en-us/data-center/h100/' }),
|
|
60
65
|
A({ id: 'A100', label: 'NVIDIA A100 80GB SXM (8-GPU)', vendor: 'NVIDIA', vendorKey: 'nvidia', hbmGB: 80, hbmTBs: 2.0, tfBf16: 312, tfFp8: 0, scaleUpGBs: 300, domain: 8, nicGbps: 200, nodeKW: 6.5, tdpW: 400, price: 1.6, onprem: 0.9, match: 'A100(?!.*PCIe)|A800',
|
|
61
66
|
source: 'https://www.nvidia.com/en-us/data-center/a100/' }),
|
|
67
|
+
// RTX PRO 6000 Blackwell Server Edition: 96 GB GDDR7 at 1.6 TB/s; 4 / 2 / 1 PF FP4 / FP8 / BF16 with sparsity
|
|
68
|
+
// (halved here); PCIe 5.0 x16 between cards; up to 600 W
|
|
69
|
+
A({ id: 'RTX-PRO-6000', short: 'RTXPRO6000', label: 'NVIDIA RTX PRO 6000 Blackwell Server (PCIe, 8 per server)', vendor: 'NVIDIA', vendorKey: 'nvidia', hbmGB: 96, hbmTBs: 1.6, tfBf16: 500, tfFp8: 1000, tfFp4: 2000, scaleUpGBs: 64, domain: 8, nicGbps: 400, tdpW: 600, price: 1.8, onprem: 1.0, match: 'RTX ?PRO ?6000|RTX-PRO-6000',
|
|
70
|
+
source: 'https://www.nvidia.com/en-us/data-center/rtx-pro-6000-blackwell-server-edition/' }),
|
|
62
71
|
A({ id: 'L40S', label: 'NVIDIA L40S (PCIe, 8 per server)', vendor: 'NVIDIA', vendorKey: 'nvidia', hbmGB: 48, hbmTBs: 0.864, tfBf16: 362, tfFp8: 733, scaleUpGBs: 32, domain: 8, nicGbps: 200, nodeKW: 5, tdpW: 350, price: 1.1, onprem: 0.7, match: 'L40S',
|
|
63
72
|
source: 'https://www.nvidia.com/en-us/data-center/l40s/' }),
|
|
73
|
+
// Helios rack: 72 MI455X, 432 GB HBM4 at 23.3 TB/s, 40 / 20 / 5 PF MXFP4 / MXFP8 / BF16, 3.6 TB/s scale-up
|
|
74
|
+
// (UALink over Ethernet, bidirectional), 43 TB/s scale-out per rack (2.4 Tb/s per GPU per direction), 246 kW per
|
|
75
|
+
// rack (AMD's validated reference design). AMD publishes no board power: ~1.7 kW is the reported projection.
|
|
76
|
+
A({ id: 'MI455X-Helios', short: 'MI455X', label: 'AMD Instinct MI455X Helios (72-GPU rack)', vendor: 'AMD', vendorKey: 'amd', hbmGB: 432, hbmTBs: 23.3, tfBf16: 5000, tfFp8: 20000, tfFp4: 40000, scaleUpGBs: 1800, domain: 72, nicGbps: 2400, nodeKW: 246, tdpW: 1700, price: 8.0, onprem: 4.8, match: 'MI455',
|
|
77
|
+
source: 'https://www.amd.com/en/products/accelerators/instinct/mi400.html' }),
|
|
64
78
|
A({ id: 'MI355X', label: 'AMD Instinct MI355X (8-GPU)', vendor: 'AMD', vendorKey: 'amd', hbmGB: 288, hbmTBs: 8, tfBf16: 2516.6, tfFp8: 5033.2, tfFp4: 10066.3, scaleUpGBs: 504, domain: 8, nicGbps: 400, tdpW: 1400, price: 4.5, onprem: 2.6, match: 'MI355',
|
|
65
79
|
// Infinity Fabric: 7 links × 144 GB/s (bidirectional) = 504 GB/s per direction
|
|
66
80
|
source: 'https://www.amd.com/en/products/accelerators/instinct/mi350/mi355x.html' }),
|
|
@@ -99,7 +113,7 @@
|
|
|
99
113
|
// ---------- cloud instance types ----------
|
|
100
114
|
// AWS: docs.aws.amazon.com/AWSEC2/latest/UserGuide/accelerated-computing-instances.html and aws.amazon.com/ec2/instance-types/p6/
|
|
101
115
|
const INSTANCES = {};
|
|
102
|
-
const add = (cloud, chip, list) => { for (const [type, gpus] of list) INSTANCES[type] = { cloud, chip, gpus }; };
|
|
116
|
+
const add = (cloud, chip, list) => { for (const [type, gpus] of list) INSTANCES[type.toLowerCase()] = { cloud, chip, gpus }; };
|
|
103
117
|
const sizes = (fam, one, more) => one.map(s => [`${fam}.${s}`, 1]).concat(more.map(([s, n]) => [`${fam}.${s}`, n]));
|
|
104
118
|
add('aws', 'A100-40GB', [['p4d.24xlarge', 8]]);
|
|
105
119
|
add('aws', 'A100', [['p4de.24xlarge', 8]]);
|
|
@@ -125,6 +139,14 @@
|
|
|
125
139
|
add('gcp', 'TPU-v5p', [['ct5p-hightpu-4t', 4]]);
|
|
126
140
|
add('gcp', 'TPU7x', [['tpu7x-standard-4t', 4]]);
|
|
127
141
|
add('gcp', 'TPU-v5e', [['ct5lp-hightpu-1t', 1], ['ct5lp-hightpu-4t', 4], ['ct5lp-hightpu-8t', 8]]);
|
|
142
|
+
// Azure: learn.microsoft.com/azure/virtual-machines/sizes/gpu-accelerated (ND H100/H200/MI300X v5, ND GB200 v6, ND A100 v4);
|
|
143
|
+
// AKS puts the size in node.kubernetes.io/instance-type with this capitalisation (matched case-insensitively)
|
|
144
|
+
add('azure', 'H100', [['Standard_ND96isr_H100_v5', 8]]);
|
|
145
|
+
add('azure', 'H200', [['Standard_ND96isr_H200_v5', 8]]);
|
|
146
|
+
add('azure', 'MI300X', [['Standard_ND96isr_MI300X_v5', 8]]);
|
|
147
|
+
add('azure', 'GB200-NVL72', [['Standard_ND128isr_NDR_GB200_v6', 4]]); // 18 VMs per NVL72 rack
|
|
148
|
+
add('azure', 'A100-40GB', [['Standard_ND96asr_v4', 8]]);
|
|
149
|
+
add('azure', 'A100', [['Standard_ND96amsr_A100_v4', 8]]);
|
|
128
150
|
const instanceOf = type => INSTANCES[String(type || '').toLowerCase()] || null;
|
|
129
151
|
// TPU slice topology for a chip count: 2D (v5e, v6e) or 3D torus (v4, v5p, 7x), as GKE's node selector wants it
|
|
130
152
|
const TOPO2 = { 1: '1x1', 4: '2x2', 8: '2x4', 16: '4x4', 32: '4x8', 64: '8x8', 128: '8x16', 256: '16x16' };
|
|
@@ -39,6 +39,10 @@
|
|
|
39
39
|
{ k: 'topk', label: 'Experts per token', min: 0, max: 1e4, int: true },
|
|
40
40
|
{ k: 'swaFrac', label: 'Share of sliding-window layers', min: 0, max: 1 },
|
|
41
41
|
{ k: 'swaWindow', label: 'Sliding window', unit: 'tokens', min: 0, max: 1e8, int: true },
|
|
42
|
+
{ k: 'linFrac', label: 'Share of linear-attention layers', min: 0, max: 1, hint: 'Kimi Delta Attention, Gated DeltaNet: a fixed state per sequence instead of KV per token.' },
|
|
43
|
+
{ k: 'linStateMB', label: 'Linear-attention state per layer', unit: 'MB', min: 0, max: 1e4, hint: 'Per sequence: value heads × key dim × value dim × 4 bytes (fp32).' },
|
|
44
|
+
{ k: 'kvKeep', label: 'Share of tokens whose KV is kept', min: 0.0001, max: 1, hint: 'Compressed attention (DeepSeek V4): average over layers. 1 for ordinary attention.' },
|
|
45
|
+
{ k: 'sparseTopK', label: 'Tokens attended per query (sparse attention)', unit: 'tokens', min: 0, max: 1e8, int: true, hint: 'DSA / CSA / MSA index top-k. 0 = attends every kept token.' },
|
|
42
46
|
{ k: 'maxCtx', label: 'Max context', unit: 'tokens', min: 256, max: 1e8, int: true, required: true },
|
|
43
47
|
{ k: 'wprec', type: 'enum', opts: ['bf16', 'fp8', 'fp4'], label: 'Default weight precision' },
|
|
44
48
|
{ k: 'source', type: 'text', label: 'Model card URL' },
|
|
@@ -48,7 +52,7 @@
|
|
|
48
52
|
// From the shared accelerator registry (accelerators.js): per-GPU dense figures, HGX/DGX system totals divided by 8
|
|
49
53
|
// (or 72 for NVL72), "with sparsity" figures halved. Prices are placeholder on-demand rents, not quotes.
|
|
50
54
|
const REG = (typeof module !== 'undefined' && module.exports) ? require('./accelerators.js') : root.AIInfraAccelerators;
|
|
51
|
-
const ORDER = ['B200', 'B300', 'GB200-NVL72', 'GB300-NVL72', 'H200', 'H100', 'A100', 'L40S', 'MI300X', 'MI325X', 'MI355X', 'TPU7x', 'TPU-v6e', 'TPU-v5p'];
|
|
55
|
+
const ORDER = ['B200', 'B300', 'GB200-NVL72', 'GB300-NVL72', 'VR200-NVL72', 'H200', 'H100', 'A100', 'L40S', 'RTX-PRO-6000', 'MI300X', 'MI325X', 'MI355X', 'MI455X-Helios', 'TPU7x', 'TPU-v6e', 'TPU-v5p'];
|
|
52
56
|
const KEEP = ['id', 'kind', 'vendorKey', 'gkeAccelerator', 'tdpW'].concat(GPU_FIELDS.map(f => f.k)); // tdpW: board power, for tokens per MW
|
|
53
57
|
const GPUS = REG.ACCELERATORS.slice().sort((a, b) => (ORDER.indexOf(a.id) + 1 || 99) - (ORDER.indexOf(b.id) + 1 || 99))
|
|
54
58
|
.map(g => Object.fromEntries(KEEP.filter(k => g[k] !== undefined).map(k => [k, g[k]])));
|
|
@@ -69,8 +73,36 @@
|
|
|
69
73
|
Object.assign({}, G, { id: 'qwen3-coder-480b', name: 'Qwen3-Coder 480B-A35B (MoE)', total: 480, active: 35, layers: 62, hidden: 6144, qHeads: 96, kvHeads: 8, headDim: 128, experts: 160, topk: 8, maxCtx: 262144, wprec: 'fp8', source: 'https://huggingface.co/Qwen/Qwen3-Coder-480B-A35B-Instruct' }),
|
|
70
74
|
Object.assign({}, G, MLA, { id: 'deepseek-v3', name: 'DeepSeek-V3 / R1 671B (MoE, MLA)', total: 671, active: 37, layers: 61, hidden: 7168, qHeads: 128, experts: 256, topk: 8, maxCtx: 131072, wprec: 'fp8', source: 'https://huggingface.co/deepseek-ai/DeepSeek-V3' }),
|
|
71
75
|
Object.assign({}, G, MLA, { id: 'kimi-k2', name: 'Kimi K2 1T (MoE, MLA)', total: 1040, active: 32, layers: 61, hidden: 7168, qHeads: 64, experts: 384, topk: 8, maxCtx: 131072, wprec: 'fp8', source: 'https://huggingface.co/moonshotai/Kimi-K2-Instruct' }),
|
|
76
|
+
// ---- 2026 open-weight models (config.json values; see docs/CATALOG.md for where each figure comes from) ----
|
|
77
|
+
// Kimi K3 (K3.1 Pro shares the architecture): 69 Kimi Delta Attention layers (96 heads × 128 × 128 fp32 state) and
|
|
78
|
+
// 24 gated MLA layers; MXFP4 weights from quantization-aware training.
|
|
79
|
+
Object.assign({}, G, MLA, { id: 'kimi-k3', name: 'Kimi K3 / K3.1 Pro 2.8T-A104B (MoE, KDA + MLA)', total: 2800, active: 104, layers: 93, hidden: 7168, qHeads: 96, experts: 896, topk: 16, linFrac: 69 / 93, linStateMB: 6.29, maxCtx: 1048576, wprec: 'fp4', source: 'https://huggingface.co/moonshotai/Kimi-K3' }),
|
|
80
|
+
// Kimi K2.5 / K2.6: K2's shape with 256K context and native INT4 weights (sized as 4-bit)
|
|
81
|
+
Object.assign({}, G, MLA, { id: 'kimi-k26', name: 'Kimi K2.6 1T-A32B (MoE, MLA, INT4)', total: 1000, active: 32, layers: 61, hidden: 7168, qHeads: 64, experts: 384, topk: 8, maxCtx: 262144, wprec: 'fp4', source: 'https://huggingface.co/moonshotai/Kimi-K2.6' }),
|
|
82
|
+
// DeepSeek V4: one 512-wide latent per token, kept at 1/4 (CSA) or 1/128 (HCA) on alternating layers (≈ 0.129 on
|
|
83
|
+
// average); CSA attends its index top-1024, HCA all compressed blocks: modelled as 2048 attended tokens per query.
|
|
84
|
+
// Experts in FP4, the rest FP8.
|
|
85
|
+
Object.assign({}, G, MLA, { id: 'deepseek-v4-pro', name: 'DeepSeek-V4-Pro 1.6T-A49B (MoE, compressed sparse attention)', total: 1600, active: 49, layers: 61, hidden: 7168, qHeads: 128, mlaLatent: 448, mlaRope: 64, mlaNope: 448, mlaV: 512, kvKeep: 0.129, sparseTopK: 2048, experts: 384, topk: 6, maxCtx: 1048576, wprec: 'fp4', source: 'https://huggingface.co/deepseek-ai/DeepSeek-V4-Pro' }),
|
|
86
|
+
Object.assign({}, G, MLA, { id: 'deepseek-v4-flash', name: 'DeepSeek-V4-Flash 284B-A13B (MoE, compressed sparse attention)', total: 284, active: 13, layers: 43, hidden: 4096, qHeads: 64, mlaLatent: 448, mlaRope: 64, mlaNope: 448, mlaV: 512, kvKeep: 0.129, sparseTopK: 2048, experts: 256, topk: 6, maxCtx: 1048576, wprec: 'fp8', source: 'https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash' }),
|
|
87
|
+
// GLM-5.1 and GLM-5.3: MLA with DeepSeek-style sparse attention (index top-2048); GLM-5.3 extends the context to 1M.
|
|
88
|
+
// GLM-5.3's active parameters are not published: the GLM-5 lineage's 40B is assumed.
|
|
89
|
+
Object.assign({}, G, MLA, { id: 'glm-5.1', name: 'GLM-5.1 744B-A40B (MoE, MLA, sparse)', total: 744, active: 40, layers: 78, hidden: 6144, qHeads: 64, mlaNope: 192, mlaV: 256, sparseTopK: 2048, experts: 256, topk: 8, maxCtx: 202752, wprec: 'fp8', source: 'https://huggingface.co/zai-org/GLM-5.1' }),
|
|
90
|
+
Object.assign({}, G, MLA, { id: 'glm-5.3', name: 'GLM-5.3 753B (MoE, MLA, sparse, 1M)', total: 753, active: 40, layers: 78, hidden: 6144, qHeads: 64, mlaNope: 192, mlaV: 256, sparseTopK: 2048, experts: 256, topk: 8, maxCtx: 1048576, wprec: 'fp8', source: 'https://huggingface.co/zai-org/GLM-5.3' }),
|
|
91
|
+
// Mistral Large 4: MLA with sparse token selection (top-2048); nope/v head dims not published (DeepSeek's 128 assumed)
|
|
92
|
+
Object.assign({}, G, MLA, { id: 'mistral-large-4', name: 'Mistral Large 4 1.05T-A52B (MoE, MLA, sparse)', total: 1050, active: 52, layers: 72, hidden: 6144, qHeads: 64, sparseTopK: 2048, experts: 128, topk: 4, maxCtx: 1048576, wprec: 'fp8', source: 'https://huggingface.co/mistralai/Mistral-Large-4-1T-A52B' }),
|
|
93
|
+
// Qwen3.5-397B and Qwen3.8 27B: three Gated DeltaNet layers per gated-attention layer (64 / 48 value heads × 128 × 128 fp32 state)
|
|
94
|
+
Object.assign({}, G, { id: 'qwen35-397b', name: 'Qwen3.5 397B-A17B (MoE, Gated DeltaNet hybrid)', total: 397, active: 17, layers: 60, hidden: 4096, qHeads: 32, kvHeads: 2, headDim: 256, linFrac: 0.75, linStateMB: 4.19, experts: 512, topk: 10, maxCtx: 262144, wprec: 'fp8', source: 'https://huggingface.co/Qwen/Qwen3.5-397B-A17B' }),
|
|
95
|
+
Object.assign({}, G, { id: 'qwen38-27b', name: 'Qwen3.8 27B (Gated DeltaNet hybrid)', total: 27, active: 27, layers: 64, hidden: 5120, qHeads: 24, kvHeads: 4, headDim: 256, linFrac: 0.75, linStateMB: 3.15, maxCtx: 262144, wprec: 'fp8', source: 'https://huggingface.co/Qwen/Qwen3.8-27B' }),
|
|
96
|
+
// MiniMax M3: sparse attention (16 blocks of 128 tokens) in 57 of 60 layers, modelled on all of them
|
|
97
|
+
Object.assign({}, G, { id: 'minimax-m3', name: 'MiniMax M3 428B-A23B (MoE, sparse)', total: 428, active: 23, layers: 60, hidden: 6144, qHeads: 64, kvHeads: 4, headDim: 128, sparseTopK: 2048, experts: 128, topk: 4, maxCtx: 1048576, wprec: 'fp8', source: 'https://huggingface.co/MiniMaxAI/MiniMax-M3' }),
|
|
98
|
+
Object.assign({}, G, { id: 'minimax-m27', name: 'MiniMax M2.7 229B-A10B (MoE)', total: 229, active: 10, layers: 62, hidden: 3072, qHeads: 48, kvHeads: 8, headDim: 128, experts: 256, topk: 8, maxCtx: 204800, wprec: 'fp8', source: 'https://huggingface.co/MiniMaxAI/MiniMax-M2.7' }),
|
|
99
|
+
// Muse Spark Open: 46 sliding-window layers (2048 tokens) and 16 full-attention layers
|
|
100
|
+
Object.assign({}, G, { id: 'muse-spark-open', name: 'Muse Spark Open 816B-A42B (MoE)', total: 816, active: 42, layers: 62, hidden: 8192, qHeads: 128, kvHeads: 16, headDim: 64, swaFrac: 46 / 62, swaWindow: 2048, experts: 256, topk: 8, maxCtx: 1048576, wprec: 'fp4', source: 'https://huggingface.co/meta-models/Muse-Spark-Open-816B-A42B' }),
|
|
101
|
+
// Gemma 4 31B: 50 sliding-window layers (1024 tokens) and 10 global layers with 4 KV heads of 512 and keys reused as
|
|
102
|
+
// values (the KV of 4 × 256 K+V pairs). The sliding layers' 16 heads are sized as 4: their KV is capped at 1024 tokens.
|
|
103
|
+
Object.assign({}, G, { id: 'gemma4-31b', name: 'Gemma 4 31B', total: 30.7, active: 30.7, layers: 60, hidden: 5376, qHeads: 32, kvHeads: 4, headDim: 256, swaFrac: 50 / 60, swaWindow: 1024, maxCtx: 262144, wprec: 'fp8', source: 'https://huggingface.co/google/gemma-4-31B' }),
|
|
72
104
|
];
|
|
73
|
-
const MODEL_DEFAULTS = { attn: 'gqa', experts: 0, topk: 0, swaFrac: 0, swaWindow: 0, mlaLatent: 512, mlaRope: 64, mlaNope: 128, mlaV: 128, wprec: 'fp8' };
|
|
105
|
+
const MODEL_DEFAULTS = { attn: 'gqa', experts: 0, topk: 0, swaFrac: 0, swaWindow: 0, linFrac: 0, linStateMB: 0, kvKeep: 1, sparseTopK: 0, mlaLatent: 512, mlaRope: 64, mlaNope: 128, mlaV: 128, wprec: 'fp8' };
|
|
74
106
|
const GPU_DEFAULTS = { tfFp8: 0, tfFp4: 0, nodeKW: 0, price: 0, vendor: '' };
|
|
75
107
|
|
|
76
108
|
// ---------- validation ----------
|
|
@@ -100,6 +132,7 @@
|
|
|
100
132
|
out[f.k] = v;
|
|
101
133
|
}
|
|
102
134
|
if (kind === 'Model' && out.active > out.total) errors.push(`Model "${out.name}": active params (${out.active}B) exceed total (${out.total}B).`);
|
|
135
|
+
if (kind === 'Model' && (out.swaFrac || 0) + (out.linFrac || 0) > 1) errors.push(`Model "${out.name}": sliding-window and linear-attention shares add up to more than all layers.`);
|
|
103
136
|
if (kind === 'Model' && out.experts > 0 && !(out.topk > 0 && out.topk < out.experts)) errors.push(`Model "${out.name}": experts per token must be between 1 and ${out.experts - 1}.`);
|
|
104
137
|
if (kind === 'Model' && out.experts > 0 && out.active >= out.total) errors.push(`Model "${out.name}": an MoE model needs active params below total params.`);
|
|
105
138
|
return { ok: errors.length === 0, errors, value: out };
|
|
@@ -182,6 +215,19 @@
|
|
|
182
215
|
notes.push('Chunked-attention layers modelled as sliding-window layers.');
|
|
183
216
|
}
|
|
184
217
|
if (c.sliding_window && !swaFrac) notes.push('sliding_window is set but not enabled for these layers; KV is sized for full attention.');
|
|
218
|
+
// linear-attention layers (Qwen3-Next / Qwen3.5 Gated DeltaNet: layer_types "linear_attention" or full_attention_interval)
|
|
219
|
+
let linFrac = 0, linStateMB = 0;
|
|
220
|
+
const linN = Array.isArray(c.layer_types) ? c.layer_types.filter(t => /linear/i.test(String(t))).length
|
|
221
|
+
: c.full_attention_interval > 1 ? layers - Math.floor(layers / c.full_attention_interval) : 0;
|
|
222
|
+
if (linN) {
|
|
223
|
+
linFrac = +(linN / layers).toFixed(4);
|
|
224
|
+
const vh = +first(c, ['linear_num_value_heads'], qHeads), kd = +first(c, ['linear_key_head_dim'], 128), vd = +first(c, ['linear_value_head_dim'], 128);
|
|
225
|
+
linStateMB = +(vh * kd * vd * 4 / 1e6).toFixed(3);
|
|
226
|
+
notes.push(`${linN} linear-attention layers: a ${linStateMB} MB state per layer per sequence (fp32), no KV per token.`);
|
|
227
|
+
}
|
|
228
|
+
// sparse attention: an index picks the tokens each query attends (DeepSeek Sparse Attention and its descendants)
|
|
229
|
+
const sparseTopK = c.index_topk ? +c.index_topk : 0;
|
|
230
|
+
if (sparseTopK) notes.push(`Sparse attention: each query attends ${sparseTopK} selected tokens.`);
|
|
185
231
|
// context
|
|
186
232
|
let maxCtx = +first(c, ['max_position_embeddings', 'n_positions', 'seq_length', 'max_sequence_length'], 4096);
|
|
187
233
|
const rs = c.rope_scaling;
|
|
@@ -216,7 +262,7 @@
|
|
|
216
262
|
const name = String(first(j, ['_name_or_path', 'name_or_path'], '') || '').split('/').pop() || (c.model_type ? c.model_type + ' ' + (total / 1e9).toFixed(0) + 'B' : 'Imported model');
|
|
217
263
|
const model = {
|
|
218
264
|
name, total: +(total / 1e9).toFixed(2), active: +(active / 1e9).toFixed(2), layers, hidden, qHeads, kvHeads, headDim,
|
|
219
|
-
attn: mla ? 'mla' : 'gqa', mlaLatent, mlaRope, mlaNope, mlaV, experts, topk, swaFrac, swaWindow, maxCtx,
|
|
265
|
+
attn: mla ? 'mla' : 'gqa', mlaLatent, mlaRope, mlaNope, mlaV, experts, topk, swaFrac, swaWindow, linFrac, linStateMB, sparseTopK, maxCtx,
|
|
220
266
|
wprec: /fp8|float8/i.test(JSON.stringify(j.quantization_config || '')) ? 'fp8' : /mxfp4|nvfp4|fp4/i.test(JSON.stringify(j.quantization_config || '')) ? 'fp4' : 'fp8',
|
|
221
267
|
};
|
|
222
268
|
return { model, notes };
|