uarch-isa-simulation-measurement-roofline-and-specialization
Use when evaluating or reasoning about performance rather than building hardware: ISA design and what the choice actually determines, simulation and modelling, measuring microarchitectural behaviour honestly with performance counters and the traps in them, roofline analysis and the fundamental limits that bound any optimisation, and specialization and when a fixed-function unit wins.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 5
- Forks
- 3
01 前言 Front Matter
- name
- uarch-isa-simulation-measurement-roofline-and-specialization
- description
- Use when evaluating or reasoning about performance rather than building hardware: ISA design and what the choice actually determines, simulation and modelling, measuring microarchitectural behaviour honestly with performance counters and the traps in them, roofline analysis and the fundamental limits that bound any optimisation, and specialization and when a fixed-function unit wins.
03 SKILL.md 正文
Microarchitecture and Memory: ISA Design, Simulation and Modelling, Measuring It, Roofline and Fundamental Limits, and Specialization
Part 5 of 6 of the CPU, GPU, NPU and Memory Microarchitecture reference (plugin
microarchitecture-and-memory-systems), covering §20–§24. Sibling skills:uarch-pipelining-out-of-order-branch-prediction-and-simd(§0–§5),uarch-caches-coherence-consistency-and-virtual-memory(§6–§10),uarch-gpu-npu-dataflow-and-numeric-formats(§11–§14),uarch-dram-memory-controllers-power-and-security(§15–§19),uarch-reference(§25–§30). Section numbers are shared across the set; a reference written as §N →skillpoints into that sibling skill.Currency: The principles are stable. Two areas moved. See §25 →
uarch-referencefor low-precision numeric formats, and next-generation memory standards.
⚠️ SCOPE, because this sits between two neighbours. ⚠️ A semiconductor reference covers device physics and fabrication — how a transistor works and how it's made. A computer-hardware reference covers system integration — components, builds, facilities. ⚠️ THIS file is the layer in between: how billions of transistors are ORGANIZED into something that executes instructions fast, and why memory systems are the hard part. ⚠️ It assumes the other two rather than repeating them.
⚠️ GOTCHA boxes mark where architectural intuition is wrong and where the abstraction leaks.
The three ideas that organize this document:
- ⚠️ THE PROCESSOR LIES TO YOU, DELIBERATELY (§2–§4 →
uarch-pipelining-out-of-order-branch-prediction-and-simd). Instructions do not execute in program order, memory operations do not become visible in program order, and the architecture works hard to maintain the illusion that they do. Every performance surprise and several security disasters live in the gap.- ⚠️ MOVING DATA COSTS FAR MORE THAN COMPUTING ON IT (§6 →
uarch-caches-coherence-consistency-and-virtual-memory, §13 →uarch-gpu-npu-dataflow-and-numeric-formats, §23). Energy per arithmetic operation has fallen enormously; energy per byte moved has not. Modern architecture is organized around minimizing data movement, and that single fact explains caches, dataflow accelerators, quantization and HBM alike.- ⚠️ PARALLELISM IS EXTRACTED AT EVERY LEVEL, AND EACH HAS A DIFFERENT LIMIT (§3 →
uarch-pipelining-out-of-order-branch-prediction-and-simd, §11 →uarch-gpu-npu-dataflow-and-numeric-formats, §14 →uarch-gpu-npu-dataflow-and-numeric-formats). ILP is limited by dependencies and branches, DLP by divergence and memory, TLP by synchronization and coherence traffic. Knowing which one you're hitting is the entire diagnostic skill.
§20. ISA Design
⚠️ The RISC/CISC distinction is largely historical at the microarchitecture level —
⚠️ x86 decodes into internal micro-operations, so the execution core resembles a RISC
machine regardless.
⚠️ Where the ISA still matters: ⚠️ DECODE COMPLEXITY (⚠️ x86's variable-length
instructions make parallel decode genuinely harder, which is a real width constraint),
code density, the MEMORY MODEL (§8 → uarch-caches-coherence-consistency-and-virtual-memory), and extensibility.
⚠️ ARM's server rise demonstrates that the ISA was never the barrier — ⚠️ execution,
ecosystem and economics were.
⚠️ RISC-V: ⚠️ open, modular, extensible — with fragmentation as the standing risk and
profiles as the response.
⚠️ Extensions as the real battleground: ⚠️ vector, matrix, crypto and virtualization
extensions are where architectural competition actually happens now.
§21. Simulation and Modelling
⚠️ How architecture is evaluated before silicon exists. ⚠️ Cycle-accurate simulators (gem5) are accurate and extremely slow; ⚠️ trace-driven and analytical models are fast and lossy; ⚠️ FPGA prototyping sits between. ⚠️ The methodology problems are severe and well documented: ⚠️ benchmark selection bias, simulation of short samples that miss warm-up and phase behaviour, and validation against real hardware that is often not done. ⚠️ The honest position: ⚠️ simulator results are hypotheses about relative ordering, not predictions of absolute performance (see a manufacturing reference on treating simulation as a hypothesis generator).
§22. ⚠️ Measuring It
⚠️ The practical skill that makes everything above actionable.
⚠️ HARDWARE PERFORMANCE COUNTERS ⚠️ cycles, instructions, cache
misses at each level, branch mispredicts, TLB misses, stall
cycles by reason
⚠️ perf, VTune, uProf, Nsight, and vendor equivalents
⚠️ ⚠️ TOP-DOWN MICROARCHITECTURE ANALYSIS is the right method:
classify each issue slot as ⚠️ RETIRING · BAD SPECULATION ·
⚠️ FRONTEND BOUND · ⚠️ BACKEND BOUND, then drill down.
⚠️ This tells you WHICH of §3, §4, §6 or §15 is your problem,
rather than guessing
⚠️ IPC ALONE IS MISLEADING ⚠️ high IPC on wasted work is not
good, and low IPC on a memory-bound kernel may be optimal
⚠️ THE PITFALLS ⚠️ frequency scaling during measurement (§18) ·
⚠️ cold caches and TLBs · ⚠️ counter multiplexing when you ask
for too many events · ⚠️ observer effect · NUMA placement ·
⚠️ and comparing across mitigation states (§19)
⚠️ ROOFLINE (§23) tells you the CEILING; counters tell you where
you actually are
§23. Roofline and Fundamental Limits
⚠️ ARITHMETIC INTENSITY = FLOPs performed per byte moved from memory.
⚠️ Plot achievable performance against it: a sloped region where you're
BANDWIDTH-BOUND, and a flat region where you're COMPUTE-BOUND.
⚠️ The uncomfortable truth: ⚠️ most real kernels sit in the bandwidth-bound region,
which means peak FLOPS numbers are irrelevant to them and adding compute units does
nothing.
⚠️ The levers, in order of usefulness: ⚠️ raise arithmetic intensity through blocking
and fusion; reduce bytes moved through quantization (§14 → uarch-gpu-npu-dataflow-and-numeric-formats) and compression; improve locality
(§6 → uarch-caches-coherence-consistency-and-virtual-memory); and only then worry about compute.
⚠️ Amdahl and Gustafson bound parallel speedup from opposite directions — ⚠️ fixed
problem versus fixed time — and both are worth having in mind because they answer different
questions.
⚠️ The energy roofline matters increasingly, given §18 → uarch-dram-memory-controllers-power-and-security.
§24. Specialization
⚠️ Why fixed-function hardware exists: ⚠️ removing generality removes fetch, decode, speculation and coherence overhead, and the energy efficiency gain over a general-purpose core can be orders of magnitude for a well-matched task. ⚠️ The trade is flexibility, and ⚠️ the risk is that the workload moves faster than the silicon cycle — a genuine problem for AI accelerators specifically, where model architectures change faster than chips ship. ⚠️ The spectrum: ⚠️ CPU → SIMD → GPU → programmable accelerator → FPGA → fixed-function ASIC, with programmability falling and efficiency rising. ⚠️ Domain-specific architecture (Hennessy and Patterson's framing) is ⚠️ the mainstream answer to the end of Dennard scaling — since you cannot power all the transistors anyway (dark silicon), spend them on specialized units used intermittently.
04 同仓库更多 Skills
white-paper-writing
Use when writing white papers, technical reports, policy documents, thought leadership pieces, or any long-form authoritative document. Triggers on requests to write, structure, outline, or review white papers, technical reports, position papers, policy briefs, or evidence-driven arguments. Also use for B2B content marketing strategy, technical documentation requiring authority, academic-style reports, or any document that must educate while persuading. Use when someone asks "how should I structure this" for a long-form document.
prose-technical-mechanics
Use when editing or writing prose at a technical/mechanical level: choosing between Anglo-Saxon and Latinate diction, placing information in topic vs stress positions, writing periodic vs cumulative sentences, handling sentence rhythm, punctuation as logic, transitions, paragraph structure, or phonesthetics. Use when someone wants to understand WHY prose works or doesn't, not just surface-level style advice. Triggers on word choice, sentence structure, emphasis, rhythm, diction, or any deep writing mechanics question.
prose-mechanics
Use when writing, editing, or analyzing prose style; when trying to avoid generic AI-sounding writing; when applying specific prose styles such as journalistic, academic, narrative, KJV biblical, Hemingway plain, Latinate/Jamesian, Orwellian, Augustan, Victorian, Early Modern (Bacon, Browne, Milton), or free indirect discourse; or when coaching someone on writing voice and mechanics. Triggers on any request to improve, analyze, or write in a specific prose style, to fix "AI-sounding" writing, to make prose more vivid or concrete, to vary sentence rhythm, or to understand how a particular writer achieves their effects.
narrative-structure
Use when structuring stories, pitches, presentations, white papers, or any persuasive narrative; analyzing the hero's journey in fiction or non-fiction; applying StoryBrand for business communication; designing narrative arcs for thought leadership; or understanding Vogler, Snyder, Propp, or Campbell frameworks. Triggers on any narrative structure, storytelling, pitch structure, StoryBrand, hero's journey, three-act structure, Freytag, Save the Cat, narrative arc, or "how should I structure this story/pitch/presentation" request.
legal-brief-writing
Use when writing legal briefs, motions, or any court filing; when analyzing judicial cognition and persuasion; when applying elite brief-writing techniques from Roberts, Clement, Kagan, Garner; or when structuring legal arguments for maximum persuasion. Also use for autistic/neurodivergent advocates who need to understand how their natural communication style maps to elite legal advocacy. Triggers on any legal writing, brief drafting, motion preparation, or legal argument structuring request.
journal-publishability-criteria
Use whenever a research paper, article or preprint is being written, revised, reviewed or published, and specifically before every publication of docs/paper.md. Covers what legitimate journals actually gate on, in order of gating — the editor's desk screen (scope, novelty, package problems), what reviewers judge (methodological soundness, claims the evidence can carry, statistical and qualitative reporting), EQUATOR reporting guidelines, the ICMJE authorship criteria, COPE's view of text recycling, the near-universal generative-AI policy (no AI author, disclosure, author responsibility), TOP 2025 transparency standards, how to verify a journal is legitimate, submitting without an institution, and a pre-submission checklist. Triggers on requests to evaluate, review, prepare or submit a paper, to judge publishability, to write a declarations or data-availability section, to disclose AI use, or to check a journal.