GPU vs NPU vs TPU vs CPU methodology
Version 2026-09-07 · Primary-source ledger: JSON · The three named diagrams are licensed by Kingy.ai under CC BY 4.0.
# GPU vs NPU vs TPU vs CPU Trace a workload through device availability, software support, memory, and power constraints. See why a chip label cannot choose a system. ## Run locally Open `index.html` directly, or run `python3 -m http.server 4190 --bind 127.0.0.1` from this folder and visit http://127.0.0.1:4190/. No package manager, compilation, third-party runtime, account, telemetry, or remote request is needed. ## Model and boundaries An editorial constraint tree, not a benchmark or compatibility certificate. “NPU” means a client inference NPU; “TPU” means Google Cloud TPU here. Those labels are not mutually exclusive architectural categories. CPU host work remains even when tensor work is offloaded. - **memory:** `headroomGiB = entered usable memory − entered working set` - **eligibility:** `available AND workload-supported AND within this page’s deployment/phase scope AND memory headroom >= 0` - **routing:** `Stable explanatory rules; no fabricated throughput, power, or compatibility scores` ### Teaching assumptions - CPU software path assumed available; specialized software flags are entered by the user, not detected. - All memory capacities and working-set estimates are hypothetical teaching values. - This client-NPU path is scoped to inference; the Cloud TPU path requires cloud allowed. - Mixed/custom operations add compiler and fallback cautions rather than asserting hardware impossibility. - Battery priority changes what to measure; it never predicts watts or battery hours. ## Presets and operation Select a preset, edit the controls, and inspect the output. Invalid input displays an error and disables exports rather than silently substituting values. Reset restores the selected example. Each preset is a complete state and includes provenance in `presets.json`, dated 2026-09-07. The local `config.js` embeds identical catalog and source data so the page also works from disk; validation checks that it matches the JSON. Update those together with the generation source. ## Primary-source ledger - **C1: CPU control and GPU parallel work.** NVIDIA describes CPU latency-oriented control and GPU parallel throughput as different design priorities. [primary-documentation](https://docs.nvidia.com/cuda/cuda-programming-guide/01-introduction/introduction.html). Checked 2026-09-07. Boundary: Qualitative architecture distinction; no universal speed ratio. - **C2: Data movement is part of the path.** CUDA’s heterogeneous model uses CPU host code to launch GPU work and coordinate data, with memory arrangements varying by system. [primary-documentation](https://docs.nvidia.com/cuda/cuda-programming-guide/01-introduction/programming-model.html). Checked 2026-09-07. Boundary: Integrated and discrete memory systems differ. - **C3: NPU execution depends on support.** Microsoft documents execution providers, model-format requirements, and fallback when preferred hardware cannot execute the model. [primary-documentation](https://learn.microsoft.com/en-us/windows/ai/npu-devices/). Checked 2026-09-07. Boundary: Client inference NPUs only; model support and energy efficiency require actual verification. - **C4: Cloud TPU specializes in tensor work.** Google describes matrix-multiply units and systolic arrays within Cloud TPUs, alongside vector and scalar units. [primary-documentation](https://docs.cloud.google.com/tpu/docs/system-architecture-tpu-vm). Checked 2026-09-07. Boundary: Generation-specific sizes and performance are not modeled. ## Independently reusable assets | Diagram | Editable source | 2400×1350 raster | Use | | --- | --- | --- | --- | | Four compute roles | [SVG](assets/compute-anatomy.svg) | [PNG](assets/png/compute-anatomy.png) | Scope and architectural emphasis without winner claims. | | A workload decision map | [SVG](assets/workload-gates.svg) | [PNG](assets/png/workload-gates.png) | Availability, support, memory, then measurement. | | The cost around the kernel | [SVG](assets/data-locality.svg) | [PNG](assets/png/data-locality.png) | Host, movement, accelerator, and return path. | SVGs contain editable text and vector geometry with system-font fallbacks. Kingy may reuse the original assets internally and in its own editorial work; no public redistribution license has been assigned. Source links and attribution policy need to be settled before external distribution. The diagrams are teaching artifacts, not screenshots of hardware or measurements. ## Exports CSV flattens nested keys into field/value rows. JSON preserves the complete typed object, including topic, schema version, generated time, preset date, inputs, results, formulas, assumptions, and methodology/source paths. Undefined mathematical results are JSON null and CSV `null`. Examples under `exports/` were downloaded from the browser controls and parsed during QA. ## Worked expected result Default 8 GiB local inference: CPU headroom=24, GPU=8, client NPU=0 GiB; Cloud TPU is outside selected deployment scope. Cloud-training preset: CPU candidate with 8 GiB headroom; GPU memory shortfall 8 GiB; client NPU outside training scope; Cloud TPU candidate with 8 GiB headroom. Unsupported flags reject the corresponding path regardless of capacity; no-available paths are clearly labeled. ## Source map `index.html` contains the accessible page and explanation; `styles.css` the standalone visual shell; `common.js` input validation and exports; `config.js` the local catalog; `app.js` the topic-specific computation and rendering. `sources.json` and `presets.json` are portable ledgers. `VALIDATION.md` and `output/playwright/` record QA. Authoring source is retained in the companion production kit after season completion.