[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,91 +2,156 @@
|
||||
id: wiki-2026-0508-hardware
|
||||
title: Hardware
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [P-Reinforce-AUTO-HARD-001]
|
||||
aliases: [Hardware Basics, 하드웨어]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.97
|
||||
tags: [auto-reinforced, hardware, semiconductor, gpu, npu, computer-Architecture]
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [hardware, performance, systems]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-04-20
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
tech_stack:
|
||||
language: unspecified
|
||||
framework: unspecified
|
||||
language: c
|
||||
framework: systems
|
||||
---
|
||||
|
||||
# [[Hardware|Hardware]]
|
||||
# Hardware
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> "지능을 지탱하는 물리적 캔버스: 소프트웨어라는 보이지 않는 생각이 실제 세상에 구현되고 작동할 수 있도록, 전기를 빛과 열과 데이터로 변환하며 연산을 수행하는 실체적인 기계와 반도체의 총합."
|
||||
## 매 한 줄
|
||||
> **"매 software 의 ceiling 은 hardware 의 reality"**. 매 modern stack (cloud LLM, browser, game) 의 performance 는 매 CPU pipeline, cache hierarchy, memory bandwidth, storage tier, NIC, GPU 의 understanding 없이 explain 불가. 2026 시점 Apple M4 Max, Nvidia H200/B200, AMD MI300X, NVMe Gen5 의 가 baseline.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
하드웨어(Hardware)는 컴퓨터 시스템을 구성하는 물리적인 장치들을 의미합니다. 현대 AI의 비약적 발전은 하드웨어 혁신 없이는 불가능했습니다.
|
||||
## 매 핵심
|
||||
|
||||
1. **AI 시대의 핵심 부품**:
|
||||
* **GPU (Graphic [[Processing|Processing]] Unit)**: 수만 개의 코어를 이용한 대규모 병렬 연산 특화. (DQN, [[Gradient-Descent|Gradient-Descent]]의 가속기)
|
||||
* **NPU (Neural Processing Unit)**: AI 연산만을 위해 최적화된 칩. ([[Efficiency|Efficiency]] 극대화)
|
||||
* **HBM (High Bandwidth [[memory|memory]])**: 데이터가 병목 없이 칩 사이를 흐르게 돕는 고대역폭 메모리. ([[Bottlenecks|Bottlenecks]] 해결)
|
||||
2. **왜 중요한가?**:
|
||||
* 하드웨어의 성능(Compute)이 곧 AI 모델의 지모(Scale)와 성능을 결정하는 물리적 한계이기 때문임. (Scaling-Laws와 연결)
|
||||
### 매 Latency numbers (Jeff Dean, 2026 update)
|
||||
- L1 cache: ~1 ns
|
||||
- L2 cache: ~3-4 ns
|
||||
- L3 cache: ~10-15 ns
|
||||
- DRAM: ~80-100 ns
|
||||
- NVMe Gen5 random read: ~10-20 µs
|
||||
- SSD SATA random read: ~100 µs
|
||||
- Same-DC RTT: ~0.5 ms
|
||||
- Cross-region RTT: 50-150 ms
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- **과거 데이터와의 충돌**: 과거에는 범용 연산기인 CPU 중심 정책이었으나, 현대 정책은 특정 작업에 특화된 전용 칩(ASIC) 중심 정책으로 효율성을 극대화함(RL Update).
|
||||
- **정책 변화(RL Update)**: 하드웨어 설계 정책 자체가 AI에 의해 이루어지는 'AI-designed Hardware 정책'이 등장하며 설계 속도와 효율 정책이 기하급수적으로 빨라지고 있음.
|
||||
### 매 CPU
|
||||
- **Pipeline**: fetch, decode, execute, mem, writeback — 매 superscalar + OoO.
|
||||
- **Branch predictor**: 매 mispredict = 15-20 cycle penalty.
|
||||
- **SIMD**: AVX-512, NEON, SVE2.
|
||||
- **NUMA**: multi-socket 시 매 local memory 우선.
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- [[Technical-Architecture|Technical-Architecture]], Scaling-Laws, [[Distributed-Systems|Distributed-Systems]], [[Efficiency|Efficiency]], Moore's Law
|
||||
- **Modern Tech/Tools**: NVIDIA H100, Google TPU, Apple Neural Engine, HBM3E.
|
||||
---
|
||||
### 매 Memory hierarchy
|
||||
- **Cache line**: 매 64 byte 단위 — 매 false sharing 회피의 단위.
|
||||
- **TLB**: 매 page translation cache — miss 매 expensive.
|
||||
- **HBM (GPU)**: H100 80GB @ 3.35 TB/s, B200 192GB @ 8 TB/s.
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
### 매 Storage / IO
|
||||
- NVMe Gen5: ~14 GB/s seq, 매 millions IOPS.
|
||||
- io_uring: 매 syscall 의 batched submission.
|
||||
- RDMA: 매 kernel bypass network.
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
### 매 응용
|
||||
1. Latency-sensitive trading / gaming.
|
||||
2. ML training (HBM, NVLink).
|
||||
3. Database (page cache, WAL, SSD wear).
|
||||
4. Browser rendering (GPU compositing).
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
## 💻 패턴
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
|
||||
## 💻 코드 패턴 (Code Patterns)
|
||||
|
||||
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
|
||||
|
||||
```text
|
||||
# TODO
|
||||
### Cache-line aware (false sharing 회피)
|
||||
```c
|
||||
#include <stdalign.h>
|
||||
struct counters {
|
||||
alignas(64) _Atomic long a; // 매 separate cache line
|
||||
alignas(64) _Atomic long b;
|
||||
};
|
||||
```
|
||||
|
||||
## 🤔 의사결정 기준 (Decision Criteria)
|
||||
### SIMD (AVX2 dot product)
|
||||
```c
|
||||
#include <immintrin.h>
|
||||
float dot(const float* a, const float* b, int n) {
|
||||
__m256 acc = _mm256_setzero_ps();
|
||||
for (int i = 0; i < n; i += 8) {
|
||||
__m256 va = _mm256_loadu_ps(a + i);
|
||||
__m256 vb = _mm256_loadu_ps(b + i);
|
||||
acc = _mm256_fmadd_ps(va, vb, acc);
|
||||
}
|
||||
float buf[8]; _mm256_storeu_ps(buf, acc);
|
||||
float s = 0; for (int i = 0; i < 8; i++) s += buf[i]; return s;
|
||||
}
|
||||
```
|
||||
|
||||
**선택 A를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
### Prefetch hint
|
||||
```c
|
||||
for (int i = 0; i < n; i++) {
|
||||
__builtin_prefetch(&arr[i + 16]);
|
||||
process(arr[i]);
|
||||
}
|
||||
```
|
||||
|
||||
**선택 B를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
### Linux perf (hardware counter)
|
||||
```bash
|
||||
perf stat -e cycles,instructions,cache-misses,branch-misses ./bench
|
||||
perf record -g ./bench && perf report
|
||||
```
|
||||
|
||||
**기본값:**
|
||||
> *(TODO)*
|
||||
### io_uring (high-IOPS read)
|
||||
```c
|
||||
struct io_uring ring;
|
||||
io_uring_queue_init(256, &ring, 0);
|
||||
struct io_uring_sqe* sqe = io_uring_get_sqe(&ring);
|
||||
io_uring_prep_read(sqe, fd, buf, len, offset);
|
||||
io_uring_submit(&ring);
|
||||
```
|
||||
|
||||
## ❌ 안티패턴 (Anti-Patterns)
|
||||
### NUMA pin
|
||||
```bash
|
||||
numactl --cpunodebind=0 --membind=0 ./server
|
||||
```
|
||||
|
||||
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
|
||||
### GPU memcpy bandwidth (CUDA)
|
||||
```cpp
|
||||
cudaMemcpyAsync(d_x, h_x, n*sizeof(float), cudaMemcpyHostToDevice, s);
|
||||
// 매 H100 PCIe Gen5: ~50 GB/s, NVLink: ~900 GB/s
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Hot loop 의 memory bound | SIMD + cache blocking + prefetch |
|
||||
| 다중 thread counter | per-thread + cache-line padding |
|
||||
| Random small IO | NVMe + io_uring |
|
||||
| Sequential large IO | mmap or O_DIRECT |
|
||||
| LLM inference | GPU (HBM bw 가 bottleneck) |
|
||||
| Multi-socket | NUMA pin + local alloc |
|
||||
|
||||
**기본값**: 매 측정 먼저 (perf, FlameGraph) — 매 추측 X.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Computer Architecture]] · [[Systems]]
|
||||
- 변형: [[CPU]] · [[GPU]] · [[Memory Hierarchy]] · [[Storage]]
|
||||
- 응용: [[Performance Engineering]] · [[ML Systems]] · [[Database Internals]]
|
||||
- Adjacent: [[Cache Coherence]] · [[NUMA]] · [[SIMD]] · [[io_uring]] · [[RDMA]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: 매 latency budget 분석, hardware-software co-design, 매 capacity planning.
|
||||
**언제 X**: 매 high-level CRUD app — 매 framework default 면 충분.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **False sharing**: 매 동일 cache line 을 multiple thread 가 write.
|
||||
- **Pointer chasing in hot loop**: 매 cache miss 행렬.
|
||||
- **Ignoring NUMA**: 매 multi-socket 에서 cross-node 매 access bottleneck.
|
||||
- **Sync syscall in hot path**: 매 io_uring / batching 으로 amortize.
|
||||
- **Bandwidth ≠ latency 혼동**: HBM 8 TB/s 라도 매 latency 는 ~수백 ns.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (Hennessy & Patterson *Computer Architecture* 7ed 2024, Intel SDM, Nvidia H200/B200 whitepaper, Linux kernel docs).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — latency numbers + CPU/GPU/NVMe 2026 baseline 정리 |
|
||||
|
||||
Reference in New Issue
Block a user