aiinfra-tools 0.2.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 +268 -0
- package/README.md +27 -3
- package/bin/aiinfra.mjs +5 -2
- package/bin/report.mjs +177 -0
- package/fleetops/README.md +33 -1
- package/fleetops/deploy/shadow-gate/argo-analysistemplate.yaml +34 -0
- package/fleetops/deploy/shadow-gate/argo-rollout-example.yaml +38 -0
- package/fleetops/deploy/shadow-gate/flagger-canary.yaml +34 -0
- package/fleetops/deploy/shadow-gate/judge.yaml +51 -0
- package/fleetops/deploy/shadow-gate/llmd-canary-example.yaml +35 -0
- package/fleetops/deploy/shadow-gate/podmonitor-vllm.yaml +20 -0
- package/fleetops/deploy/shadow-live/README.md +41 -0
- package/fleetops/deploy/shadow-live/kit.yaml +123 -0
- package/fleetops/deploy/shadow-live/load-canary.yaml +26 -0
- package/fleetops/deploy/shadow-live/run.sh +53 -0
- package/fleetops/docs/ADMISSION.md +9 -9
- package/fleetops/docs/FABRIC-STORAGE.md +1 -1
- package/fleetops/docs/SERVING.md +11 -1
- package/fleetops/docs/SHADOW.md +250 -0
- package/fleetops/docs/SIGNALS.md +5 -2
- package/fleetops/docs/WORKLOADS.md +1 -1
- package/fleetops/package.json +7 -4
- package/fleetops/src/adapters/fabric.mjs +19 -7
- package/fleetops/src/adapters/live.mjs +38 -5
- package/fleetops/src/adapters/logs.mjs +10 -7
- package/fleetops/src/adapters/nvsentinel.mjs +95 -0
- package/fleetops/src/adapters/topology.mjs +53 -1
- package/fleetops/src/admission.mjs +26 -18
- package/fleetops/src/api.mjs +2 -1
- package/fleetops/src/bundle.mjs +3 -0
- package/fleetops/src/calibrate.mjs +1 -1
- package/fleetops/src/detect.mjs +1 -1
- package/fleetops/src/export.mjs +5 -1
- package/fleetops/src/goodput.mjs +0 -2
- package/fleetops/src/incidents.mjs +1 -2
- package/fleetops/src/ingest.mjs +10 -3
- package/fleetops/src/inject.mjs +2 -2
- package/fleetops/src/live.mjs +2 -1
- package/fleetops/src/llmd.mjs +7 -3
- package/fleetops/src/optimize.mjs +1 -1
- package/fleetops/src/power.mjs +7 -7
- package/fleetops/src/procure.mjs +67 -0
- package/fleetops/src/rca.mjs +1 -1
- package/fleetops/src/rollout.mjs +1 -1
- package/fleetops/src/schema.mjs +3 -2
- package/fleetops/src/security.mjs +1 -1
- package/fleetops/src/serving.mjs +32 -10
- package/fleetops/src/shadow-canary.mjs +74 -0
- package/fleetops/src/shadow-gate.mjs +49 -0
- package/fleetops/src/shadow-prom.mjs +205 -0
- package/fleetops/src/shadow-replay.mjs +147 -0
- package/fleetops/src/shadow.mjs +291 -0
- package/fleetops/src/stats.mjs +14 -0
- package/fleetops/src/traces.mjs +0 -5
- package/fleetops/tests/fixtures/real/README.md +5 -0
- package/fleetops/tools/admit-node.sh +51 -16
- package/fleetops/tools/amd-admit.py +111 -0
- package/fleetops/tools/cmd/calibrate.mjs +61 -0
- package/fleetops/tools/cmd/capacity.mjs +116 -0
- package/fleetops/tools/cmd/common.mjs +32 -0
- package/fleetops/tools/cmd/data.mjs +343 -0
- package/fleetops/tools/cmd/help.mjs +243 -0
- package/fleetops/tools/cmd/incidents.mjs +216 -0
- package/fleetops/tools/cmd/rollout.mjs +122 -0
- package/fleetops/tools/cmd/server.mjs +122 -0
- package/fleetops/tools/cmd/serving.mjs +95 -0
- package/fleetops/tools/cmd/shadow.mjs +204 -0
- package/fleetops/tools/cmd/training.mjs +79 -0
- package/fleetops/tools/collect.sh +6 -1
- package/fleetops/tools/fleetops.mjs +18 -1308
- package/fleetops/tools/loop-demo.mjs +1 -1
- package/fleetops/tools/workload-profile.mjs +0 -1
- package/fleetscope/README.md +5 -1
- package/fleetscope/build.mjs +4 -0
- package/fleetscope/dist/index.html +1013 -28
- package/fleetscope/docs/AGENTIC.md +89 -0
- package/fleetscope/docs/PLANNING.md +4 -2
- package/fleetscope/docs/VALIDATION-AGENTIC.md +37 -0
- package/fleetscope/package.json +4 -3
- package/fleetscope/src/agentic.js +288 -0
- package/fleetscope/src/ask.js +0 -1
- package/fleetscope/src/cluster-ui.js +1 -0
- package/fleetscope/src/engine.js +29 -13
- package/fleetscope/src/index.src.html +15 -5
- package/fleetscope/src/inference-ui.js +1 -0
- package/fleetscope/src/ingest.js +89 -3
- package/fleetscope/src/optimize.js +11 -5
- package/fleetscope/src/plan.js +1 -1
- package/fleetscope/src/training-ui.js +1 -0
- package/fleetscope/tools/agentic.mjs +148 -0
- package/fleetscope/tools/tracelab-data.mjs +27 -0
- package/gpu-health/README.md +13 -2
- package/gpu-health/docs/CONFIG.md +29 -1
- package/gpu-health/package.json +7 -4
- package/gpu-health/src/actions.mjs +16 -3
- package/gpu-health/src/analyze.mjs +3 -0
- package/gpu-health/src/config.mjs +3 -0
- package/gpu-health/src/executors.mjs +9 -4
- package/gpu-health/src/health.mjs +1 -1
- package/gpu-health/src/ingest.mjs +27 -3
- package/gpu-health/src/platforms.mjs +109 -0
- package/gpu-health/src/vendors.mjs +12 -5
- package/gpu-health/tools/gpu-health.mjs +6 -4
- package/gpu-ledger/README.md +3 -1
- package/gpu-ledger/package.json +12 -4
- package/gpu-ledger/src/adapters.mjs +3 -2
- package/gpu-ledger/src/cloud.mjs +104 -0
- package/gpu-ledger/src/core.mjs +12 -10
- package/gpu-ledger/tools/ledger.mjs +8 -2
- package/harness-ledger/README.md +152 -0
- package/harness-ledger/docs/FORMATS.md +114 -0
- package/harness-ledger/docs/METHOD.md +133 -0
- package/harness-ledger/docs/VALIDATION-ECONOMICS.md +59 -0
- package/harness-ledger/docs/VALIDATION-SWEBENCH.md +26 -0
- package/harness-ledger/docs/VALIDATION-TRACELAB.md +56 -0
- package/harness-ledger/package.json +19 -0
- package/harness-ledger/src/demo.mjs +115 -0
- package/harness-ledger/src/economics.mjs +184 -0
- package/harness-ledger/src/gpu.mjs +80 -0
- package/harness-ledger/src/html.mjs +63 -0
- package/harness-ledger/src/importers.mjs +247 -0
- package/harness-ledger/src/ledger.mjs +128 -0
- package/harness-ledger/src/opencost.mjs +55 -0
- package/harness-ledger/src/outcomes.mjs +67 -0
- package/harness-ledger/src/prices.mjs +75 -0
- package/harness-ledger/src/record.mjs +52 -0
- package/harness-ledger/src/waste.mjs +136 -0
- package/harness-ledger/tools/harness-ledger.mjs +199 -0
- package/harness-ledger/tools/validate-economics.mjs +69 -0
- package/harness-ledger/tools/validate-swebench.mjs +57 -0
- package/harness-ledger/tools/validate-tracelab.mjs +74 -0
- package/hybrid-tracing/package.json +4 -3
- package/hybrid-tracing/tools/fix-skew.mjs +1 -1
- package/inference-sizer/README.md +5 -1
- package/inference-sizer/build.mjs +1 -0
- package/inference-sizer/dist/index.html +299 -31
- package/inference-sizer/docs/ACCELERATORS.md +62 -0
- package/inference-sizer/docs/CATALOG.md +71 -0
- package/inference-sizer/docs/METHOD.md +1 -1
- package/inference-sizer/docs/VALIDATION-INFERENCEX.md +37 -0
- package/inference-sizer/package.json +4 -3
- package/inference-sizer/src/accelerators.js +194 -0
- package/inference-sizer/src/catalog.js +55 -22
- package/inference-sizer/src/fit-ui.js +1 -1
- package/inference-sizer/src/index.src.html +3 -0
- package/inference-sizer/src/model.js +45 -7
- package/inference-sizer/src/ui.js +1 -1
- package/inference-sizer/tools/validate-agentx.mjs +116 -0
- package/inference-sizer/tools/validate-inferencex.mjs +132 -0
- package/mcp/README.md +6 -1
- package/mcp/server.mjs +34 -0
- package/package.json +10 -6
- package/schemas/README.md +3 -0
- package/schemas/aiinfra.report.schema.json +474 -0
- package/schemas/commands.mjs +14 -0
- package/schemas/fleetops.shadow.canary.schema.json +96 -0
- package/schemas/fleetops.shadow.compare.schema.json +266 -0
- package/schemas/fleetops.shadow.prom.schema.json +354 -0
- package/schemas/harness-ledger.economics.schema.json +567 -0
- package/schemas/sizer.list.schema.json +15 -2
|
@@ -385,6 +385,880 @@ button, select, input { font: inherit; color: inherit; }
|
|
|
385
385
|
<div class="shell" id="trainingApp" hidden></div>
|
|
386
386
|
<div class="shell" id="inferenceApp" hidden></div>
|
|
387
387
|
<script>
|
|
388
|
+
/* The accelerator registry: every chip the tools know, in one place, and what each vendor's stack needs.
|
|
389
|
+
The Inference Sizer's catalog, FleetScope's GPU table, fleetops' power model and serving manifests all read it, so a
|
|
390
|
+
new chip or vendor is one edit here (plus a gpu-health vendor profile if its exporter is new).
|
|
391
|
+
|
|
392
|
+
ACCELERATORS chips with full spec-sheet figures, usable for sizing and simulation
|
|
393
|
+
id, label, vendor (display), vendorKey (key into VENDORS and gpu-health's vendor profiles), kind (gpu | tpu | …)
|
|
394
|
+
hbmGB, hbmTBs, tfBf16, tfFp8, tfFp4 per chip, dense (sparsity figures halved; rack or system totals divided)
|
|
395
|
+
scaleUpGBs chip-to-chip link, per direction (NVLink, Infinity Fabric, ICI); domain: chips per scale-up domain
|
|
396
|
+
nicGbps scale-out network per chip; nodeKW: max power per domain where the vendor publishes it
|
|
397
|
+
tdpW board power on the spec sheet (TBP/TDP; none for cloud-only chips that don't publish it); match: regex
|
|
398
|
+
for the SKU names telemetry, Kubernetes labels and bills report
|
|
399
|
+
gkeAccelerator GKE's cloud.google.com/gke-tpu-accelerator value, for TPU node selectors
|
|
400
|
+
price, onprem placeholder $/chip-hour (rent, and amortized on-prem cost for FleetScope), not quotes
|
|
401
|
+
short FleetScope's key and short label, where it differs from id; source: spec sheet URL
|
|
402
|
+
OTHER_SKUS chips seen in telemetry but not sized (only power and vendor): id, vendorKey, kind, tdpW, match
|
|
403
|
+
VENDORS per vendor: Kubernetes resource and labels, telemetry tools, collective library, serving images
|
|
404
|
+
INSTANCES cloud instance types → { cloud, chip (registry id or SKU), gpus }, for bills and node labels
|
|
405
|
+
|
|
406
|
+
Order matters for match: more specific names first (GB200 before B200, H100 PCIe before H100). */
|
|
407
|
+
(function (root) {
|
|
408
|
+
'use strict';
|
|
409
|
+
|
|
410
|
+
const VENDORS = {
|
|
411
|
+
nvidia: {
|
|
412
|
+
name: 'NVIDIA', kind: 'gpu', k8sResource: 'nvidia.com/gpu', productLabels: ['nvidia.com/gpu.product', 'cloud.google.com/gke-accelerator'],
|
|
413
|
+
smi: 'nvidia-smi', exporter: 'dcgm-exporter', collectives: 'NCCL', kvBufferDevice: 'cuda',
|
|
414
|
+
images: { vllm: 'vllm/vllm-openai', llmdVllm: 'docker.io/vllm/vllm-openai:v0.31.0' },
|
|
415
|
+
},
|
|
416
|
+
amd: {
|
|
417
|
+
name: 'AMD', kind: 'gpu', k8sResource: 'amd.com/gpu', productLabels: ['amd.com/gpu.product-name'],
|
|
418
|
+
smi: 'amd-smi', exporter: 'device-metrics-exporter', collectives: 'RCCL',
|
|
419
|
+
// NIXL's UCX path on ROCm stages the KV cache through host memory in llm-d's P/D guide
|
|
420
|
+
kvBufferDevice: 'cpu',
|
|
421
|
+
images: { vllm: 'rocm/vllm', llmdVllm: 'docker.io/vllm/vllm-openai-rocm:v0.31.0' },
|
|
422
|
+
},
|
|
423
|
+
// Cloud TPU on GKE: chips requested as google.com/tpu, the slice chosen by accelerator and topology node labels.
|
|
424
|
+
// vLLM on TPU: the vllm/vllm-tpu image (GKE's Trillium tutorial). No llm-d P/D image validated for TPU here.
|
|
425
|
+
tpu: {
|
|
426
|
+
name: 'Google Cloud TPU', kind: 'tpu', k8sResource: 'google.com/tpu', productLabels: ['cloud.google.com/gke-tpu-accelerator'],
|
|
427
|
+
topologyLabel: 'cloud.google.com/gke-tpu-topology', smi: 'tpu-info', exporter: 'Cloud Monitoring (accelerator metrics) or libtpu', collectives: 'XLA collectives over ICI',
|
|
428
|
+
images: { vllm: 'vllm/vllm-tpu' },
|
|
429
|
+
},
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
const A = (o) => Object.assign({ kind: 'gpu', tfFp4: 0 }, o);
|
|
433
|
+
const ACCELERATORS = [
|
|
434
|
+
// Vera Rubin NVL72 (VR200; first called NVL144 for its 144 dies): per Rubin package, 288 GB HBM4 at 22 TB/s; dense
|
|
435
|
+
// NVFP4 35 PF (the 50 PF inference figure uses adaptive compression), FP8 17.5 PF, BF16 4 PF; NVLink 6 3.6 TB/s
|
|
436
|
+
// bidirectional; ConnectX-9 1.6 Tb/s. NVIDIA publishes no board power: 2.3 kW is the reported Max-P TGP.
|
|
437
|
+
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',
|
|
438
|
+
source: 'https://developer.nvidia.com/blog/inside-the-NVIDIA-rubin-platform-six-new-chips-one-ai-supercomputer' }),
|
|
439
|
+
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',
|
|
440
|
+
// 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
|
|
441
|
+
source: 'https://www.nvidia.com/en-us/data-center/gb300-nvl72/' }),
|
|
442
|
+
A({ id: 'GB200-NVL72', short: 'GB200', label: 'NVIDIA GB200 NVL72 (72-GPU rack)', vendor: 'NVIDIA', vendorKey: 'nvidia', hbmGB: 186, hbmTBs: 8, tfBf16: 2500, tfFp8: 5000, tfFp4: 10000, scaleUpGBs: 900, domain: 72, nicGbps: 400, nodeKW: 120, tdpW: 1200, price: 6.0, onprem: 3.6, match: 'GB200',
|
|
443
|
+
source: 'https://www.nvidia.com/en-us/data-center/gb200-nvl72/' }),
|
|
444
|
+
A({ id: 'B300', label: 'NVIDIA B300 (HGX, 8-GPU)', vendor: 'NVIDIA', vendorKey: 'nvidia', hbmGB: 262, hbmTBs: 8, tfBf16: 2250, tfFp8: 4500, tfFp4: 13500, scaleUpGBs: 900, domain: 8, nicGbps: 800, nodeKW: 14.5, tdpW: 1100, price: 7.0, onprem: 4.0, match: 'B300',
|
|
445
|
+
source: 'https://www.nvidia.com/en-us/data-center/hgx/' }),
|
|
446
|
+
A({ id: 'B200', label: 'NVIDIA B200 (HGX, 8-GPU)', vendor: 'NVIDIA', vendorKey: 'nvidia', hbmGB: 180, hbmTBs: 8, tfBf16: 2250, tfFp8: 4500, tfFp4: 9000, scaleUpGBs: 900, domain: 8, nicGbps: 400, nodeKW: 14.3, tdpW: 1000, price: 5.5, onprem: 3.2, match: 'B200',
|
|
447
|
+
source: 'https://www.nvidia.com/en-us/data-center/dgx-b200/' }),
|
|
448
|
+
A({ id: 'H200', label: 'NVIDIA H200 SXM (8-GPU)', vendor: 'NVIDIA', vendorKey: 'nvidia', hbmGB: 141, hbmTBs: 4.8, tfBf16: 989, tfFp8: 1979, scaleUpGBs: 450, domain: 8, nicGbps: 400, nodeKW: 10.2, tdpW: 700, price: 3.5, onprem: 2.0, match: 'H200',
|
|
449
|
+
source: 'https://www.nvidia.com/en-us/data-center/h200/' }),
|
|
450
|
+
A({ id: 'H100', label: 'NVIDIA H100 SXM (8-GPU)', vendor: 'NVIDIA', vendorKey: 'nvidia', hbmGB: 80, hbmTBs: 3.35, tfBf16: 989, tfFp8: 1979, scaleUpGBs: 450, domain: 8, nicGbps: 400, nodeKW: 10.2, tdpW: 700, price: 2.4, onprem: 1.4, match: 'H100(?!.*PCIe)|H800',
|
|
451
|
+
source: 'https://www.nvidia.com/en-us/data-center/h100/' }),
|
|
452
|
+
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',
|
|
453
|
+
source: 'https://www.nvidia.com/en-us/data-center/a100/' }),
|
|
454
|
+
// RTX PRO 6000 Blackwell Server Edition: 96 GB GDDR7 at 1.6 TB/s; 4 / 2 / 1 PF FP4 / FP8 / BF16 with sparsity
|
|
455
|
+
// (halved here); PCIe 5.0 x16 between cards; up to 600 W
|
|
456
|
+
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',
|
|
457
|
+
source: 'https://www.nvidia.com/en-us/data-center/rtx-pro-6000-blackwell-server-edition/' }),
|
|
458
|
+
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',
|
|
459
|
+
source: 'https://www.nvidia.com/en-us/data-center/l40s/' }),
|
|
460
|
+
// 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
|
|
461
|
+
// (UALink over Ethernet, bidirectional), 43 TB/s scale-out per rack (2.4 Tb/s per GPU per direction), 246 kW per
|
|
462
|
+
// rack (AMD's validated reference design). AMD publishes no board power: ~1.7 kW is the reported projection.
|
|
463
|
+
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',
|
|
464
|
+
source: 'https://www.amd.com/en/products/accelerators/instinct/mi400.html' }),
|
|
465
|
+
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',
|
|
466
|
+
// Infinity Fabric: 7 links × 144 GB/s (bidirectional) = 504 GB/s per direction
|
|
467
|
+
source: 'https://www.amd.com/en/products/accelerators/instinct/mi350/mi355x.html' }),
|
|
468
|
+
A({ id: 'MI325X', label: 'AMD Instinct MI325X (8-GPU)', vendor: 'AMD', vendorKey: 'amd', hbmGB: 256, hbmTBs: 6, tfBf16: 1307.4, tfFp8: 2614.9, scaleUpGBs: 448, domain: 8, nicGbps: 400, tdpW: 1000, price: 2.9, onprem: 1.7, match: 'MI325',
|
|
469
|
+
// platform peer-to-peer I/O 896 GB/s bidirectional = 448 GB/s per direction
|
|
470
|
+
source: 'https://www.amd.com/en/products/accelerators/instinct/mi300/mi325x.html' }),
|
|
471
|
+
// Cloud TPU: per chip, from cloud.google.com/tpu/docs (v6e, tpu7x pages). ICI figures are bidirectional there, halved
|
|
472
|
+
// here. domain = chips per TPU VM host; ICI across hosts in a slice is modelled as the data-center network, so
|
|
473
|
+
// tensor parallelism beyond one host is costed pessimistically. Prices: on-demand $/chip-hour, us-east1/us-central1.
|
|
474
|
+
A({ id: 'TPU7x', label: 'Google TPU7x (Ironwood), 4 per host', vendor: 'Google', vendorKey: 'tpu', kind: 'tpu', hbmGB: 192, hbmTBs: 7.37, tfBf16: 2307, tfFp8: 4614, scaleUpGBs: 600, domain: 4, nicGbps: 100, price: 12.0, gkeAccelerator: 'tpu7x', match: 'tpu7x|ironwood|TpuV7',
|
|
475
|
+
source: 'https://docs.cloud.google.com/tpu/docs/tpu7x' }),
|
|
476
|
+
A({ id: 'TPU-v6e', short: 'v6e', label: 'Google TPU v6e (Trillium), 8 per host', vendor: 'Google', vendorKey: 'tpu', kind: 'tpu', hbmGB: 32, hbmTBs: 1.64, tfBf16: 918, tfFp8: 918, scaleUpGBs: 400, domain: 8, nicGbps: 100, price: 2.7, gkeAccelerator: 'tpu-v6e-slice', match: 'v6e|trillium',
|
|
477
|
+
source: 'https://docs.cloud.google.com/tpu/docs/v6e' }),
|
|
478
|
+
A({ id: 'TPU-v5p', short: 'v5p', label: 'Google TPU v5p, 4 per host', vendor: 'Google', vendorKey: 'tpu', kind: 'tpu', hbmGB: 102, hbmTBs: 2.765, tfBf16: 459, tfFp8: 459, scaleUpGBs: 600, domain: 4, nicGbps: 50, price: 4.2, gkeAccelerator: 'tpu-v5p-slice', match: 'v5p',
|
|
479
|
+
// 95 GiB HBM per chip
|
|
480
|
+
source: 'https://docs.cloud.google.com/tpu/docs/tpu7x' }),
|
|
481
|
+
A({ id: 'MI300X', label: 'AMD Instinct MI300X (8-GPU)', vendor: 'AMD', vendorKey: 'amd', hbmGB: 192, hbmTBs: 5.3, tfBf16: 1307, tfFp8: 2615, scaleUpGBs: 448, domain: 8, nicGbps: 400, nodeKW: 10, tdpW: 750, price: 2.6, onprem: 1.5, match: 'MI300X',
|
|
482
|
+
source: 'https://www.amd.com/en/products/accelerators/instinct/mi300/mi300x.html' }),
|
|
483
|
+
];
|
|
484
|
+
|
|
485
|
+
const OTHER_SKUS = [
|
|
486
|
+
{ id: 'H100-PCIe', vendorKey: 'nvidia', kind: 'gpu', tdpW: 350, match: 'H100.*PCIe' },
|
|
487
|
+
{ id: 'H20', vendorKey: 'nvidia', kind: 'gpu', tdpW: 400, match: 'H20\\b' },
|
|
488
|
+
{ id: 'A100-PCIe', vendorKey: 'nvidia', kind: 'gpu', tdpW: 300, match: 'A100.*PCIe' },
|
|
489
|
+
{ id: 'A100-40GB', vendorKey: 'nvidia', kind: 'gpu', tdpW: 400, match: 'A100.*40\\s?GB' },
|
|
490
|
+
{ id: 'A10G', vendorKey: 'nvidia', kind: 'gpu', tdpW: 300, match: 'A10G' },
|
|
491
|
+
{ id: 'L4', vendorKey: 'nvidia', kind: 'gpu', tdpW: 72, match: 'L4\\b' },
|
|
492
|
+
{ id: 'A10', vendorKey: 'nvidia', kind: 'gpu', tdpW: 150, match: 'A10\\b' },
|
|
493
|
+
{ id: 'T4', vendorKey: 'nvidia', kind: 'gpu', tdpW: 70, match: 'T4\\b' },
|
|
494
|
+
{ id: 'V100', vendorKey: 'nvidia', kind: 'gpu', tdpW: 300, match: 'V100' },
|
|
495
|
+
{ id: 'MI350X', vendorKey: 'amd', kind: 'gpu', tdpW: 1000, match: 'MI350' },
|
|
496
|
+
{ id: 'MI250', vendorKey: 'amd', kind: 'gpu', tdpW: 560, match: 'MI250' },
|
|
497
|
+
{ id: 'TPU-v5e', vendorKey: 'tpu', kind: 'tpu', match: 'v5e|v5-?lite' },
|
|
498
|
+
];
|
|
499
|
+
|
|
500
|
+
// ---------- cloud instance types ----------
|
|
501
|
+
// AWS: docs.aws.amazon.com/AWSEC2/latest/UserGuide/accelerated-computing-instances.html and aws.amazon.com/ec2/instance-types/p6/
|
|
502
|
+
const INSTANCES = {};
|
|
503
|
+
const add = (cloud, chip, list) => { for (const [type, gpus] of list) INSTANCES[type.toLowerCase()] = { cloud, chip, gpus }; };
|
|
504
|
+
const sizes = (fam, one, more) => one.map(s => [`${fam}.${s}`, 1]).concat(more.map(([s, n]) => [`${fam}.${s}`, n]));
|
|
505
|
+
add('aws', 'A100-40GB', [['p4d.24xlarge', 8]]);
|
|
506
|
+
add('aws', 'A100', [['p4de.24xlarge', 8]]);
|
|
507
|
+
add('aws', 'H100', [['p5.4xlarge', 1], ['p5.48xlarge', 8]]);
|
|
508
|
+
add('aws', 'H200', [['p5e.48xlarge', 8], ['p5en.48xlarge', 8]]);
|
|
509
|
+
add('aws', 'B200', [['p6-b200.48xlarge', 8]]);
|
|
510
|
+
add('aws', 'B300', [['p6-b300.48xlarge', 8]]);
|
|
511
|
+
add('aws', 'GB200-NVL72', [['p6e-gb200.36xlarge', 4]]); // sold as UltraServers of 36 or 72 GPUs (u-p6e-gb200x36, x72)
|
|
512
|
+
add('aws', 'L40S', sizes('g6e', ['xlarge', '2xlarge', '4xlarge', '8xlarge', '16xlarge'], [['12xlarge', 4], ['24xlarge', 4], ['48xlarge', 8]]));
|
|
513
|
+
add('aws', 'L4', sizes('g6', ['xlarge', '2xlarge', '4xlarge', '8xlarge', '16xlarge'], [['12xlarge', 4], ['24xlarge', 4], ['48xlarge', 8]]));
|
|
514
|
+
add('aws', 'A10G', sizes('g5', ['xlarge', '2xlarge', '4xlarge', '8xlarge', '16xlarge'], [['12xlarge', 4], ['24xlarge', 4], ['48xlarge', 8]]));
|
|
515
|
+
add('aws', 'T4', sizes('g4dn', ['xlarge', '2xlarge', '4xlarge', '8xlarge', '16xlarge'], [['12xlarge', 4], ['metal', 8]]));
|
|
516
|
+
// GCP: docs.cloud.google.com/compute/docs/gpus and /compute/docs/tpus/tpu-machines; GKE TPU machine types
|
|
517
|
+
const gpuN = (fam, chip, ns) => add('gcp', chip, ns.map(n => [`${fam}-${n}g`, n]));
|
|
518
|
+
gpuN('a2-highgpu', 'A100-40GB', [1, 2, 4, 8]); add('gcp', 'A100-40GB', [['a2-megagpu-16g', 16]]);
|
|
519
|
+
gpuN('a2-ultragpu', 'A100', [1, 2, 4, 8]);
|
|
520
|
+
gpuN('a3-highgpu', 'H100', [1, 2, 4, 8]); add('gcp', 'H100', [['a3-megagpu-8g', 8], ['a3-edgegpu-8g', 8]]);
|
|
521
|
+
add('gcp', 'H200', [['a3-ultragpu-8g', 8]]);
|
|
522
|
+
add('gcp', 'B200', [['a4-highgpu-8g', 8]]);
|
|
523
|
+
add('gcp', 'GB200-NVL72', [['a4x-highgpu-4g', 4]]);
|
|
524
|
+
add('gcp', 'L4', [4, 8, 12, 16, 32].map(n => [`g2-standard-${n}`, 1]).concat([['g2-standard-24', 2], ['g2-standard-48', 4], ['g2-standard-96', 8]]));
|
|
525
|
+
add('gcp', 'TPU-v6e', [['ct6e-standard-1t', 1], ['ct6e-standard-4t', 4], ['ct6e-standard-8t', 8]]);
|
|
526
|
+
add('gcp', 'TPU-v5p', [['ct5p-hightpu-4t', 4]]);
|
|
527
|
+
add('gcp', 'TPU7x', [['tpu7x-standard-4t', 4]]);
|
|
528
|
+
add('gcp', 'TPU-v5e', [['ct5lp-hightpu-1t', 1], ['ct5lp-hightpu-4t', 4], ['ct5lp-hightpu-8t', 8]]);
|
|
529
|
+
// Azure: learn.microsoft.com/azure/virtual-machines/sizes/gpu-accelerated (ND H100/H200/MI300X v5, ND GB200 v6, ND A100 v4);
|
|
530
|
+
// AKS puts the size in node.kubernetes.io/instance-type with this capitalisation (matched case-insensitively)
|
|
531
|
+
add('azure', 'H100', [['Standard_ND96isr_H100_v5', 8]]);
|
|
532
|
+
add('azure', 'H200', [['Standard_ND96isr_H200_v5', 8]]);
|
|
533
|
+
add('azure', 'MI300X', [['Standard_ND96isr_MI300X_v5', 8]]);
|
|
534
|
+
add('azure', 'GB200-NVL72', [['Standard_ND128isr_NDR_GB200_v6', 4]]); // 18 VMs per NVL72 rack
|
|
535
|
+
add('azure', 'A100-40GB', [['Standard_ND96asr_v4', 8]]);
|
|
536
|
+
add('azure', 'A100', [['Standard_ND96amsr_A100_v4', 8]]);
|
|
537
|
+
const instanceOf = type => INSTANCES[String(type || '').toLowerCase()] || null;
|
|
538
|
+
// TPU slice topology for a chip count: 2D (v5e, v6e) or 3D torus (v4, v5p, 7x), as GKE's node selector wants it
|
|
539
|
+
const TOPO2 = { 1: '1x1', 4: '2x2', 8: '2x4', 16: '4x4', 32: '4x8', 64: '8x8', 128: '8x16', 256: '16x16' };
|
|
540
|
+
const TOPO3 = { 4: '2x2x1', 8: '2x2x2', 16: '2x2x4', 32: '2x4x4', 64: '4x4x4' };
|
|
541
|
+
function tpuTopology(chip, chips) { const a = byId(chip) || match(chip); if (!a) return null; return (/v6e|v5e/i.test(a.id) ? TOPO2 : TOPO3)[chips] || null; }
|
|
542
|
+
|
|
543
|
+
// telemetry SKU string ("NVIDIA H100 80GB HBM3", "AMD Instinct MI300X", …) → registry entry, most specific first
|
|
544
|
+
const ORDER = (() => {
|
|
545
|
+
const all = ACCELERATORS.concat(OTHER_SKUS).map(x => ({ x, re: new RegExp(x.match, 'i') }));
|
|
546
|
+
// a PCIe or 40 GB variant before its sibling; otherwise registry order (which lists GB* before B*)
|
|
547
|
+
const first = a => /PCIe|40GB/.test(a.x.id);
|
|
548
|
+
return all.filter(first).concat(all.filter(a => !first(a)));
|
|
549
|
+
})();
|
|
550
|
+
function match(sku) {
|
|
551
|
+
const s = String(sku || '');
|
|
552
|
+
if (!s) return null;
|
|
553
|
+
const exact = ACCELERATORS.concat(OTHER_SKUS).find(x => x.id.toLowerCase() === s.toLowerCase() || (x.short && x.short.toLowerCase() === s.toLowerCase()));
|
|
554
|
+
if (exact) return exact;
|
|
555
|
+
const hit = ORDER.find(a => a.re.test(s));
|
|
556
|
+
return hit ? hit.x : null;
|
|
557
|
+
}
|
|
558
|
+
const byId = id => ACCELERATORS.find(x => x.id === id || x.short === id) || null;
|
|
559
|
+
const tdpOf = sku => { const m = match(sku); return m ? m.tdpW : null; };
|
|
560
|
+
// vendor key for an entry, a SKU string or a display vendor ("AMD"); null when unknown
|
|
561
|
+
function vendorKeyOf(x) {
|
|
562
|
+
if (!x) return null;
|
|
563
|
+
if (typeof x === 'object') return x.vendorKey || vendorKeyOf(x.vendor) || vendorKeyOf(x.id);
|
|
564
|
+
const s = String(x).toLowerCase();
|
|
565
|
+
if (VENDORS[s]) return s;
|
|
566
|
+
const v = Object.keys(VENDORS).find(k => VENDORS[k].name.toLowerCase() === s);
|
|
567
|
+
if (v) return v;
|
|
568
|
+
const m = match(x);
|
|
569
|
+
return m ? m.vendorKey : null;
|
|
570
|
+
}
|
|
571
|
+
// the vendor's deployment adapter; throws with the known vendors when there is none
|
|
572
|
+
function vendor(x) {
|
|
573
|
+
const k = vendorKeyOf(x);
|
|
574
|
+
if (!k || !VENDORS[k]) throw new Error(`no vendor adapter for ${typeof x === 'object' ? (x.id || x.vendor) : x}; known: ${Object.keys(VENDORS).join(', ')}`);
|
|
575
|
+
return Object.assign({ key: k }, VENDORS[k]);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
const api = { VENDORS, ACCELERATORS, OTHER_SKUS, INSTANCES, instanceOf, tpuTopology, match, byId, tdpOf, vendorKeyOf, vendor };
|
|
579
|
+
if (typeof module !== 'undefined' && module.exports) module.exports = api;
|
|
580
|
+
else root.AIInfraAccelerators = api;
|
|
581
|
+
})(typeof globalThis !== 'undefined' ? globalThis : this);
|
|
582
|
+
|
|
583
|
+
</script>
|
|
584
|
+
<script>
|
|
585
|
+
/* Inference Sizer catalog: GPUs and models, spec-sheet import/export, and Hugging Face config.json parsing.
|
|
586
|
+
Plain data plus validation, so the browser page, the CLI and FleetScope can share it. */
|
|
587
|
+
(function (root) {
|
|
588
|
+
'use strict';
|
|
589
|
+
|
|
590
|
+
// ---------- schemas ----------
|
|
591
|
+
// Every field a GPU or model entry may carry, with its unit, range and a one-line meaning.
|
|
592
|
+
// The UI builds its edit forms from these, and imports are checked against them.
|
|
593
|
+
const GPU_FIELDS = [
|
|
594
|
+
{ k: 'label', type: 'text', label: 'Name', required: true },
|
|
595
|
+
{ k: 'vendor', type: 'text', label: 'Vendor' },
|
|
596
|
+
{ k: 'hbmGB', label: 'HBM per GPU', unit: 'GB', min: 1, max: 4096, required: true, hint: 'Memory the GPU exposes (e.g. 180 for HGX B200).' },
|
|
597
|
+
{ k: 'hbmTBs', label: 'HBM bandwidth', unit: 'TB/s', min: 0.1, max: 100, required: true },
|
|
598
|
+
{ k: 'tfBf16', label: 'BF16 dense', unit: 'TFLOPS', min: 1, max: 1e6, required: true, hint: 'Dense, not the "with sparsity" figure.' },
|
|
599
|
+
{ k: 'tfFp8', label: 'FP8 dense', unit: 'TFLOPS', min: 0, max: 1e6, hint: '0 if the GPU has no FP8 tensor cores.' },
|
|
600
|
+
{ k: 'tfFp4', label: 'FP4 dense', unit: 'TFLOPS', min: 0, max: 1e6, hint: '0 if the GPU has no FP4 tensor cores.' },
|
|
601
|
+
{ k: 'scaleUpGBs', label: 'GPU-to-GPU link, per direction', unit: 'GB/s', min: 1, max: 1e5, required: true, hint: 'NVLink / Infinity Fabric. Half the bidirectional figure.' },
|
|
602
|
+
{ k: 'domain', label: 'GPUs per scale-up domain', unit: 'GPUs', min: 1, max: 576, required: true, hint: '8 for an HGX server, 72 for an NVL72 rack.' },
|
|
603
|
+
{ k: 'nicGbps', label: 'Scale-out NIC per GPU', unit: 'Gb/s', min: 1, max: 1e4, required: true },
|
|
604
|
+
{ k: 'nodeKW', label: 'Power per domain (max)', unit: 'kW', min: 0, max: 2000 },
|
|
605
|
+
{ k: 'price', label: 'Price', unit: '$/GPU-hr', min: 0, max: 1000, hint: 'Placeholder unless you set your own.' },
|
|
606
|
+
{ k: 'source', type: 'text', label: 'Spec sheet URL' },
|
|
607
|
+
];
|
|
608
|
+
const MODEL_FIELDS = [
|
|
609
|
+
{ k: 'name', type: 'text', label: 'Name', required: true },
|
|
610
|
+
{ k: 'total', label: 'Total params', unit: 'B', min: 0.01, max: 1e5, required: true },
|
|
611
|
+
{ k: 'active', label: 'Active params per token', unit: 'B', min: 0.01, max: 1e5, required: true },
|
|
612
|
+
{ k: 'layers', label: 'Layers', min: 1, max: 1000, int: true, required: true },
|
|
613
|
+
{ k: 'hidden', label: 'Hidden size', min: 64, max: 1e6, int: true, required: true },
|
|
614
|
+
{ k: 'qHeads', label: 'Query heads', min: 1, max: 4096, int: true, required: true },
|
|
615
|
+
{ k: 'kvHeads', label: 'KV heads', min: 1, max: 4096, int: true, required: true },
|
|
616
|
+
{ k: 'headDim', label: 'Head dim', min: 8, max: 4096, int: true, required: true },
|
|
617
|
+
{ k: 'attn', type: 'enum', opts: ['gqa', 'mla'], label: 'Attention', required: true },
|
|
618
|
+
{ k: 'mlaLatent', label: 'MLA KV latent (kv_lora_rank)', min: 1, max: 1e5, int: true },
|
|
619
|
+
{ k: 'mlaRope', label: 'MLA RoPE dim', min: 0, max: 1e4, int: true },
|
|
620
|
+
{ k: 'mlaNope', label: 'MLA QK no-PE dim', min: 0, max: 1e4, int: true },
|
|
621
|
+
{ k: 'mlaV', label: 'MLA V head dim', min: 1, max: 1e4, int: true },
|
|
622
|
+
{ k: 'experts', label: 'Routed experts (0 = dense)', min: 0, max: 1e5, int: true },
|
|
623
|
+
{ k: 'topk', label: 'Experts per token', min: 0, max: 1e4, int: true },
|
|
624
|
+
{ k: 'swaFrac', label: 'Share of sliding-window layers', min: 0, max: 1 },
|
|
625
|
+
{ k: 'swaWindow', label: 'Sliding window', unit: 'tokens', min: 0, max: 1e8, int: true },
|
|
626
|
+
{ 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.' },
|
|
627
|
+
{ 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).' },
|
|
628
|
+
{ 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.' },
|
|
629
|
+
{ 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.' },
|
|
630
|
+
{ k: 'maxCtx', label: 'Max context', unit: 'tokens', min: 256, max: 1e8, int: true, required: true },
|
|
631
|
+
{ k: 'wprec', type: 'enum', opts: ['bf16', 'fp8', 'fp4'], label: 'Default weight precision' },
|
|
632
|
+
{ k: 'source', type: 'text', label: 'Model card URL' },
|
|
633
|
+
];
|
|
634
|
+
|
|
635
|
+
// ---------- built-in GPUs ----------
|
|
636
|
+
// From the shared accelerator registry (accelerators.js): per-GPU dense figures, HGX/DGX system totals divided by 8
|
|
637
|
+
// (or 72 for NVL72), "with sparsity" figures halved. Prices are placeholder on-demand rents, not quotes.
|
|
638
|
+
const REG = (typeof module !== 'undefined' && module.exports) ? require('./accelerators.js') : root.AIInfraAccelerators;
|
|
639
|
+
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'];
|
|
640
|
+
const KEEP = ['id', 'kind', 'vendorKey', 'gkeAccelerator', 'tdpW'].concat(GPU_FIELDS.map(f => f.k)); // tdpW: board power, for tokens per MW
|
|
641
|
+
const GPUS = REG.ACCELERATORS.slice().sort((a, b) => (ORDER.indexOf(a.id) + 1 || 99) - (ORDER.indexOf(b.id) + 1 || 99))
|
|
642
|
+
.map(g => Object.fromEntries(KEEP.filter(k => g[k] !== undefined).map(k => [k, g[k]])));
|
|
643
|
+
|
|
644
|
+
// ---------- built-in models ----------
|
|
645
|
+
const MLA = { attn: 'mla', kvHeads: 1, headDim: 128, mlaLatent: 512, mlaRope: 64, mlaNope: 128, mlaV: 128 };
|
|
646
|
+
const G = { attn: 'gqa', experts: 0, topk: 0, swaFrac: 0, swaWindow: 0 };
|
|
647
|
+
const MODELS = [
|
|
648
|
+
Object.assign({ id: 'llama31-8b', name: 'Llama 3.1 8B', total: 8.03, active: 8.03, layers: 32, hidden: 4096, qHeads: 32, kvHeads: 8, headDim: 128, maxCtx: 131072, wprec: 'fp8', source: 'https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct' }, G),
|
|
649
|
+
Object.assign({ id: 'qwen3-32b', name: 'Qwen3 32B', total: 32.8, active: 32.8, layers: 64, hidden: 5120, qHeads: 64, kvHeads: 8, headDim: 128, maxCtx: 131072, wprec: 'fp8', source: 'https://huggingface.co/Qwen/Qwen3-32B' }, G),
|
|
650
|
+
Object.assign({ id: 'llama33-70b', name: 'Llama 3.3 70B', total: 70.6, active: 70.6, layers: 80, hidden: 8192, qHeads: 64, kvHeads: 8, headDim: 128, maxCtx: 131072, wprec: 'fp8', source: 'https://huggingface.co/meta-llama/Llama-3.3-70B-Instruct' }, G),
|
|
651
|
+
Object.assign({ id: 'qwen25-72b', name: 'Qwen2.5 72B', total: 72.7, active: 72.7, layers: 80, hidden: 8192, qHeads: 64, kvHeads: 8, headDim: 128, maxCtx: 131072, wprec: 'fp8', source: 'https://huggingface.co/Qwen/Qwen2.5-72B-Instruct' }, G),
|
|
652
|
+
Object.assign({ id: 'llama31-405b', name: 'Llama 3.1 405B', total: 405.9, active: 405.9, layers: 126, hidden: 16384, qHeads: 128, kvHeads: 8, headDim: 128, maxCtx: 131072, wprec: 'fp8', source: 'https://huggingface.co/meta-llama/Llama-3.1-405B-Instruct' }, G),
|
|
653
|
+
Object.assign({}, G, { id: 'gpt-oss-120b', name: 'gpt-oss-120b (MoE)', total: 116.8, active: 5.1, layers: 36, hidden: 2880, qHeads: 64, kvHeads: 8, headDim: 64, experts: 128, topk: 4, swaFrac: 0.5, swaWindow: 128, maxCtx: 131072, wprec: 'fp4', source: 'https://huggingface.co/openai/gpt-oss-120b' }),
|
|
654
|
+
Object.assign({}, G, { id: 'mixtral-8x22b', name: 'Mixtral 8x22B (MoE)', total: 141, active: 39, layers: 56, hidden: 6144, qHeads: 48, kvHeads: 8, headDim: 128, experts: 8, topk: 2, maxCtx: 65536, wprec: 'fp8', source: 'https://huggingface.co/mistralai/Mixtral-8x22B-Instruct-v0.1' }),
|
|
655
|
+
Object.assign({}, G, { id: 'qwen3-235b', name: 'Qwen3 235B-A22B (MoE)', total: 235, active: 22, layers: 94, hidden: 4096, qHeads: 64, kvHeads: 4, headDim: 128, experts: 128, topk: 8, maxCtx: 131072, wprec: 'fp8', source: 'https://huggingface.co/Qwen/Qwen3-235B-A22B' }),
|
|
656
|
+
Object.assign({}, G, { id: 'llama4-maverick', name: 'Llama 4 Maverick 400B (MoE)', total: 400, active: 17, layers: 48, hidden: 5120, qHeads: 40, kvHeads: 8, headDim: 128, experts: 128, topk: 1, swaFrac: 0.75, swaWindow: 8192, maxCtx: 1048576, wprec: 'fp8', source: 'https://huggingface.co/meta-llama/Llama-4-Maverick-17B-128E-Instruct' }),
|
|
657
|
+
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' }),
|
|
658
|
+
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' }),
|
|
659
|
+
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' }),
|
|
660
|
+
// ---- 2026 open-weight models (config.json values; see docs/CATALOG.md for where each figure comes from) ----
|
|
661
|
+
// Kimi K3 (K3.1 Pro shares the architecture): 69 Kimi Delta Attention layers (96 heads × 128 × 128 fp32 state) and
|
|
662
|
+
// 24 gated MLA layers; MXFP4 weights from quantization-aware training.
|
|
663
|
+
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' }),
|
|
664
|
+
// Kimi K2.5 / K2.6: K2's shape with 256K context and native INT4 weights (sized as 4-bit)
|
|
665
|
+
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' }),
|
|
666
|
+
// DeepSeek V4: one 512-wide latent per token, kept at 1/4 (CSA) or 1/128 (HCA) on alternating layers (≈ 0.129 on
|
|
667
|
+
// average); CSA attends its index top-1024, HCA all compressed blocks: modelled as 2048 attended tokens per query.
|
|
668
|
+
// Experts in FP4, the rest FP8.
|
|
669
|
+
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' }),
|
|
670
|
+
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' }),
|
|
671
|
+
// GLM-5.1 and GLM-5.3: MLA with DeepSeek-style sparse attention (index top-2048); GLM-5.3 extends the context to 1M.
|
|
672
|
+
// GLM-5.3's active parameters are not published: the GLM-5 lineage's 40B is assumed.
|
|
673
|
+
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' }),
|
|
674
|
+
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' }),
|
|
675
|
+
// Mistral Large 4: MLA with sparse token selection (top-2048); nope/v head dims not published (DeepSeek's 128 assumed)
|
|
676
|
+
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' }),
|
|
677
|
+
// Qwen3.5-397B and Qwen3.8 27B: three Gated DeltaNet layers per gated-attention layer (64 / 48 value heads × 128 × 128 fp32 state)
|
|
678
|
+
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' }),
|
|
679
|
+
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' }),
|
|
680
|
+
// MiniMax M3: sparse attention (16 blocks of 128 tokens) in 57 of 60 layers, modelled on all of them
|
|
681
|
+
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' }),
|
|
682
|
+
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' }),
|
|
683
|
+
// Muse Spark Open: 46 sliding-window layers (2048 tokens) and 16 full-attention layers
|
|
684
|
+
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' }),
|
|
685
|
+
// Gemma 4 31B: 50 sliding-window layers (1024 tokens) and 10 global layers with 4 KV heads of 512 and keys reused as
|
|
686
|
+
// 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.
|
|
687
|
+
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' }),
|
|
688
|
+
];
|
|
689
|
+
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' };
|
|
690
|
+
const GPU_DEFAULTS = { tfFp8: 0, tfFp4: 0, nodeKW: 0, price: 0, vendor: '' };
|
|
691
|
+
|
|
692
|
+
// ---------- validation ----------
|
|
693
|
+
const slug = s => String(s || '').toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '').slice(0, 60) || 'item';
|
|
694
|
+
function check(entry, fields, defaults, kind) {
|
|
695
|
+
const errors = [];
|
|
696
|
+
if (!entry || typeof entry !== 'object' || Array.isArray(entry)) return { ok: false, errors: [kind + ' entry must be an object.'] };
|
|
697
|
+
const out = Object.assign({}, defaults);
|
|
698
|
+
const nameKey = kind === 'GPU' ? 'label' : 'name';
|
|
699
|
+
out.id = entry.id ? String(entry.id).replace(/[^A-Za-z0-9._-]+/g, '-').slice(0, 60) : slug(entry[nameKey]);
|
|
700
|
+
for (const f of fields) {
|
|
701
|
+
let v = entry[f.k];
|
|
702
|
+
if (v === undefined || v === null || v === '') {
|
|
703
|
+
if (f.required) errors.push(`${kind} "${entry[nameKey] || entry.id || '?'}": missing ${f.label} (${f.k}).`);
|
|
704
|
+
continue;
|
|
705
|
+
}
|
|
706
|
+
if (f.type === 'text') { out[f.k] = String(v).slice(0, 300); continue; }
|
|
707
|
+
if (f.type === 'enum') {
|
|
708
|
+
v = String(v).toLowerCase();
|
|
709
|
+
if (!f.opts.includes(v)) { errors.push(`${kind} "${entry[nameKey] || out.id}": ${f.k} must be one of ${f.opts.join(', ')}.`); continue; }
|
|
710
|
+
out[f.k] = v; continue;
|
|
711
|
+
}
|
|
712
|
+
v = Number(v);
|
|
713
|
+
if (!isFinite(v)) { errors.push(`${kind} "${entry[nameKey] || out.id}": ${f.k} must be a number.`); continue; }
|
|
714
|
+
if (f.int) v = Math.round(v);
|
|
715
|
+
if (v < f.min || v > f.max) { errors.push(`${kind} "${entry[nameKey] || out.id}": ${f.k} = ${v} is outside ${f.min}–${f.max}${f.unit ? ' ' + f.unit : ''}.`); continue; }
|
|
716
|
+
out[f.k] = v;
|
|
717
|
+
}
|
|
718
|
+
if (kind === 'Model' && out.active > out.total) errors.push(`Model "${out.name}": active params (${out.active}B) exceed total (${out.total}B).`);
|
|
719
|
+
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.`);
|
|
720
|
+
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}.`);
|
|
721
|
+
if (kind === 'Model' && out.experts > 0 && out.active >= out.total) errors.push(`Model "${out.name}": an MoE model needs active params below total params.`);
|
|
722
|
+
return { ok: errors.length === 0, errors, value: out };
|
|
723
|
+
}
|
|
724
|
+
const validateGPU = g => check(g, GPU_FIELDS, GPU_DEFAULTS, 'GPU');
|
|
725
|
+
const validateModel = m => check(m, MODEL_FIELDS, MODEL_DEFAULTS, 'Model');
|
|
726
|
+
|
|
727
|
+
// ---------- spec sheets ----------
|
|
728
|
+
// A spec sheet is JSON: { "kind": "inference-sizer/catalog", "version": 1, "gpus": [...], "models": [...] }.
|
|
729
|
+
// An entry whose id matches a built-in one replaces it ("update via spec sheet"); new ids are added.
|
|
730
|
+
// A single GPU or model object, or a Hugging Face config.json, is also accepted.
|
|
731
|
+
const SHEET_KIND = 'inference-sizer/catalog';
|
|
732
|
+
function parseSheet(text) {
|
|
733
|
+
let j;
|
|
734
|
+
try { j = typeof text === 'string' ? JSON.parse(text) : text; } catch (e) { return { ok: false, errors: ['Not valid JSON: ' + e.message], gpus: [], models: [] }; }
|
|
735
|
+
const res = { ok: true, errors: [], gpus: [], models: [], notes: [] };
|
|
736
|
+
if (!j || typeof j !== 'object') return { ok: false, errors: ['Expected a JSON object.'], gpus: [], models: [] };
|
|
737
|
+
let gpus = [], models = [];
|
|
738
|
+
if (Array.isArray(j.gpus) || Array.isArray(j.models)) { gpus = j.gpus || []; models = j.models || []; }
|
|
739
|
+
else if (isHFConfig(j)) { const m = fromHFConfig(j); models = [m.model]; res.notes.push(...m.notes); }
|
|
740
|
+
else if ('hbmGB' in j || 'tfBf16' in j) gpus = [j];
|
|
741
|
+
else if ('layers' in j || 'qHeads' in j) models = [j];
|
|
742
|
+
else return { ok: false, errors: ['Could not recognise this file. Use a spec sheet with "gpus" and/or "models" arrays, a single GPU or model entry, or a Hugging Face config.json.'], gpus: [], models: [] };
|
|
743
|
+
for (const g of gpus) { const r = validateGPU(g); if (r.ok) res.gpus.push(r.value); else res.errors.push(...r.errors); }
|
|
744
|
+
for (const m of models) { const r = validateModel(m); if (r.ok) res.models.push(r.value); else res.errors.push(...r.errors); }
|
|
745
|
+
res.ok = res.errors.length === 0 && (res.gpus.length + res.models.length) > 0;
|
|
746
|
+
if (!res.gpus.length && !res.models.length && !res.errors.length) { res.ok = false; res.errors.push('The file holds no GPUs or models.'); }
|
|
747
|
+
return res;
|
|
748
|
+
}
|
|
749
|
+
function makeSheet(gpus, models) {
|
|
750
|
+
const strip = o => { const c = Object.assign({}, o); delete c.builtin; delete c.custom; return c; };
|
|
751
|
+
return { kind: SHEET_KIND, version: 1, gpus: (gpus || []).map(strip), models: (models || []).map(strip) };
|
|
752
|
+
}
|
|
753
|
+
// Built-ins overlaid with user entries (same id replaces).
|
|
754
|
+
function merge(builtin, custom) {
|
|
755
|
+
const out = builtin.map(x => Object.assign({ builtin: true }, x));
|
|
756
|
+
for (const c of custom || []) {
|
|
757
|
+
const i = out.findIndex(x => x.id === c.id);
|
|
758
|
+
const e = Object.assign({ custom: true }, c);
|
|
759
|
+
if (i >= 0) out[i] = Object.assign(e, { overrides: true }); else out.push(e);
|
|
760
|
+
}
|
|
761
|
+
return out;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
// ---------- Hugging Face config.json ----------
|
|
765
|
+
function isHFConfig(j) {
|
|
766
|
+
const c = j.text_config || j;
|
|
767
|
+
return ('num_hidden_layers' in c || 'n_layer' in c) && ('hidden_size' in c || 'n_embd' in c || 'd_model' in c);
|
|
768
|
+
}
|
|
769
|
+
const first = (o, keys, d) => { for (const k of keys) if (o[k] !== undefined && o[k] !== null) return o[k]; return d; };
|
|
770
|
+
// Reads architecture fields and estimates parameter counts from the layer shapes (embeddings, attention, MLP/experts).
|
|
771
|
+
function fromHFConfig(j) {
|
|
772
|
+
const notes = [];
|
|
773
|
+
const c = j.text_config ? Object.assign({}, j.text_config) : j;
|
|
774
|
+
if (j.text_config) notes.push('Read the text model from text_config.');
|
|
775
|
+
const layers = +first(c, ['num_hidden_layers', 'n_layer', 'num_layers']);
|
|
776
|
+
const hidden = +first(c, ['hidden_size', 'n_embd', 'd_model']);
|
|
777
|
+
const qHeads = +first(c, ['num_attention_heads', 'n_head', 'num_heads']);
|
|
778
|
+
let kvHeads = +first(c, ['num_key_value_heads', 'num_kv_heads', 'n_head_kv'], c.multi_query ? 1 : qHeads);
|
|
779
|
+
const headDim = +first(c, ['head_dim'], Math.round(hidden / qHeads));
|
|
780
|
+
const V = +first(c, ['vocab_size', 'padded_vocab_size'], 32000);
|
|
781
|
+
const inter = +first(c, ['intermediate_size', 'ffn_hidden_size', 'n_inner'], 4 * hidden);
|
|
782
|
+
const experts = +first(c, ['num_local_experts', 'n_routed_experts', 'num_experts', 'moe_num_experts'], 0) || 0;
|
|
783
|
+
const topk = experts ? +first(c, ['num_experts_per_tok', 'experts_per_token', 'moe_top_k', 'num_experts_per_token', 'top_k'], 2) : 0;
|
|
784
|
+
const moeInter = +first(c, ['moe_intermediate_size', 'expert_intermediate_size'], inter);
|
|
785
|
+
const denseInter = +first(c, ['intermediate_size_mlp'], inter);
|
|
786
|
+
const mla = c.kv_lora_rank != null;
|
|
787
|
+
const mlaLatent = mla ? +c.kv_lora_rank : 512, mlaRope = mla ? +first(c, ['qk_rope_head_dim'], 64) : 64;
|
|
788
|
+
const mlaNope = mla ? +first(c, ['qk_nope_head_dim'], 128) : 128, mlaV = mla ? +first(c, ['v_head_dim'], 128) : 128;
|
|
789
|
+
if (mla) kvHeads = 1;
|
|
790
|
+
// sliding window
|
|
791
|
+
let swaFrac = 0, swaWindow = 0;
|
|
792
|
+
if (Array.isArray(c.layer_types) && c.sliding_window) {
|
|
793
|
+
const n = c.layer_types.filter(t => /slid/i.test(String(t))).length;
|
|
794
|
+
swaFrac = +(n / c.layer_types.length).toFixed(3); swaWindow = +c.sliding_window;
|
|
795
|
+
} else if (c.sliding_window && c.use_sliding_window === true) { swaFrac = 1; swaWindow = +c.sliding_window; }
|
|
796
|
+
else if (c.attention_chunk_size && c.no_rope_layers) {
|
|
797
|
+
const n = c.no_rope_layers.filter(x => x).length;
|
|
798
|
+
swaFrac = +(n / c.no_rope_layers.length).toFixed(3); swaWindow = +c.attention_chunk_size;
|
|
799
|
+
notes.push('Chunked-attention layers modelled as sliding-window layers.');
|
|
800
|
+
}
|
|
801
|
+
if (c.sliding_window && !swaFrac) notes.push('sliding_window is set but not enabled for these layers; KV is sized for full attention.');
|
|
802
|
+
// linear-attention layers (Qwen3-Next / Qwen3.5 Gated DeltaNet: layer_types "linear_attention" or full_attention_interval)
|
|
803
|
+
let linFrac = 0, linStateMB = 0;
|
|
804
|
+
const linN = Array.isArray(c.layer_types) ? c.layer_types.filter(t => /linear/i.test(String(t))).length
|
|
805
|
+
: c.full_attention_interval > 1 ? layers - Math.floor(layers / c.full_attention_interval) : 0;
|
|
806
|
+
if (linN) {
|
|
807
|
+
linFrac = +(linN / layers).toFixed(4);
|
|
808
|
+
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);
|
|
809
|
+
linStateMB = +(vh * kd * vd * 4 / 1e6).toFixed(3);
|
|
810
|
+
notes.push(`${linN} linear-attention layers: a ${linStateMB} MB state per layer per sequence (fp32), no KV per token.`);
|
|
811
|
+
}
|
|
812
|
+
// sparse attention: an index picks the tokens each query attends (DeepSeek Sparse Attention and its descendants)
|
|
813
|
+
const sparseTopK = c.index_topk ? +c.index_topk : 0;
|
|
814
|
+
if (sparseTopK) notes.push(`Sparse attention: each query attends ${sparseTopK} selected tokens.`);
|
|
815
|
+
// context
|
|
816
|
+
let maxCtx = +first(c, ['max_position_embeddings', 'n_positions', 'seq_length', 'max_sequence_length'], 4096);
|
|
817
|
+
const rs = c.rope_scaling;
|
|
818
|
+
if (rs && rs.factor && rs.original_max_position_embeddings) maxCtx = Math.max(maxCtx, Math.round(rs.factor * rs.original_max_position_embeddings));
|
|
819
|
+
// which layers are MoE
|
|
820
|
+
let moeLayers = experts ? layers : 0;
|
|
821
|
+
if (experts && c.first_k_dense_replace != null) moeLayers = layers - c.first_k_dense_replace;
|
|
822
|
+
if (experts && c.interleave_moe_layer_step > 1) moeLayers = Math.floor(layers / c.interleave_moe_layer_step);
|
|
823
|
+
if (experts && c.decoder_sparse_step > 1) moeLayers = Math.floor(layers / c.decoder_sparse_step);
|
|
824
|
+
if (experts && Array.isArray(c.mlp_only_layers)) moeLayers -= c.mlp_only_layers.length;
|
|
825
|
+
if (experts && Array.isArray(c.moe_layers)) moeLayers = c.moe_layers.length;
|
|
826
|
+
const denseLayers = layers - moeLayers;
|
|
827
|
+
// attention params per layer
|
|
828
|
+
let attnP;
|
|
829
|
+
if (mla) {
|
|
830
|
+
const qk = mlaNope + mlaRope;
|
|
831
|
+
const qP = c.q_lora_rank ? hidden * c.q_lora_rank + c.q_lora_rank * qHeads * qk : hidden * qHeads * qk;
|
|
832
|
+
attnP = qP + hidden * (mlaLatent + mlaRope) + mlaLatent * qHeads * (mlaNope + mlaV) + qHeads * mlaV * hidden;
|
|
833
|
+
} else attnP = hidden * qHeads * headDim * 2 + hidden * kvHeads * headDim * 2;
|
|
834
|
+
const gated = !(c.hidden_act === 'gelu' && /gpt2|bloom|opt/.test(c.model_type || ''));
|
|
835
|
+
const mlp = n => (gated ? 3 : 2) * hidden * n;
|
|
836
|
+
const sharedN = +first(c, ['n_shared_experts', 'num_shared_experts'], 0) || 0;
|
|
837
|
+
const sharedInter = c.shared_expert_intermediate_size ? +c.shared_expert_intermediate_size : sharedN * moeInter;
|
|
838
|
+
const llama4Shared = /llama4/.test(c.model_type || '') && experts ? mlp(moeInter) : 0;
|
|
839
|
+
const expertP = mlp(moeInter);
|
|
840
|
+
const tied = j.tie_word_embeddings === true || c.tie_word_embeddings === true;
|
|
841
|
+
const emb = V * hidden * (tied ? 1 : 2);
|
|
842
|
+
const perMoE = experts * expertP + (sharedInter ? mlp(sharedInter) : 0) + llama4Shared + hidden * experts;
|
|
843
|
+
const total = emb + layers * attnP + denseLayers * mlp(denseInter) + moeLayers * perMoE;
|
|
844
|
+
const active = total - moeLayers * (experts - topk) * expertP;
|
|
845
|
+
notes.push('Parameter counts are estimated from layer shapes; check them against the model card.');
|
|
846
|
+
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');
|
|
847
|
+
const model = {
|
|
848
|
+
name, total: +(total / 1e9).toFixed(2), active: +(active / 1e9).toFixed(2), layers, hidden, qHeads, kvHeads, headDim,
|
|
849
|
+
attn: mla ? 'mla' : 'gqa', mlaLatent, mlaRope, mlaNope, mlaV, experts, topk, swaFrac, swaWindow, linFrac, linStateMB, sparseTopK, maxCtx,
|
|
850
|
+
wprec: /fp8|float8/i.test(JSON.stringify(j.quantization_config || '')) ? 'fp8' : /mxfp4|nvfp4|fp4/i.test(JSON.stringify(j.quantization_config || '')) ? 'fp4' : 'fp8',
|
|
851
|
+
};
|
|
852
|
+
return { model, notes };
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
const api = { GPU_FIELDS, MODEL_FIELDS, GPUS, MODELS, MODEL_DEFAULTS, GPU_DEFAULTS, SHEET_KIND, validateGPU, validateModel, parseSheet, makeSheet, merge, fromHFConfig, isHFConfig, slug };
|
|
856
|
+
if (typeof module !== 'undefined' && module.exports) module.exports = api; else root.SizerCatalog = api;
|
|
857
|
+
})(this);
|
|
858
|
+
|
|
859
|
+
</script>
|
|
860
|
+
<script>
|
|
861
|
+
/* Inference Sizer model: how many GPUs, in what layout, serve a model at TTFT/TPOT targets.
|
|
862
|
+
First-order roofline per layout, M/D/1 queueing for prefill, disaggregated vs aggregated serving.
|
|
863
|
+
Pure functions over one flat input object `s` (model + GPU + traffic + targets + assumptions). See docs/METHOD.md. */
|
|
864
|
+
(function (root) {
|
|
865
|
+
'use strict';
|
|
866
|
+
|
|
867
|
+
// Engine and traffic defaults. Model and GPU fields come from the catalog entry the user picks.
|
|
868
|
+
const SETTINGS = {
|
|
869
|
+
kvprec: 'fp8', ctx: 32768,
|
|
870
|
+
conc: 500, dau: 50000, rpu: 20, peakFactor: 3, concSource: 'max',
|
|
871
|
+
avgIn: 2000, peakIn: 16000, avgOut: 400, peakOut: 2000,
|
|
872
|
+
ttft: 1000, tpot: 30,
|
|
873
|
+
mode: 'auto', kvPolicy: 'paged', prefixHit: 0,
|
|
874
|
+
memUtil: 0.9, reserveGB: 8,
|
|
875
|
+
effPrefill: 0.40, effDecodeBW: 0.65, effDecodeComp: 0.30, stepMs: 1.5,
|
|
876
|
+
maxSeqPerGPU: 256, headroom: 15, nPlus1: true, kvMaxUtil: 0.9, sloMargin: 10,
|
|
877
|
+
};
|
|
878
|
+
|
|
879
|
+
function derive(s) {
|
|
880
|
+
const bpp = { bf16: 2, fp8: 1.0, fp4: 0.5625 }[s.wprec] || 1;
|
|
881
|
+
const kvb = { bf16: 2, fp8: 1 }[s.kvprec] || 1;
|
|
882
|
+
const isMoE = s.experts > 0 && s.topk > 0 && s.topk < s.experts && s.active < s.total;
|
|
883
|
+
let Eall = 0, dense = s.total;
|
|
884
|
+
if (isMoE) { Eall = Math.min((s.total - s.active) / (1 - s.topk / s.experts), s.total * 0.98); dense = s.total - Eall; }
|
|
885
|
+
const mla = s.attn === 'mla';
|
|
886
|
+
const lat = s.mlaLatent || 512, rope = s.mlaRope == null ? 64 : s.mlaRope, nope = s.mlaNope == null ? 128 : s.mlaNope, vh = s.mlaV || 128;
|
|
887
|
+
const swaLayers = s.swaWindow > 0 ? Math.round(s.layers * (s.swaFrac || 0)) : 0;
|
|
888
|
+
// linear-attention layers (Kimi Delta Attention, Gated DeltaNet): a fixed recurrent state per sequence, no KV per token
|
|
889
|
+
const linLayers = s.linFrac > 0 ? Math.min(s.layers - swaLayers, Math.round(s.layers * s.linFrac)) : 0;
|
|
890
|
+
const linState = linLayers * (s.linStateMB || 0) * 1e6;
|
|
891
|
+
// compressed attention keeps the KV of a share of the tokens (DeepSeek V4: 1/4 or 1/128 per layer); sparse attention
|
|
892
|
+
// (DSA, CSA, MSA) attends a fixed number of selected tokens per query instead of all of them
|
|
893
|
+
const keep = s.kvKeep > 0 && s.kvKeep < 1 ? s.kvKeep : 1, topK = s.sparseTopK > 0 ? s.sparseTopK : 0;
|
|
894
|
+
// tensor-core rate for the weight precision; fall back when the GPU lacks that precision
|
|
895
|
+
const tf = { bf16: s.tfBf16, fp8: s.tfFp8 || s.tfBf16, fp4: s.tfFp4 || s.tfFp8 || s.tfBf16 }[s.wprec] || s.tfBf16;
|
|
896
|
+
const computeFallback = (s.wprec === 'fp4' && !s.tfFp4) ? (s.tfFp8 ? 'fp8' : 'bf16') : (s.wprec === 'fp8' && !s.tfFp8) ? 'bf16' : null;
|
|
897
|
+
return {
|
|
898
|
+
bpp, kvb, isMoE, mla, computeFallback,
|
|
899
|
+
Wd: dense * 1e9 * bpp, We: Eall * 1e9 * bpp,
|
|
900
|
+
denseP: dense * 1e9, activeP: (isMoE ? s.active : s.total) * 1e9,
|
|
901
|
+
kvTokLayer: mla ? (lat + rope) * kvb : 2 * s.kvHeads * s.headDim * kvb,
|
|
902
|
+
swaLayers, linLayers, fullLayers: s.layers - swaLayers - linLayers, win: s.swaWindow || 0, keep, topK, linState,
|
|
903
|
+
// FLOPs per token per linear-attention layer: read and update the state (fp32, 4 bytes an element), ~4 FLOPs an element
|
|
904
|
+
Alin: (s.linStateMB || 0) * 1e6,
|
|
905
|
+
// attention FLOPs per (query token, context token) per layer
|
|
906
|
+
Apre: mla ? s.qHeads * (2 * (nope + rope) + 2 * vh) : 4 * s.qHeads * s.headDim,
|
|
907
|
+
Adec: mla ? s.qHeads * (2 * (lat + rope) + 2 * lat) : 4 * s.qHeads * s.headDim,
|
|
908
|
+
Fw: tf * 1e12, Fa: s.tfBf16 * 1e12,
|
|
909
|
+
BW: s.hbmTBs * 1e12, nvl: s.scaleUpGBs * 1e9 * 0.8, nic: s.nicGbps / 8 * 1e9 * 0.8,
|
|
910
|
+
hbm: s.hbmGB * 1e9 * s.memUtil, reserve: s.reserveGB * 1e9,
|
|
911
|
+
D: Math.max(1, Math.round(s.domain || 8)),
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
// KV bytes one sequence of L tokens holds: full-attention layers keep (a share of) every token, sliding-window layers
|
|
916
|
+
// the last W, linear-attention layers a fixed state
|
|
917
|
+
function kvBytes(md, L) {
|
|
918
|
+
const w = md.win || L, keep = md.keep || 1;
|
|
919
|
+
return md.kvTokLayer * (md.fullLayers * L * keep + md.swaLayers * Math.min(L, w)) + (md.linState || 0);
|
|
920
|
+
}
|
|
921
|
+
// context tokens one query attends in a full-attention layer, and its integral over query positions 0..x
|
|
922
|
+
const attended = (md, L) => { const n = L * (md.keep || 1); return md.topK ? Math.min(n, md.topK) : n; };
|
|
923
|
+
function attendedSum(md, x) {
|
|
924
|
+
const k = md.keep || 1;
|
|
925
|
+
if (!md.topK) return k * x * x / 2;
|
|
926
|
+
const t = md.topK / k;
|
|
927
|
+
return x <= t ? k * x * x / 2 : k * t * t / 2 + md.topK * (x - t);
|
|
928
|
+
}
|
|
929
|
+
function attnPre(md, Lc, L) {
|
|
930
|
+
const W = md.win;
|
|
931
|
+
const g = x => x <= W ? x * x / 2 : W * W / 2 + W * (x - W);
|
|
932
|
+
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);
|
|
933
|
+
}
|
|
934
|
+
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); }
|
|
935
|
+
|
|
936
|
+
// ---------- parallel layouts ----------
|
|
937
|
+
// Instances of g GPUs. Inside one scale-up domain (D GPUs): TP, or TP+EP for MoE, or DP-attention+EP for MLA.
|
|
938
|
+
// Larger than a domain: dense models pipeline across domains (TP=D × PP), MoE models use wide EP.
|
|
939
|
+
function configs(s, md) {
|
|
940
|
+
const out = [], D = md.D;
|
|
941
|
+
for (const g of [1, 2, 4, 8, 16, 32, 64]) {
|
|
942
|
+
const inDomain = g <= D;
|
|
943
|
+
if (!inDomain && g % D !== 0) continue;
|
|
944
|
+
let kind;
|
|
945
|
+
if (!md.isMoE) { if (g > 32 && !inDomain) continue; kind = inDomain ? 'TP' : 'TPPP'; }
|
|
946
|
+
else if (md.mla) kind = 'DPEP';
|
|
947
|
+
else kind = inDomain ? 'TPEP' : 'DPEP';
|
|
948
|
+
out.push({ g, kind, pp: kind === 'TPPP' ? g / D : 1, tpl: kind === 'TPPP' ? D : g });
|
|
949
|
+
}
|
|
950
|
+
return out;
|
|
951
|
+
}
|
|
952
|
+
function decodeLabel(c) {
|
|
953
|
+
if (c.g === 1) return '1 GPU';
|
|
954
|
+
if (c.kind === 'TP') return 'TP' + c.g;
|
|
955
|
+
if (c.kind === 'TPPP') return 'TP' + c.tpl + ' × PP' + c.pp;
|
|
956
|
+
if (c.kind === 'TPEP') return 'TP' + c.g + ' · EP' + c.g;
|
|
957
|
+
return 'DP' + c.g + ' attn · EP' + c.g;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
// ---------- memory (decode-side layout) ----------
|
|
961
|
+
function memInfo(s, md, c) {
|
|
962
|
+
let wGPU, rep, cap, single;
|
|
963
|
+
if (c.kind === 'DPEP') { wGPU = md.Wd + md.We / c.g; rep = 1; }
|
|
964
|
+
else { wGPU = (md.Wd + md.We) / c.g; rep = md.mla ? c.tpl : Math.max(1, c.tpl / s.kvHeads); }
|
|
965
|
+
const avail = md.hbm - md.reserve - wGPU;
|
|
966
|
+
if (c.kind === 'DPEP') { cap = avail * c.g; single = avail; }
|
|
967
|
+
else { cap = avail * c.g / rep; single = cap; }
|
|
968
|
+
const ctxBytes = kvBytes(md, s.ctx);
|
|
969
|
+
const perSeq = s.kvPolicy === 'reserve' ? ctxBytes : kvBytes(md, Math.min(s.ctx, s.avgIn + s.avgOut)) * 1.1;
|
|
970
|
+
const fitsW = avail > 2e9;
|
|
971
|
+
const fitsCtx = fitsW && single >= ctxBytes;
|
|
972
|
+
const Bmem = fitsW ? Math.floor(cap * (s.kvMaxUtil || 1) / perSeq) : 0;
|
|
973
|
+
return { wGPU, rep, avail, cap, single, ctxBytes, perSeq, fitsW, fitsCtx, Bmem };
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
function allreduce(s, md, tp, tokens) {
|
|
977
|
+
if (tp <= 1) return 0;
|
|
978
|
+
const bw = tp <= md.D ? md.nvl : md.nic;
|
|
979
|
+
return 2 * s.layers * (8e-6 + 2 * (tp - 1) / tp * tokens * s.hidden * 2 / bw);
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
// One decode step with B sequences (per micro-batch when pipelined).
|
|
983
|
+
function decodeStep(s, md, c, B) {
|
|
984
|
+
const L = Math.min(s.ctx, s.avgIn + s.avgOut / 2);
|
|
985
|
+
const kvL = kvBytes(md, L);
|
|
986
|
+
const frac = md.isMoE ? 1 - Math.pow(1 - s.topk / s.experts, B) : 1;
|
|
987
|
+
const linF = 2 * md.activeP * B, atF = B * attnDec(md, L);
|
|
988
|
+
let bytes, gl = c.g, comm = 0;
|
|
989
|
+
if (c.kind === 'DPEP') {
|
|
990
|
+
const imb = c.g > 1 ? 1.15 : 1;
|
|
991
|
+
bytes = md.Wd + md.We * frac / c.g * imb + (B / c.g) * kvL;
|
|
992
|
+
const tok = (B / c.g) * s.topk * s.hidden * 1.5;
|
|
993
|
+
if (c.g > 1) comm = c.g <= md.D ? 2 * s.layers * (10e-6 + tok / md.nvl) : 2 * s.layers * (25e-6 + tok / md.nic) * 0.6;
|
|
994
|
+
} else {
|
|
995
|
+
const rep = md.mla ? c.tpl : Math.max(1, c.tpl / s.kvHeads);
|
|
996
|
+
gl = c.tpl;
|
|
997
|
+
bytes = (md.Wd + md.We * frac) / gl + B * kvL * rep / gl;
|
|
998
|
+
comm = allreduce(s, md, gl, B) * (c.kind === 'TPEP' ? 1.3 : 1);
|
|
999
|
+
if (c.kind === 'TPPP') comm += (c.pp - 1) * (15e-6 + B * s.hidden * 2 / md.nic);
|
|
1000
|
+
}
|
|
1001
|
+
const tm = bytes / (md.BW * s.effDecodeBW);
|
|
1002
|
+
const tc = linF / gl / (md.Fw * s.effDecodeComp) + atF / gl / (md.Fa * s.effDecodeComp);
|
|
1003
|
+
const ovh = s.stepMs / 1000;
|
|
1004
|
+
return { t: Math.max(tm, tc) + comm + ovh, tm, tc, comm, ovh, bytes, bound: tm >= tc ? 'memory' : 'compute' };
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
function decodeCap(s, md, c, mi) {
|
|
1008
|
+
return Math.max(0, Math.min(Math.floor(mi.Bmem / c.pp), s.maxSeqPerGPU * c.tpl));
|
|
1009
|
+
}
|
|
1010
|
+
// Largest per-micro-batch B whose step time stays within the TPOT target.
|
|
1011
|
+
function bmax(s, md, c, mi, tpotS) {
|
|
1012
|
+
const cap = decodeCap(s, md, c, mi);
|
|
1013
|
+
if (cap < 1) return { B: 0, limit: 'memory' };
|
|
1014
|
+
if (decodeStep(s, md, c, 1).t > tpotS) return { B: 0, limit: 'latency' };
|
|
1015
|
+
if (decodeStep(s, md, c, cap).t <= tpotS) return { B: cap, limit: cap === Math.floor(mi.Bmem / c.pp) ? 'kv-memory' : 'seq-cap' };
|
|
1016
|
+
let lo = 1, hi = cap;
|
|
1017
|
+
while (hi - lo > 1) { const mid = (lo + hi) >> 1; if (decodeStep(s, md, c, mid).t <= tpotS) lo = mid; else hi = mid; }
|
|
1018
|
+
return { B: lo, limit: 'tpot' };
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
// ---------- prefill: TP inside a domain, context parallel (CP) across domains, EP for MoE ----------
|
|
1022
|
+
function preCfg(md, c) { const tp = Math.min(c.g, md.D); return { g: c.g, tp, cp: Math.max(1, Math.round(c.g / tp)) }; }
|
|
1023
|
+
function prefillLabel(c, md) {
|
|
1024
|
+
const p = preCfg(md, c);
|
|
1025
|
+
let l = p.g === 1 ? '1 GPU' : 'TP' + p.tp + (p.cp > 1 ? ' × CP' + p.cp : '');
|
|
1026
|
+
if (md.isMoE && p.g > 1) l += ' · EP' + p.g;
|
|
1027
|
+
return l;
|
|
1028
|
+
}
|
|
1029
|
+
function prefillTime(s, md, c, Lnew, Lc, n) {
|
|
1030
|
+
const p = preCfg(md, c);
|
|
1031
|
+
const lin = 2 * md.activeP * Lnew * n;
|
|
1032
|
+
const at = n * attnPre(md, Lc, Lc + Lnew);
|
|
1033
|
+
const par = p.cp > 1 ? 0.85 : 1;
|
|
1034
|
+
const tc = lin / p.g / (md.Fw * s.effPrefill * par) + at / p.g / (md.Fa * s.effPrefill * par);
|
|
1035
|
+
const tm = (md.Wd / p.tp + md.We / p.g) / (md.BW * s.effDecodeBW);
|
|
1036
|
+
const tokens = Lnew * n;
|
|
1037
|
+
let comm = allreduce(s, md, p.tp, tokens / p.cp) * 0.5;
|
|
1038
|
+
if (md.isMoE && p.g > 1) comm += 2 * s.layers * (10e-6 + tokens / p.g * s.topk * s.hidden * 1.5 / (p.g > md.D ? md.nic : md.nvl)) * 0.5;
|
|
1039
|
+
if (p.cp > 1) comm += (kvBytes(md, Lc + Lnew) * n * (p.cp - 1) / p.cp / (p.tp * md.nic) + s.layers * 20e-6) * 0.5;
|
|
1040
|
+
return Math.max(tc, tm) + comm + 0.004;
|
|
1041
|
+
}
|
|
1042
|
+
function prefillStats(s, md, c) {
|
|
1043
|
+
const hit = s.prefixHit / 100;
|
|
1044
|
+
const aIn = Math.min(s.avgIn, s.ctx), pIn = Math.min(s.peakIn, s.ctx);
|
|
1045
|
+
const Lavg = Math.max(1, aIn * (1 - hit)), LcA = aIn * hit;
|
|
1046
|
+
const Lpk = Math.max(1, pIn * (1 - hit)), LcP = pIn * hit;
|
|
1047
|
+
const budget = Math.max(Lavg, 8192);
|
|
1048
|
+
const n = budget / Lavg;
|
|
1049
|
+
const tBatch = prefillTime(s, md, c, Lavg, LcA, n);
|
|
1050
|
+
const cap = n * Lavg / tBatch; // new prompt tokens / s
|
|
1051
|
+
const Speak = prefillTime(s, md, c, Lpk, LcP, 1);
|
|
1052
|
+
const p = preCfg(md, c);
|
|
1053
|
+
const wGPU = md.Wd / p.tp + md.We / p.g;
|
|
1054
|
+
const rep = md.mla ? p.tp : Math.max(1, p.tp / s.kvHeads);
|
|
1055
|
+
const avail = md.hbm - md.reserve - wGPU;
|
|
1056
|
+
const fits = avail > 2e9 && kvBytes(md, pIn) * rep / p.g * 2 <= avail;
|
|
1057
|
+
return { cap, Sbatch: tBatch, Speak, Lavg, Lpk, fits, wGPU, avail };
|
|
1058
|
+
}
|
|
1059
|
+
function kvXfer(s, md, gP, L) { return kvBytes(md, L) / (Math.min(md.D, gP) * md.nic) + 0.002; }
|
|
1060
|
+
const mdWait = (rho, S) => rho * S / (2 * (1 - rho));
|
|
1061
|
+
|
|
1062
|
+
// ---------- load ----------
|
|
1063
|
+
// Cs concurrent decode streams to hold at the TPOT target (from "concurrent sessions")
|
|
1064
|
+
// Dtok output tokens/s to deliver (from DAU traffic)
|
|
1065
|
+
// lam request arrivals/s driving prefill
|
|
1066
|
+
function computeLoad(s) {
|
|
1067
|
+
const dur = s.avgOut * s.tpot / 1000 + s.ttft / 1000;
|
|
1068
|
+
const lamDau = s.dau * s.rpu / 86400 * s.peakFactor;
|
|
1069
|
+
const lamConc = s.conc / dur;
|
|
1070
|
+
const useC = s.concSource !== 'dau', useD = s.concSource !== 'conc';
|
|
1071
|
+
const h = 1 + s.headroom / 100;
|
|
1072
|
+
const lam0 = Math.max(useC ? lamConc : 0, useD ? lamDau : 0);
|
|
1073
|
+
const binding = !useD ? 'concurrency' : !useC ? 'DAU' : (lamDau * dur > s.conc ? 'DAU' : 'concurrency');
|
|
1074
|
+
return { dur, lamDau, lamConc, h, binding, Cs: useC ? s.conc * h : 0, Dtok: useD ? lamDau * s.avgOut * h : 0, lam: lam0 * h, lam0 };
|
|
1075
|
+
}
|
|
1076
|
+
// Smallest per-micro-batch B whose throughput pp*B/t(B) reaches `rate`.
|
|
1077
|
+
function minBforRate(c, tfun, rate, capBm) {
|
|
1078
|
+
if (rate <= 0) return 1;
|
|
1079
|
+
const thr = B => c.pp * B / tfun(B);
|
|
1080
|
+
if (thr(capBm) < rate) return Infinity;
|
|
1081
|
+
let lo = 0, hi = capBm;
|
|
1082
|
+
while (hi - lo > 1) { const mid = (lo + hi) >> 1; if (thr(mid) >= rate) hi = mid; else lo = mid; }
|
|
1083
|
+
return hi;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
// ---------- sizing ----------
|
|
1087
|
+
const fmtMs = t => { const ms = t * 1000; return ms >= 100 ? Math.round(ms) + ' ms' : ms.toFixed(1) + ' ms'; };
|
|
1088
|
+
|
|
1089
|
+
function sizeDisagg(s, md, load, cfgs) {
|
|
1090
|
+
const m = 1 - (s.sloMargin || 0) / 100, T = s.ttft / 1000 * m, P = s.tpot / 1000 * m; // size to targets less the safety margin
|
|
1091
|
+
const pre = cfgs.map(c => {
|
|
1092
|
+
const ps = prefillStats(s, md, c);
|
|
1093
|
+
const xa = kvXfer(s, md, c.g, Math.min(s.avgIn, s.ctx)), xp = kvXfer(s, md, c.g, Math.min(s.peakIn, s.ctx));
|
|
1094
|
+
const r = { c, label: prefillLabel(c, md), ps, xferAvg: xa, xferPeak: xp, feasible: false, why: '' };
|
|
1095
|
+
if (!ps.fits) { r.why = 'weights + prompt KV do not fit'; return r; }
|
|
1096
|
+
if (ps.Speak + xp > T) { r.why = 'peak prompt TTFT ' + fmtMs(ps.Speak + xp) + ' > target'; return r; }
|
|
1097
|
+
const budget = T - xa, S = ps.Sbatch;
|
|
1098
|
+
if (S >= budget) { r.why = 'avg prompt service time exceeds TTFT budget'; return r; }
|
|
1099
|
+
const x = (budget - S) / S, rhoMax = Math.min(0.85, 2 * x / (1 + 2 * x));
|
|
1100
|
+
const need = load.lam * ps.Lavg;
|
|
1101
|
+
const N = Math.max(1, Math.ceil(need / (ps.cap * rhoMax)));
|
|
1102
|
+
const rho = need / (N * ps.cap);
|
|
1103
|
+
Object.assign(r, { feasible: true, N, gpus: N * c.g, rho, rhoMax, ttftAvg: S + mdWait(rho, S) + xa, ttftPeak: ps.Speak + xp });
|
|
1104
|
+
return r;
|
|
1105
|
+
});
|
|
1106
|
+
const dec = cfgs.map(c => {
|
|
1107
|
+
const mi = memInfo(s, md, c);
|
|
1108
|
+
const r = { c, label: decodeLabel(c), mi, feasible: false, why: '' };
|
|
1109
|
+
if (!mi.fitsW) { r.why = 'weights do not fit'; return r; }
|
|
1110
|
+
if (!mi.fitsCtx) { r.why = 'one full-context sequence does not fit'; return r; }
|
|
1111
|
+
const bm = bmax(s, md, c, mi, P);
|
|
1112
|
+
r.bm = bm;
|
|
1113
|
+
if (bm.B < 1) { r.why = bm.limit === 'latency' ? 'TPOT floor ' + fmtMs(decodeStep(s, md, c, 1).t) + ' > target' : 'no KV room'; return r; }
|
|
1114
|
+
const Binst = bm.B * c.pp;
|
|
1115
|
+
const tfun = B => decodeStep(s, md, c, B).t;
|
|
1116
|
+
const thrInst = Binst / tfun(bm.B);
|
|
1117
|
+
const N = Math.max(1, Math.ceil(load.Cs / Binst), Math.ceil(load.Dtok / thrInst));
|
|
1118
|
+
const Bm = Math.max(1, Math.ceil(load.Cs / N / c.pp), minBforRate(c, tfun, load.Dtok / N, bm.B));
|
|
1119
|
+
const st = decodeStep(s, md, c, Bm), Bop = Bm * c.pp;
|
|
1120
|
+
Object.assign(r, { feasible: true, N, gpus: N * c.g, Binst, Bop, st, tpotOp: st.t, thrInst, kvUse: Bop * mi.perSeq / 1.1 / mi.cap });
|
|
1121
|
+
return r;
|
|
1122
|
+
});
|
|
1123
|
+
const best = arr => arr.filter(r => r.feasible).sort((a, b) => a.gpus - b.gpus || a.c.g - b.c.g)[0] || null;
|
|
1124
|
+
return { pre, dec, P: best(pre), D: best(dec) };
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
// Aggregated: each step carries the decode batch plus a prefill chunk sized to keep the step within TPOT.
|
|
1128
|
+
function sizeAgg(s, md, load, cfgs) {
|
|
1129
|
+
const m = 1 - (s.sloMargin || 0) / 100, T = s.ttft / 1000 * m, P = s.tpot / 1000 * m; // size to targets less the safety margin
|
|
1130
|
+
const rows = cfgs.map(c => {
|
|
1131
|
+
const mi = memInfo(s, md, c);
|
|
1132
|
+
const r = { c, label: decodeLabel(c), mi, feasible: false, why: '' };
|
|
1133
|
+
if (!mi.fitsW) { r.why = 'weights do not fit'; return r; }
|
|
1134
|
+
if (!mi.fitsCtx) { r.why = 'one full-context sequence does not fit'; return r; }
|
|
1135
|
+
const capBm = decodeCap(s, md, c, mi), capB = capBm * c.pp;
|
|
1136
|
+
if (capB < 1) { r.why = 'no KV room'; return r; }
|
|
1137
|
+
const ps = prefillStats(s, md, c);
|
|
1138
|
+
if (!ps.fits) { r.why = 'weights + prompt KV do not fit'; return r; }
|
|
1139
|
+
if (ps.Speak + s.stepMs / 1000 > T) { r.why = 'peak prompt TTFT ' + fmtMs(ps.Speak) + ' > target'; return r; }
|
|
1140
|
+
if (decodeStep(s, md, c, 1).t > P) { r.why = 'TPOT floor ' + fmtMs(decodeStep(s, md, c, 1).t) + ' > target'; return r; }
|
|
1141
|
+
const Nmin = Math.max(1, Math.ceil(load.Cs / capB));
|
|
1142
|
+
const Nmax = Math.max(Nmin * 64, 4096);
|
|
1143
|
+
for (let N = Nmin; N <= Nmax; N++) {
|
|
1144
|
+
const fp0 = load.lam * ps.Lavg / N / ps.cap;
|
|
1145
|
+
if (fp0 >= 0.85) continue;
|
|
1146
|
+
const tAvgF = B => { const q = decodeStep(s, md, c, B); return Math.max(q.tm, q.tc / (1 - fp0)) * 1.1 + q.comm + q.ovh; };
|
|
1147
|
+
const Bm = Math.max(1, Math.ceil(load.Cs / N / c.pp), minBforRate(c, tAvgF, load.Dtok / N, capBm));
|
|
1148
|
+
if (!isFinite(Bm) || Bm > capBm) continue;
|
|
1149
|
+
const st = decodeStep(s, md, c, Bm);
|
|
1150
|
+
const Pcore = (P - st.comm - st.ovh) / 1.1;
|
|
1151
|
+
if (Math.max(st.tm, st.tc) >= Pcore) continue;
|
|
1152
|
+
const chunk = (Pcore - st.tc) * ps.cap;
|
|
1153
|
+
const mu = chunk / P;
|
|
1154
|
+
const rArr = load.lam * ps.Lavg / N;
|
|
1155
|
+
const rho = rArr / mu;
|
|
1156
|
+
if (rho >= 0.85) continue;
|
|
1157
|
+
const S = ps.Lavg / mu;
|
|
1158
|
+
const ttftAvg = S + mdWait(rho, S) + P, ttftPeak = ps.Lpk / mu + P;
|
|
1159
|
+
if (ttftAvg > T || ttftPeak > T) continue;
|
|
1160
|
+
const tAvg = Math.min(P, tAvgF(Bm)), Bop = Bm * c.pp;
|
|
1161
|
+
Object.assign(r, { feasible: true, N, gpus: N * c.g, Bop, st, tpotOp: tAvg, ttftAvg, ttftPeak, fp: fp0, rho, chunk, ps, kvUse: Bop * mi.perSeq / 1.1 / mi.cap, thrInst: Bop / tAvg });
|
|
1162
|
+
return r;
|
|
1163
|
+
}
|
|
1164
|
+
r.why = 'no instance count meets both targets';
|
|
1165
|
+
return r;
|
|
1166
|
+
});
|
|
1167
|
+
const best = rows.filter(r => r.feasible).sort((a, b) => a.gpus - b.gpus || a.c.g - b.c.g)[0] || null;
|
|
1168
|
+
return { rows, best };
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
// The operating point of one fixed layout at a fixed concurrency: what an engine running config c with B sequences
|
|
1172
|
+
// in flight delivers, by the same physics sizeAgg uses (each step carries the decode batch plus prefill chunks; the
|
|
1173
|
+
// prefill share fp slows the compute part). For checking the model against measured runs (e.g. InferenceX):
|
|
1174
|
+
// returns TPOT, TTFT, and output tokens/s per GPU.
|
|
1175
|
+
function operatingPoint(s, md, c, B) {
|
|
1176
|
+
const st = decodeStep(s, md, c, B), ps = prefillStats(s, md, c), osl = s.avgOut, isl = Math.min(s.avgIn, s.ctx);
|
|
1177
|
+
let tpot = st.t, ttft = ps.Sbatch, fp = 0;
|
|
1178
|
+
for (let i = 0; i < 50; i++) {
|
|
1179
|
+
const lam = B / (osl * tpot + ttft); // requests/s through this instance
|
|
1180
|
+
fp = Math.min(0.95, lam * isl / ps.cap); // share of compute spent on prefill
|
|
1181
|
+
const t = Math.max(st.tm, st.tc / (1 - fp)) * 1.1 + st.comm + st.ovh;
|
|
1182
|
+
// a new prompt is prefilled in chunks between decode steps: its share of each step is what decode leaves
|
|
1183
|
+
const free = Math.max(0.05, 1 - Math.max(st.tm, st.tc) / t);
|
|
1184
|
+
const tt = prefillTime(s, md, c, isl, 0, 1) / free + mdWait(Math.min(0.85, fp), isl / ps.cap) + t;
|
|
1185
|
+
if (Math.abs(t - tpot) < 1e-7 && Math.abs(tt - ttft) < 1e-6) { tpot = t; ttft = tt; break; }
|
|
1186
|
+
tpot = t; ttft = tt;
|
|
1187
|
+
}
|
|
1188
|
+
const outPerGpu = B * osl / (osl * tpot + ttft) / c.g;
|
|
1189
|
+
return { tpot, ttft, outPerGpu, prefillShare: fp, bound: st.bound, step: st };
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
// Nodes (scale-up domains) needed: instances that span domains take whole domains; smaller ones pack first-fit-decreasing.
|
|
1193
|
+
function packNodes(pools, D) {
|
|
1194
|
+
const items = [];
|
|
1195
|
+
let whole = 0;
|
|
1196
|
+
for (const p of pools) for (let i = 0; i < p.N; i++) { if (p.g >= D) whole += Math.ceil(p.g / D); else items.push(p.g); }
|
|
1197
|
+
items.sort((a, b) => b - a);
|
|
1198
|
+
const bins = [];
|
|
1199
|
+
for (const g of items) { const b = bins.findIndex(x => x + g <= D); if (b >= 0) bins[b] += g; else bins.push(g); }
|
|
1200
|
+
return whole + bins.length;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
function plan(s, opts) {
|
|
1204
|
+
opts = opts || {};
|
|
1205
|
+
const md = derive(s);
|
|
1206
|
+
const load = computeLoad(s);
|
|
1207
|
+
const cfgs = configs(s, md);
|
|
1208
|
+
const dis = sizeDisagg(s, md, load, cfgs);
|
|
1209
|
+
const agg = sizeAgg(s, md, load, cfgs);
|
|
1210
|
+
const D = md.D;
|
|
1211
|
+
// N+1: room for one more instance of the largest layout, using free GPUs in existing nodes first
|
|
1212
|
+
const spareFor = pools => s.nPlus1 ? packNodes(pools.concat([{ N: 1, g: Math.max(...pools.map(p => p.g)) }]), D) - packNodes(pools, D) : 0;
|
|
1213
|
+
let disOpt = null, aggOpt = null;
|
|
1214
|
+
if (dis.P && dis.D) {
|
|
1215
|
+
const pools = [{ N: dis.P.N, g: dis.P.c.g }, { N: dis.D.N, g: dis.D.c.g }];
|
|
1216
|
+
const nodes = packNodes(pools, D), sp = spareFor(pools);
|
|
1217
|
+
disOpt = { mode: 'disagg', gpus: dis.P.gpus + dis.D.gpus, nodes, spareNodes: sp, totalNodes: nodes + sp };
|
|
1218
|
+
}
|
|
1219
|
+
if (agg.best) {
|
|
1220
|
+
const pools = [{ N: agg.best.N, g: agg.best.c.g }];
|
|
1221
|
+
const nodes = packNodes(pools, D), sp = spareFor(pools);
|
|
1222
|
+
aggOpt = { mode: 'agg', gpus: agg.best.gpus, nodes, spareNodes: sp, totalNodes: nodes + sp };
|
|
1223
|
+
}
|
|
1224
|
+
const plural = n => n === 1 ? '' : 's', U = D > 8 ? 'rack' : 'node';
|
|
1225
|
+
let chosen = null, reason = '';
|
|
1226
|
+
if (s.mode === 'disagg') { chosen = disOpt; reason = 'Disaggregated serving selected.'; }
|
|
1227
|
+
else if (s.mode === 'agg') { chosen = aggOpt; reason = 'Aggregated serving selected.'; }
|
|
1228
|
+
else if (disOpt && (!aggOpt || disOpt.totalNodes < aggOpt.totalNodes * 0.9)) {
|
|
1229
|
+
chosen = disOpt;
|
|
1230
|
+
reason = aggOpt ? `Disaggregated prefill/decode needs ${aggOpt.totalNodes - disOpt.totalNodes} fewer ${U}${plural(aggOpt.totalNodes - disOpt.totalNodes)} than aggregated (${disOpt.totalNodes} vs ${aggOpt.totalNodes}).` : 'Aggregated serving cannot meet both targets on any layout; splitting prefill and decode can.';
|
|
1231
|
+
} else if (aggOpt) {
|
|
1232
|
+
chosen = aggOpt;
|
|
1233
|
+
reason = disOpt ? (aggOpt.totalNodes <= disOpt.totalNodes ? `Aggregated serving with chunked prefill fits in ${aggOpt.totalNodes} ${U}${plural(aggOpt.totalNodes)} (disaggregated: ${disOpt.totalNodes}), with fewer moving parts.` : `Disaggregation would save under 10% (${disOpt.totalNodes} vs ${aggOpt.totalNodes} ${U}s); aggregated is simpler to run.`) : 'Only aggregated serving meets both targets.';
|
|
1234
|
+
} else if (disOpt) { chosen = disOpt; reason = 'Only disaggregated serving meets both targets.'; }
|
|
1235
|
+
const res = { s, md, load, cfgs, dis, agg, disOpt, aggOpt, chosen, reason };
|
|
1236
|
+
if (chosen) { chosen.nodeGPUs = D; chosen.provGPUs = chosen.totalNodes * D; chosen.kw = chosen.totalNodes * (s.nodeKW || 0); }
|
|
1237
|
+
res.tpotFloor = Math.min(...cfgs.map(c => memInfo(s, md, c).fitsW ? decodeStep(s, md, c, 1).t : Infinity));
|
|
1238
|
+
res.ttftFloor = Math.min(...cfgs.map(c => { const p = prefillStats(s, md, c); return p.fits ? p.Speak : Infinity; }));
|
|
1239
|
+
const reqDay = s.dau * s.rpu;
|
|
1240
|
+
res.econ = { reqDay, inDay: reqDay * s.avgIn, outDay: reqDay * s.avgOut };
|
|
1241
|
+
if (chosen) {
|
|
1242
|
+
const costDay = chosen.provGPUs * 24 * (s.price || 0);
|
|
1243
|
+
res.econ.costDay = costDay;
|
|
1244
|
+
res.econ.perMOut = res.econ.outDay > 0 ? costDay / (res.econ.outDay / 1e6) : NaN;
|
|
1245
|
+
res.econ.avgVsPeak = load.lam > 0 ? (reqDay / 86400) / load.lam : NaN;
|
|
1246
|
+
}
|
|
1247
|
+
if (!opts.noSens) {
|
|
1248
|
+
res.sens = [10, 15, 20, 25, 30, 40, 50, 60, 80, 100].map(tp => {
|
|
1249
|
+
const r = plan(Object.assign({}, s, { tpot: tp }), { noSens: true });
|
|
1250
|
+
return { tpot: tp, gpus: r.chosen ? r.chosen.provGPUs : null };
|
|
1251
|
+
});
|
|
1252
|
+
}
|
|
1253
|
+
return res;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
const api = { SETTINGS, plan, derive, kvBytes, attnPre, attnDec, decodeStep, memInfo, prefillStats, prefillTime, configs, computeLoad, decodeLabel, prefillLabel, decodeCap, packNodes, operatingPoint };
|
|
1257
|
+
if (typeof module !== 'undefined' && module.exports) module.exports = api; else root.SizerModel = api;
|
|
1258
|
+
})(this);
|
|
1259
|
+
|
|
1260
|
+
</script>
|
|
1261
|
+
<script>
|
|
388
1262
|
/* FleetScope engine: time-stepped fleet simulation for LLM serving and training.
|
|
389
1263
|
Pure functions, no DOM. Deterministic for (workload, scenario, seed).
|
|
390
1264
|
Performance is derived from model and GPU spec-sheet figures with fixed efficiency factors:
|
|
@@ -411,17 +1285,16 @@ button, select, input { font: inherit; color: inherit; }
|
|
|
411
1285
|
}
|
|
412
1286
|
const clamp = (v, lo, hi) => Math.max(lo, Math.min(hi, v));
|
|
413
1287
|
|
|
414
|
-
//
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
};
|
|
1288
|
+
// Spec-sheet figures (dense TFLOPS, HBM GB, HBM TB/s) from the shared accelerator registry
|
|
1289
|
+
// (inference-sizer/src/accelerators.js). Prices are placeholders, $/GPU-hour.
|
|
1290
|
+
const REG = (typeof module !== 'undefined' && module.exports) ? require('../../inference-sizer/src/accelerators.js') : root.AIInfraAccelerators;
|
|
1291
|
+
const GPU_ORDER = ['A100', 'L40S', 'H100', 'H200', 'MI300X', 'B200', 'B300', 'GB200', 'GB300', 'MI325X', 'MI355X'];
|
|
1292
|
+
const GPUS = {};
|
|
1293
|
+
for (const k of GPU_ORDER.concat(REG.ACCELERATORS.map(a => a.short || a.id))) {
|
|
1294
|
+
const a = REG.byId(k); if (!a || GPUS[k] || !a.tdpW) continue; // the power model needs board power (cloud TPUs don't publish it)
|
|
1295
|
+
GPUS[k] = { label: `${k} ${a.hbmGB}GB${a.domain >= 72 ? ` (NVL${a.domain})` : ''}`, hbm: a.hbmGB, bw: a.hbmTBs, bf16: a.tfBf16, fp8: a.tfFp8 || a.tfBf16,
|
|
1296
|
+
onprem: a.onprem, rent: a.price, tdpW: a.tdpW, vendor: a.vendorKey, kind: a.kind };
|
|
1297
|
+
}
|
|
425
1298
|
// Approximate architecture figures. kvDim = per-token, per-layer K+V width (2 x kv_heads x head_dim, or MLA latent).
|
|
426
1299
|
const MODELS = {
|
|
427
1300
|
'llama-8b': { label: 'Llama 3.1 8B', params: 8, active: 8, layers: 32, kvHeads: 8, headDim: 128, mla: 0 },
|
|
@@ -430,14 +1303,31 @@ button, select, input { font: inherit; color: inherit; }
|
|
|
430
1303
|
'llama-405b': { label: 'Llama 3.1 405B', params: 405, active: 405, layers: 126, kvHeads: 8, headDim: 128, mla: 0 },
|
|
431
1304
|
'moe-671b': { label: 'MoE 671B, 37B active (MLA)', params: 671, active: 37, layers: 61, kvHeads: 0, headDim: 0, mla: 576 }
|
|
432
1305
|
};
|
|
1306
|
+
// Every other model in the Inference Sizer's catalog (one list for both tools, kept current there). kvScale: the KV a
|
|
1307
|
+
// token holds, averaged over a 32K context, against the plain kvDim × layers figure, so sliding-window, linear-attention
|
|
1308
|
+
// and compressed layers count; it scales with the layers and heads if they are edited.
|
|
1309
|
+
const node = typeof module !== 'undefined' && module.exports;
|
|
1310
|
+
const CAT = node ? require('../../inference-sizer/src/catalog.js') : root.SizerCatalog, SZ = node ? require('../../inference-sizer/src/model.js') : root.SizerModel;
|
|
1311
|
+
const kvDimTotal = m => (m.mla ? m.layers * m.mla : 2 * m.layers * m.kvHeads * m.headDim);
|
|
1312
|
+
for (const k of Object.keys(MODELS)) MODELS[k].kvScale = 1;
|
|
1313
|
+
const IN_LIST = { 'llama31-8b': 'llama-8b', 'llama33-70b': 'llama-70b', 'llama31-405b': 'llama-405b', 'deepseek-v3': 'moe-671b' };
|
|
1314
|
+
if (CAT && SZ) {
|
|
1315
|
+
for (const c of CAT.MODELS) {
|
|
1316
|
+
if (IN_LIST[c.id] || MODELS[c.id]) continue;
|
|
1317
|
+
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 };
|
|
1318
|
+
const md = SZ.derive(Object.assign({}, SZ.SETTINGS, CAT.MODEL_DEFAULTS, c, { kvprec: 'fp8', tfBf16: 1, hbmTBs: 1, scaleUpGBs: 1, nicGbps: 1, hbmGB: 1 }));
|
|
1319
|
+
m.kvScale = +(SZ.kvBytes(md, 32768) / 32768 / kvDimTotal(m)).toFixed(4);
|
|
1320
|
+
MODELS[c.id] = m;
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
433
1323
|
|
|
434
1324
|
// ---------- performance profile ----------
|
|
435
1325
|
// tpFixed: GPUs per instance set on the pool (0 or absent = smallest power of two whose share of the weights fits).
|
|
436
1326
|
function profile(gpuKey, m, tpFixed) {
|
|
437
1327
|
const G = GPUS[gpuKey];
|
|
438
|
-
const wBytes = m.params * 1e9 * (m.wPrec === 'bf16' ? 2 : 1);
|
|
1328
|
+
const wBytes = m.params * 1e9 * (m.wPrec === 'bf16' ? 2 : m.wPrec === 'fp4' ? 0.5625 : 1);
|
|
439
1329
|
const kvElem = m.kvPrec === 'bf16' ? 2 : 1;
|
|
440
|
-
const kvBytesPerToken = m
|
|
1330
|
+
const kvBytesPerToken = kvDimTotal(m) * kvElem * (m.kvScale > 0 ? m.kvScale : 1);
|
|
441
1331
|
let tp = 1;
|
|
442
1332
|
if (tpFixed > 0) tp = Math.round(tpFixed);
|
|
443
1333
|
else while (tp < 16 && wBytes / tp > 0.65 * G.hbm * 1e9) tp *= 2;
|
|
@@ -1948,6 +2838,7 @@ button, select, input { font: inherit; color: inherit; }
|
|
|
1948
2838
|
cached prompt tokens served from a prefix cache, when the log records it
|
|
1949
2839
|
ttft/queue/e2e recorded latencies in seconds, used to compare with the simulation
|
|
1950
2840
|
session user or session id, when the log records one
|
|
2841
|
+
agent subagent id within a session (agentic traces), gap seconds since the session's previous request ended
|
|
1951
2842
|
Only timing and token counts are read; prompt and response text are never touched. */
|
|
1952
2843
|
(function (root) {
|
|
1953
2844
|
'use strict';
|
|
@@ -1999,12 +2890,15 @@ button, select, input { font: inherit; color: inherit; }
|
|
|
1999
2890
|
if (t < 0) continue;
|
|
2000
2891
|
if (t > opt.maxSeconds) { notes.push('kept the first ' + Math.round(opt.maxSeconds / 60) + ' minutes'); break; }
|
|
2001
2892
|
if (trace.length >= opt.maxRows) { notes.push('kept the first ' + opt.maxRows.toLocaleString('en-US') + ' requests'); break; }
|
|
2002
|
-
const row = { t, isl: Math.min(Math.round(r.isl), 200000), osl: Math.max(1, Math.min(Math.round(r.osl), 16000)) };
|
|
2893
|
+
const row = { t, isl: Math.min(Math.round(r.isl), opt.maxIsl || 200000), osl: Math.max(1, Math.min(Math.round(r.osl), opt.maxOsl || 16000)) };
|
|
2003
2894
|
if (isFinite(r.cached) && r.cached >= 0) row.cached = Math.min(Math.round(r.cached), row.isl - 1);
|
|
2004
2895
|
if (isFinite(r.ttft) && r.ttft >= 0) row.ttft = r.ttft;
|
|
2005
2896
|
if (isFinite(r.queue) && r.queue >= 0) row.queue = r.queue;
|
|
2006
2897
|
if (isFinite(r.e2e) && r.e2e >= 0) row.e2e = r.e2e;
|
|
2007
2898
|
if (r.session != null && r.session !== '') row.session = String(r.session);
|
|
2899
|
+
if (r.agent != null && r.agent !== '') row.agent = String(r.agent);
|
|
2900
|
+
if (isFinite(r.api) && r.api >= 0) row.api = r.api;
|
|
2901
|
+
if (isFinite(r.tools)) row.tools = r.tools;
|
|
2008
2902
|
trace.push(row);
|
|
2009
2903
|
}
|
|
2010
2904
|
if (bad) notes.push(bad + ' unreadable record' + (bad > 1 ? 's' : '') + ' skipped');
|
|
@@ -2163,6 +3057,84 @@ button, select, input { font: inherit; color: inherit; }
|
|
|
2163
3057
|
return out;
|
|
2164
3058
|
}
|
|
2165
3059
|
|
|
3060
|
+
// ---------- agentic traces ----------
|
|
3061
|
+
// Prefix reuse from block hashes: each request lists the hashes of its prompt's fixed-size blocks, chained so a block's
|
|
3062
|
+
// hash depends on everything before it. The cached part of a request is the longest run of leading blocks some earlier
|
|
3063
|
+
// request in the same scope already had: what an unbounded prefix cache would serve. scope 'session' (AgentX: hashes are
|
|
3064
|
+
// session-scoped) or 'global' (Mooncake: one hash space for the whole trace).
|
|
3065
|
+
function prefixReuse(rows, blockTokens, scope) {
|
|
3066
|
+
const seen = new Map();
|
|
3067
|
+
for (const r of rows) {
|
|
3068
|
+
const key = scope === 'global' ? '' : (r.session || ''), set = seen.get(key) || new Set();
|
|
3069
|
+
seen.set(key, set);
|
|
3070
|
+
let n = 0; const h = r.hashes || [];
|
|
3071
|
+
while (n < h.length && set.has(h[n])) n++;
|
|
3072
|
+
for (const x of h) set.add(x);
|
|
3073
|
+
r.cached = Math.min(r.isl, n * blockTokens);
|
|
3074
|
+
delete r.hashes;
|
|
3075
|
+
}
|
|
3076
|
+
return rows;
|
|
3077
|
+
}
|
|
3078
|
+
// SemiAnalysis AgentX ("weka" traces, Apache-2.0): one JSON object per session { id, requests: [ { t, type, model, in,
|
|
3079
|
+
// out, hash_ids, api_time, think_time? } | { type: 'subagent', agent_id, requests: [...] } ] }; t in seconds from the
|
|
3080
|
+
// session start; in = 64-token hash blocks × 64. Sessions are laid end to end unless opt.sessionGapS spaces them.
|
|
3081
|
+
function parseAgentX(docs, opt) {
|
|
3082
|
+
opt = opt || {};
|
|
3083
|
+
const rows = [];
|
|
3084
|
+
let offset = 0;
|
|
3085
|
+
const sessions = docs.map(d => (Array.isArray(d) ? { id: null, requests: d } : d)).filter(d => d && Array.isArray(d.requests));
|
|
3086
|
+
sessions.forEach((d, i) => {
|
|
3087
|
+
const id = String(d.id != null ? d.id : 'session-' + i), start = offset;
|
|
3088
|
+
let end = start;
|
|
3089
|
+
const add = (q, agent) => {
|
|
3090
|
+
const t = start + (+q.t || 0), api = +q.api_time || 0;
|
|
3091
|
+
rows.push({ t, isl: +q.in || 0, osl: +q.out || 1, session: id, agent, api, hashes: q.hash_ids || [], e2e: api || NaN });
|
|
3092
|
+
end = Math.max(end, t + api);
|
|
3093
|
+
};
|
|
3094
|
+
for (const q of d.requests) {
|
|
3095
|
+
if (q && q.type === 'subagent') for (const x of q.requests || []) add(x, String(q.agent_id || 'subagent'));
|
|
3096
|
+
else if (q) add(q, null);
|
|
3097
|
+
}
|
|
3098
|
+
offset = opt.sessionGapS != null ? start + opt.sessionGapS : end;
|
|
3099
|
+
});
|
|
3100
|
+
rows.sort((a, b) => a.t - b.t);
|
|
3101
|
+
prefixReuse(rows, opt.blockTokens || 64, 'session');
|
|
3102
|
+
const out = finish(rows, 'AgentX agentic trace', [], Object.assign({ maxIsl: 2e6, maxOsl: 64000 }, opt));
|
|
3103
|
+
out.stats.sessions = sessions.length;
|
|
3104
|
+
out.notes.push('cached tokens: what an unbounded prefix cache would serve, from 64-token block hashes (within a session)');
|
|
3105
|
+
return out;
|
|
3106
|
+
}
|
|
3107
|
+
// Mooncake (Kimi) traces: one request per line { timestamp (ms), input_length, output_length, hash_ids } with 512-token
|
|
3108
|
+
// blocks in one hash space.
|
|
3109
|
+
function parseMooncake(docs, opt) {
|
|
3110
|
+
opt = opt || {};
|
|
3111
|
+
const rows = docs.filter(d => d && d.input_length != null).map(d => ({ t: (+d.timestamp || 0) / 1000, isl: +d.input_length, osl: +d.output_length || 1, hashes: d.hash_ids || [] }));
|
|
3112
|
+
rows.sort((a, b) => a.t - b.t);
|
|
3113
|
+
prefixReuse(rows, opt.blockTokens || 512, 'global');
|
|
3114
|
+
const out = finish(rows, 'Mooncake trace', [], Object.assign({ maxIsl: 2e6 }, opt));
|
|
3115
|
+
out.notes.push('cached tokens: what an unbounded prefix cache would serve, from 512-token block hashes');
|
|
3116
|
+
return out;
|
|
3117
|
+
}
|
|
3118
|
+
// TraceLab (UW SyFI coding-agent trace, CC BY 4.0): one model call per line, from Claude Code and Codex, with the
|
|
3119
|
+
// provider's own cache accounting, timing events and tool calls.
|
|
3120
|
+
function tracelabRow(o) {
|
|
3121
|
+
const ev = o.timing_events || [], ts = ev.map(e => toSeconds(e.timestamp)).filter(isFinite);
|
|
3122
|
+
if (!ts.length) return null;
|
|
3123
|
+
const isClaude = o.claude_cache_read_input_tokens != null || o.provider === 'claude';
|
|
3124
|
+
const cached = isClaude ? (+o.claude_cache_read_input_tokens || 0) : (+o.prefix_tokens || 0);
|
|
3125
|
+
// the call starts at its input (user message or last tool result) and ends at its last model event
|
|
3126
|
+
const inEv = ev.filter(e => /user_message|tool_result/.test(e.event_type)).map(e => toSeconds(e.timestamp)).filter(isFinite);
|
|
3127
|
+
const outEv = ev.filter(e => /text|tool_call|reasoning|usage_report/.test(e.event_type)).map(e => toSeconds(e.timestamp)).filter(isFinite);
|
|
3128
|
+
const t = inEv.length ? Math.max(...inEv) : Math.min(...ts), endT = outEv.length ? Math.max(...outEv) : t;
|
|
3129
|
+
return { t, isl: +o.input_tokens_total || 0, osl: Math.max(1, (+o.output_tokens || 0)), cached, session: o.session_id, api: Math.max(0, endT - t), tools: (o.tools || []).length, model: o.model };
|
|
3130
|
+
}
|
|
3131
|
+
function parseTraceLab(docs, opt) {
|
|
3132
|
+
const rows = docs.map(tracelabRow).filter(Boolean);
|
|
3133
|
+
const out = finish(rows, 'TraceLab coding-agent trace', [], Object.assign({ maxIsl: 2e6, maxOsl: 64000 }, opt || {}));
|
|
3134
|
+
out.notes.push('cached tokens as each provider reported them (Claude cache reads, Codex cached prefix)');
|
|
3135
|
+
return out;
|
|
3136
|
+
}
|
|
3137
|
+
|
|
2166
3138
|
// ---------- detection ----------
|
|
2167
3139
|
function parseJsonLines(text) {
|
|
2168
3140
|
const out = [];
|
|
@@ -2175,14 +3147,18 @@ button, select, input { font: inherit; color: inherit; }
|
|
|
2175
3147
|
return { docs: out, bad };
|
|
2176
3148
|
}
|
|
2177
3149
|
function parseTrace(text, opt) {
|
|
2178
|
-
const s = text.replace(
|
|
3150
|
+
const s = text.replace(/^\uFEFF/, '').trimStart();
|
|
2179
3151
|
if (s[0] === '{' || s[0] === '[') {
|
|
2180
3152
|
let docs, bad = 0;
|
|
2181
3153
|
try { const whole = JSON.parse(s); docs = Array.isArray(whole) ? whole : [whole]; }
|
|
2182
3154
|
catch (e) { const jl = parseJsonLines(s); docs = jl.docs; bad = jl.bad; }
|
|
2183
3155
|
if (!docs.length) throw new Error('The file looks like JSON but no record could be parsed.');
|
|
2184
3156
|
let res;
|
|
3157
|
+
const d0 = docs.find(d => d && typeof d === 'object');
|
|
2185
3158
|
if (docs.some(d => d && (d.resourceSpans || d.batches))) res = parseOTLP(docs, opt);
|
|
3159
|
+
else if (d0 && (Array.isArray(d0.requests) || (Array.isArray(d0) && d0[0] && d0[0].hash_ids))) res = parseAgentX(docs, opt);
|
|
3160
|
+
else if (d0 && d0.input_length != null && d0.hash_ids) res = parseMooncake(docs, opt);
|
|
3161
|
+
else if (d0 && d0.timing_events && d0.input_tokens_total != null) res = parseTraceLab(docs, opt);
|
|
2186
3162
|
else if (docs.length === 1 && docs[0] && Array.isArray(docs[0].data) && docs[0].data.some(x => x && x.spans)) res = parseJaeger(docs[0], opt);
|
|
2187
3163
|
else {
|
|
2188
3164
|
const records = docs.length === 1 && docs[0] && Array.isArray(docs[0].data) ? docs[0].data : docs;
|
|
@@ -2202,7 +3178,7 @@ button, select, input { font: inherit; color: inherit; }
|
|
|
2202
3178
|
return lines.join('\n') + '\n';
|
|
2203
3179
|
}
|
|
2204
3180
|
|
|
2205
|
-
const api = { parseTrace, parseCSV, toCSV, toSeconds, LIMITS };
|
|
3181
|
+
const api = { parseTrace, parseCSV, toCSV, toSeconds, LIMITS, parseAgentX, parseMooncake, parseTraceLab, tracelabRow, prefixReuse, finish };
|
|
2206
3182
|
if (typeof module !== 'undefined' && module.exports) module.exports = api;
|
|
2207
3183
|
else root.FleetIngest = api;
|
|
2208
3184
|
})(typeof window !== 'undefined' ? window : this);
|
|
@@ -4536,10 +5512,10 @@ function renderPlanPanel() {
|
|
|
4536
5512
|
num('target', 'SLO attainment target (%)', PL.target, 50, 99.9, 0.5) + num('n1', 'N-1 floor: SLO with the largest pool down (%, 0 = off)', PL.n1, 0, 99, 1) +
|
|
4537
5513
|
'<div class="ctl check"><label><input type="checkbox" data-pl="gpuSwap"' + (PL.gpuSwap ? ' checked' : '') + '>Try other GPU types (H100, H200, B200)</label></div>' + num('evals', 'Simulation budget', PL.evals, 10, 200, 10) +
|
|
4538
5514
|
'<div class="btnrow"><button class="btn primary" type="button" data-act="plOpt">Find the cheapest setup</button></div>';
|
|
4539
|
-
else if (PL.tab === 'cap') { const c = PL.cap; h += '<div class="sub">Costs
|
|
5515
|
+
else if (PL.tab === 'cap') { const c = PL.cap; h += '<div class="sub">Costs five ways to supply growing GPU demand over ' + c.months + ' months: rent on demand; reserve the base load and rent the peaks on demand, as capacity blocks (EC2 Capacity Blocks, GCP calendar-mode reservations) or on spot; or buy on-prem for the base load (with a lead time) and rent the peaks.</div>' +
|
|
4540
5516
|
num('gpusNow', 'Peak GPUs needed today', c.gpusNow, 1, 100000, 1, 'cap') + num('growthPct', 'Growth per month (%)', c.growthPct, -10, 50, 0.5, 'cap') + num('baseShare', 'Base load as a share of peak', c.baseShare, 0.1, 1, 0.05, 'cap') + num('peakHoursShare', 'Share of hours above base', c.peakHoursShare, 0.05, 1, 0.05, 'cap') +
|
|
4541
5517
|
num('gpuCapex', 'On-prem $ per GPU (with server share)', c.gpuCapex, 1000, 200000, 500, 'cap') + num('leadMonths', 'Lead time (months)', c.leadMonths, 0, 18, 1, 'cap') + num('amortMonths', 'Depreciation (months)', c.amortMonths, 12, 84, 6, 'cap') + num('kwhPrice', 'Power $/kWh', c.kwhPrice, 0.01, 1, 0.01, 'cap') +
|
|
4542
|
-
num('reservedPerGpuH', 'Reserved $/GPU-hour', c.reservedPerGpuH, 0.1, 20, 0.05, 'cap') + num('onDemandPerGpuH', 'On-demand $/GPU-hour', c.onDemandPerGpuH, 0.1, 20, 0.05, 'cap') + num('months', 'Horizon (months)', c.months, 6, 60, 6, 'cap') +
|
|
5518
|
+
num('reservedPerGpuH', 'Reserved $/GPU-hour', c.reservedPerGpuH, 0.1, 20, 0.05, 'cap') + num('onDemandPerGpuH', 'On-demand $/GPU-hour', c.onDemandPerGpuH, 0.1, 20, 0.05, 'cap') + num('blockPerGpuH', 'Capacity block $/GPU-hour', c.blockPerGpuH, 0.1, 20, 0.05, 'cap') + num('spotPerGpuH', 'Spot $/GPU-hour', c.spotPerGpuH, 0.1, 20, 0.05, 'cap') + num('spotRework', 'Spot hours redone after interruptions', c.spotRework, 0, 1, 0.05, 'cap') + num('months', 'Horizon (months)', c.months, 6, 60, 6, 'cap') +
|
|
4543
5519
|
'<div class="btnrow"><button class="btn primary" type="button" data-act="plCap">Compare</button></div>'; }
|
|
4544
5520
|
else h += '<div class="sub">Packs small models onto MIG slices instead of whole GPUs. Each line: name, GPU memory in GB, replicas. Memory gets 30% headroom for KV cache.</div>' +
|
|
4545
5521
|
'<div class="ctl"><textarea data-pl="migText" rows="6" style="width:100%;font-family:var(--font-mono);font-size:12px">' + esc(PL.migText) + '</textarea></div>' +
|
|
@@ -4582,9 +5558,10 @@ function optCard(A) {
|
|
|
4582
5558
|
function capCard(A) {
|
|
4583
5559
|
const r = A.res, M = r.months, W = 980, H = 190, L = 56, k = 1000;
|
|
4584
5560
|
const cum = key => { let c = 0; return M.map(x => (c += x[key])); };
|
|
4585
|
-
const series = { rent: cum('rent'), reserved: cum('reserved'), hybrid: cum('hybrid') };
|
|
5561
|
+
const series = { rent: cum('rent'), reserved: cum('reserved'), blocks: cum('blocks'), spot: cum('spot'), hybrid: cum('hybrid') };
|
|
4586
5562
|
const vmax = Math.max(...Object.values(series).map(a => a[a.length - 1])) * 1.05, X = m => L + (W - L - 10) * m / (M.length - 1), Y = v => 8 + (H - 30) * (1 - v / vmax);
|
|
4587
|
-
const col = { rent: 'var(--crit)', reserved: 'var(--warn)',
|
|
5563
|
+
const col = { rent: 'var(--crit)', reserved: 'var(--warn)', blocks: 'var(--neo)', spot: 'var(--muted)', hybrid: 'var(--accent)' },
|
|
5564
|
+
lab = { rent: 'Rent on demand', reserved: 'Reserve the base', blocks: 'Reserve the base, capacity blocks for the peaks', spot: 'Reserve the base, spot for the peaks', hybrid: 'Buy the base, rent the peaks' };
|
|
4588
5565
|
let svg = '<svg viewBox="0 0 ' + W + ' ' + H + '" style="width:100%;height:auto" role="img" aria-label="Cumulative cost by strategy">';
|
|
4589
5566
|
for (const key in series) svg += '<path d="' + series[key].map((v, i) => (i ? 'L' : 'M') + X(i).toFixed(1) + ' ' + Y(v).toFixed(1)).join('') + '" fill="none" stroke="' + col[key] + '" stroke-width="2"/>';
|
|
4590
5567
|
for (let m = 0; m < M.length; m += 6) svg += '<text x="' + X(m) + '" y="' + (H - 6) + '" font-size="10" fill="var(--muted)" text-anchor="middle">month ' + m + '</text>';
|
|
@@ -4594,7 +5571,7 @@ function capCard(A) {
|
|
|
4594
5571
|
(r.best === 'hybrid' ? 'Buying pays back against renting by month ' + (r.breakEven == null ? '—' : r.breakEven) + ', and leaves ' + fInt(r.ownedEnd) + ' GPUs worth about ' + fUsd(r.residual) + ' after depreciation.' : 'At these prices and growth, owning does not pay back within the horizon.') + '</p>' + svg +
|
|
4595
5572
|
'<div class="glegend">' + Object.keys(series).map(key => '<span><i style="background:' + col[key] + '"></i>' + lab[key] + ': ' + fUsd(r.totals[key] / 1) + (key === 'hybrid' ? ' net of residual value (' + fUsd(r.totals.hybridCash) + ' cash)' : '') + '</span>').join('') + '</div>' +
|
|
4596
5573
|
(orders.length ? '<h3 class="sec">On-prem orders</h3><ul class="plain">' + orders.map(o => '<li>' + o + '</li>').join('') + '</ul>' : '') +
|
|
4597
|
-
'<div class="sub">Rough model: average utilisation from base and peak shares, power at ' + r.opt.kwPerGpu + ' kW per GPU and PUE ' + r.opt.pue + ', operations ' + fUsd(r.opt.opsPerGpuMonth) + ' per GPU-month. Not financial advice.</div>';
|
|
5574
|
+
'<div class="sub">Rough model: average utilisation from base and peak shares; capacity blocks bought in whole days (' + M[0].blockDays + ' a month), spot hours plus ' + fPct(r.opt.spotRework) + ' redone after interruptions; power at ' + r.opt.kwPerGpu + ' kW per GPU and PUE ' + r.opt.pue + ', operations ' + fUsd(r.opt.opsPerGpuMonth) + ' per GPU-month. Not financial advice.</div>';
|
|
4598
5575
|
}
|
|
4599
5576
|
function migCard(A) {
|
|
4600
5577
|
const r = A.res;
|
|
@@ -5334,6 +6311,7 @@ window.addEventListener('resize', () => {});
|
|
|
5334
6311
|
|
|
5335
6312
|
</script>
|
|
5336
6313
|
<script>
|
|
6314
|
+
/* global FleetScenario */ // set by scenario.js, loaded first on the page
|
|
5337
6315
|
/* FleetScope cluster view: GPU allocation grid, scheduler policy what-ifs, workload timeline. Browser only. */
|
|
5338
6316
|
(function () {
|
|
5339
6317
|
'use strict';
|
|
@@ -5994,7 +6972,7 @@ window.addEventListener('resize', () => {});
|
|
|
5994
6972
|
const arr = [];
|
|
5995
6973
|
while (i < lines.length && indent(lines[i]) === ind && lines[i].trim().startsWith('- ')) {
|
|
5996
6974
|
const rest = lines[i].trim().slice(2);
|
|
5997
|
-
if (/^[\w
|
|
6975
|
+
if (/^[\w./-]+:(\s|$)/.test(rest)) { lines[i] = ' '.repeat(ind + 2) + rest; arr.push(block(ind + 2)); }
|
|
5998
6976
|
else { arr.push(scalar(rest)); i++; }
|
|
5999
6977
|
}
|
|
6000
6978
|
return arr;
|
|
@@ -6243,11 +7221,14 @@ window.addEventListener('resize', () => {});
|
|
|
6243
7221
|
// rent on demand, rent reserved (1-year commitments) with on-demand burst, and hybrid (buy on-prem for the
|
|
6244
7222
|
// base load with a lead time, reserve nothing, burst the rest on demand). On-prem cost: capex (paid at
|
|
6245
7223
|
// delivery), power at PUE, and operations; hardware keeps its residual value at the end.
|
|
6246
|
-
|
|
7224
|
+
// Two cloud ways to buy the peak on top of a reserved base: short-term blocks (AWS EC2 Capacity Blocks for ML,
|
|
7225
|
+
// GCP calendar-mode reservations), bought in whole days, so the peak hours are assumed to come as one run of days;
|
|
7226
|
+
// and spot, with a share of the spot hours redone after interruptions. Prices are placeholders: set your own.
|
|
7227
|
+
const CAP_DEFAULTS = { months: 24, gpusNow: 64, growthPct: 4, baseShare: 0.6, peakHoursShare: 0.35, gpuCapex: 32000, amortMonths: 48, kwPerGpu: 1.1, pue: 1.3, kwhPrice: 0.09, opsPerGpuMonth: 120, leadMonths: 3, reservedPerGpuH: 2.2, onDemandPerGpuH: 3.5, onPremStart: 0, blockPerGpuH: 2.8, spotPerGpuH: 1.9, spotRework: 0.1 };
|
|
6247
7228
|
function capacityPlan(o) {
|
|
6248
7229
|
o = Object.assign({}, CAP_DEFAULTS, o || {});
|
|
6249
7230
|
const H = 730, months = [];
|
|
6250
|
-
const
|
|
7231
|
+
const DAYS = H / 24;
|
|
6251
7232
|
let owned = o.onPremStart;
|
|
6252
7233
|
const deliveries = [];
|
|
6253
7234
|
for (let m = 0; m < o.months; m++) {
|
|
@@ -6256,6 +7237,9 @@ window.addEventListener('resize', () => {});
|
|
|
6256
7237
|
const avgUse = base + (peak - base) * o.peakHoursShare;
|
|
6257
7238
|
const rent = avgUse * H * o.onDemandPerGpuH;
|
|
6258
7239
|
const reserved = base * H * o.reservedPerGpuH + (peak - base) * o.peakHoursShare * H * o.onDemandPerGpuH;
|
|
7240
|
+
const blockDays = Math.min(DAYS, Math.ceil(o.peakHoursShare * DAYS - 1e-9));
|
|
7241
|
+
const blocks = base * H * o.reservedPerGpuH + (peak - base) * blockDays * 24 * o.blockPerGpuH;
|
|
7242
|
+
const spot = base * H * o.reservedPerGpuH + (peak - base) * o.peakHoursShare * H * o.spotPerGpuH * (1 + o.spotRework);
|
|
6259
7243
|
// hybrid: order on-prem GPUs so that, after the lead time, owned capacity covers the base load
|
|
6260
7244
|
const futureBase = o.gpusNow * Math.pow(1 + o.growthPct / 100, m + o.leadMonths) * o.baseShare;
|
|
6261
7245
|
const pipeline = deliveries.filter(d => d.at >= m).reduce((a, d) => a + d.n, 0);
|
|
@@ -6266,12 +7250,12 @@ window.addEventListener('resize', () => {});
|
|
|
6266
7250
|
const onprem = owned * (o.kwPerGpu * o.pue * H * o.kwhPrice + o.opsPerGpuMonth);
|
|
6267
7251
|
const uncovered = Math.max(0, base - owned) * H + (peak - Math.max(base, Math.min(owned, peak))) * o.peakHoursShare * H;
|
|
6268
7252
|
const hybrid = capex + onprem + Math.max(0, uncovered) * o.onDemandPerGpuH;
|
|
6269
|
-
months.push({ m, peak, base, owned, order, capex, rent, reserved, hybrid });
|
|
7253
|
+
months.push({ m, peak, base, owned, order, capex, rent, reserved, hybrid, blocks, spot, blockDays });
|
|
6270
7254
|
}
|
|
6271
7255
|
const residual = owned => owned * o.gpuCapex * Math.max(0, 1 - o.months / o.amortMonths);
|
|
6272
7256
|
const sum = k => months.reduce((a, x) => a + x[k], 0);
|
|
6273
|
-
const totals = { rent: sum('rent'), reserved: sum('reserved'), hybrid: sum('hybrid') - residual(owned), hybridCash: sum('hybrid') };
|
|
6274
|
-
const ranked = Object.entries({ rent: totals.rent, reserved: totals.reserved, hybrid: totals.hybrid }).sort((a, b) => a[1] - b[1]);
|
|
7257
|
+
const totals = { rent: sum('rent'), reserved: sum('reserved'), hybrid: sum('hybrid') - residual(owned), hybridCash: sum('hybrid'), blocks: sum('blocks'), spot: sum('spot') };
|
|
7258
|
+
const ranked = Object.entries({ rent: totals.rent, reserved: totals.reserved, hybrid: totals.hybrid, blocks: totals.blocks, spot: totals.spot }).sort((a, b) => a[1] - b[1]);
|
|
6275
7259
|
// break-even: first month where cumulative hybrid cash spend falls below cumulative renting
|
|
6276
7260
|
let cr = 0, ch = 0, breakEven = null;
|
|
6277
7261
|
for (const x of months) { cr += x.rent; ch += x.hybrid; if (breakEven == null && x.owned > 0 && ch <= cr) breakEven = x.m; }
|
|
@@ -6318,7 +7302,6 @@ window.addEventListener('resize', () => {});
|
|
|
6318
7302
|
'use strict';
|
|
6319
7303
|
const node = typeof module !== 'undefined' && module.exports;
|
|
6320
7304
|
const E = node ? require('./engine.js') : root.FleetEngine;
|
|
6321
|
-
const SC = node ? require('./scenario.js') : root.FleetScenarioLib;
|
|
6322
7305
|
|
|
6323
7306
|
const EXAMPLES = [
|
|
6324
7307
|
'What if coding agents move to H200 and the cloud link drops to 100 Gbps?',
|
|
@@ -6453,6 +7436,7 @@ window.addEventListener('resize', () => {});
|
|
|
6453
7436
|
|
|
6454
7437
|
</script>
|
|
6455
7438
|
<script>
|
|
7439
|
+
/* global FleetScenario */ // set by scenario.js, loaded first on the page
|
|
6456
7440
|
/* FleetScope Training view: one job seen four ways (GPUs, phases, scheduling, full). Browser only. */
|
|
6457
7441
|
(function () {
|
|
6458
7442
|
'use strict';
|
|
@@ -6867,6 +7851,7 @@ window.addEventListener('resize', () => {});
|
|
|
6867
7851
|
|
|
6868
7852
|
</script>
|
|
6869
7853
|
<script>
|
|
7854
|
+
/* global FleetScenario */ // set by scenario.js, loaded first on the page
|
|
6870
7855
|
/* FleetScope Inference view: serving deployments as pods — replicas wanted vs ready, start-up time,
|
|
6871
7856
|
and contention with training and batch work for GPUs. Browser only. */
|
|
6872
7857
|
(function () {
|