9148c358d0
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를 Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류. - 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로 자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거, 동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거. - 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming, Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business, Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로, 나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는 title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백). 원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지. - 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서. - 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는 지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지. - Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경. - 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
4.9 KiB
4.9 KiB
id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
| id | title | category | status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | verification_status | tags | raw_sources | last_reinforced | github_commit | tech_stack | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wiki-2026-0508-amdahls-law | Amdahl's Law | 10_Wiki/Topics | verified | self |
|
none | A | 0.95 | applied |
|
2026-05-10 | pending |
|
Amdahl's Law
📌 한 줄 통찰
"매 bottleneck 가 speed 의 결정". 매 90% 의 100× → 매 전체 가 매 10× 의 한계. 매 parallelization 의 ceiling. 매 어디 의 fast 보다 매 어디 의 unchangeable.
📖 핵심
매 formula
Speedup = \frac{1}{(1-P) + \frac{P}{S}}
- P: 매 parallel 가능 비율 (0..1).
- S: 매 parallel 부분 의 speedup factor (cores).
매 example
| P (parallel) | S (cores) | Total speedup |
|---|---|---|
| 0.50 | ∞ | 2× |
| 0.75 | ∞ | 4× |
| 0.90 | ∞ | 10× |
| 0.95 | ∞ | 20× |
| 0.99 | ∞ | 100× |
| 0.50 | 100 | 1.98× |
| 0.95 | 100 | 16.81× |
→ 매 serial 부분 (1-P) 가 매 absolute ceiling.
매 implication
- 매 fast core > 매 many slow core (단, P 작을 때).
- Profile 가 critical: 매 actual P 의 measure.
- Diminishing return: 매 core 의 double 의 매 always 의 2× X.
- Communication overhead: 매 real S < ideal.
- Fixed problem size assumption: 매 Gustafson 의 보완.
Gustafson's Law (보완)
Speedup = (1-P) + P \cdot S
→ 매 problem size 의 scale 가능 → 매 parallel 의 더 큰 win.
매 ML training 의 적용
- Data parallel: 매 batch 의 split → 매 P 큼. 매 communication = serial.
- Model parallel (tensor / pipeline): 매 P 가 작음. 매 communication 의 overhead.
- DeepSpeed / FSDP: 매 mixed parallel.
- Gradient accumulation: 매 effective batch ↑ 가, 매 sync 의 serial.
매 distributed system 의 적용
- Map step: 매 parallel.
- Reduce step: 매 sync — 매 serial.
- Critical path (DAG): 매 serial chain.
매 GPU
- Warp divergence: 매 control flow 의 split → 매 serial.
- Memory bandwidth: 매 compute 가 wait → 매 underutilization.
- Kernel launch overhead: 매 small kernel 의 N 개 = 매 sequential overhead.
💻 패턴
Profile (Python cProfile)
import cProfile, pstats
def main():
serial_setup() # 매 매 100 ms
parallel_compute() # 매 매 900 ms (90%)
serial_finalize() # 매 매 100 ms
cProfile.run('main()', 'out.prof')
pstats.Stats('out.prof').sort_stats('cumulative').print_stats(10)
# 매 actual P 의 calculate
P = 900 / 1100 # 0.818
# 매 100 cores 의 max speedup
speedup = 1 / ((1 - P) + P / 100) # 5.34×
Identify serial bottleneck
def amdahl_potential(profile_breakdown):
total = sum(profile_breakdown.values())
serial = profile_breakdown.get('serial', 0)
parallel = total - serial
P = parallel / total
print(f'Parallel fraction: {P:.2%}')
print(f'Max speedup (∞ cores): {1/(1-P):.2f}×')
return P
Distributed training (PyTorch DDP)
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel
dist.init_process_group(backend='nccl')
model = DistributedDataParallel(model, device_ids=[local_rank])
# 매 forward / backward 의 parallel
# 매 all-reduce gradient sync 의 serial overhead — 매 N 의 grow 의 communication 의 dominate
→ 매 small batch + many GPU = 매 communication 의 bottleneck.
🤔 결정 기준
| 상황 | 결정 |
|---|---|
| P > 0.95 | 매 cores 의 throw |
| P 0.7-0.95 | 매 8-32 core sweet |
| P < 0.5 | 매 fast core > 매 many |
| Variable problem size | Gustafson — 매 scale up |
| Communication dominant | 매 batch + locality |
기본값: 매 profile 먼저. 매 P 의 measure. 매 serial bottleneck 의 reduce.
🔗 Graph
- 부모: Parallel-Computing
- 응용: Distributed-Training · MapReduce · CUDA
- Adjacent: Profiling
🤖 LLM 활용
언제: 매 performance optimization decision. 매 GPU / cluster sizing. 매 distributed training planning. 언제 X: 매 algorithm 의 complexity 의 ignore. 매 P assumption 없이 speculate.
❌ 안티패턴
- Cores ↑ 무조건: 매 P 작 의 의미 X.
- Profile 없이 optimize: 매 wrong place 의 fight.
- Communication 무시: 매 ideal S 의 reality 의 mismatch.
- Fixed problem assumption (always): 매 Gustafson 의 lose.
- 모든 part 의 parallelize: 매 serial 도 OK.
🧪 검증 / 중복
- Verified (Amdahl 1967, IEEE).
- 신뢰도 A.
- Related: Gustafsons-Law · Parallel-Computing · Distributed-Training.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — formula + Gustafson + ML 응용 + profiling code |