ADR: introduce docs/history/, merge 0011+0018, prune migration cruft
- CLAUDE.md: add ADR Lifecycle subsection (superseded → docs/history/, immutable numbering, no renumber) - ADR-0011: merge ADR-0018 content as "Address Model: LA" section alongside PA / VA; status notes VA model is currently implemented - ADR-0018 / 0029 / 0031: moved to docs/history/ with status updates (0018 merged into 0011, 0029 superseded by 0032, 0031 absorbed into 0001 rev 2) - ADR-0019: rewrite Context as PE-HBM connectivity decision (self-contained, no LA model framing) - ADR-0019/0020/0021/0023/0025/0027: Status Proposed → Accepted (code verified) and prune Implementation Notes / Affected files / Test strategy / "현재 상태" sub-sections describing pre-impl state - ADR-0024/0026: same migration-flavor cleanup; 0026 also drops D6 Migration and D8 docs-update sub-decisions - ADR-0030: status simplified (blocker ADR-0031 now superseded) - SPEC.md: R10 + §0.2 reflect PA / VA / LA model names - ADR-0008/0012/0013: refresh ADR-0011 subtitle in Links 21 files changed, 553 insertions(+), 1290 deletions(-). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -53,16 +53,6 @@ PE_IPCQ: 자체 message loop에서 IpcqInitMsg 처리 (기존 capability)
|
||||
`IpcqInitMsg` 타입을 그대로 사용. 기존의 "sideband direct call" 우회만
|
||||
제거하여 convention 일원화.
|
||||
|
||||
### 현재 상태
|
||||
|
||||
- `DistributedContext` facade 존재
|
||||
- `init_process_group("ahbm")` → `AhbmCCLBackend`가 `ctx.install_ipcq` 호출
|
||||
→ `ccl/install.py`가 **sideband direct call** (`pe_ipcq._install_neighbors`)로
|
||||
PE_IPCQ에 neighbor table 설치
|
||||
- `get_rank()` 항상 `0` (single-driver)
|
||||
- `get_world_size()` fallback: 총 PE 수 (rank = PE)
|
||||
- `benches/ccl_allreduce.py`: `worker(rank=0, world_size=total_PEs)` 1회 호출
|
||||
|
||||
### 풀어야 할 문제
|
||||
|
||||
1. **공개 API에서 rank = SIP** — bench worker가 PE 개념을 알지 않도록.
|
||||
@@ -86,14 +76,6 @@ PE_IPCQ: 자체 message loop에서 IpcqInitMsg 처리 (기존 capability)
|
||||
도입하기엔 정당화가 약함. 미래에 control-plane latency 모델링 정밀도 요구가
|
||||
생기면 별도 ADR.
|
||||
|
||||
### TODO (이 ADR 구현 이후)
|
||||
|
||||
- Tensor Parallelism (ADR-0027)
|
||||
- Hierarchical all-reduce 알고리즘 설계 (ADR-0029) — 본 ADR의 mapper /
|
||||
validator registry 인프라를 활용하는 첫 사례
|
||||
|
||||
---
|
||||
|
||||
## Decision
|
||||
|
||||
### D1. rank = SIP (world_size 해석)
|
||||
@@ -835,34 +817,6 @@ Migration 스케줄:
|
||||
|
||||
## Open questions
|
||||
|
||||
### 🔴 Critical — 구현 blocker 가능성 (integration 전 반드시 검증)
|
||||
|
||||
- **`IpcqInitMsg`의 engine routing — primary implementation risk**: 현재
|
||||
sideband만 쓰여서 engine routing path가 실사용 검증되지 않은 상태. **본
|
||||
ADR 전체가 "engine routing이 동작한다"는 가정 위에 서 있다**. 이것이
|
||||
실제로 안 되면 D2, D14, T3 등이 전부 영향 받음. 반드시 **ADR 구현 착수
|
||||
전 스파이크 검증**:
|
||||
- `engine.submit(IpcqInitMsg(target_sips=..., target_cubes=..., target_pe=...))`
|
||||
가 PE_IPCQ로 정확히 배달되는지 (기존 `MmuMapMsg` / `MemoryWriteMsg` 라우팅
|
||||
패턴과 비교)
|
||||
- 미지원 시 minor hook: engine의 message-type → component-kind 매핑 테이블에
|
||||
`IpcqInitMsg → "pe_ipcq"` 등록 (localized change, topology builder /
|
||||
message schema 영향 없음)
|
||||
- 결과에 따라 D2 채택 여부가 달라질 수 있음 — 만약 routing 불가 시 sideband
|
||||
path 유지로 fallback 후 본 ADR 범위 재조정
|
||||
|
||||
- **Engine-routed install vs sideband equivalence** (D2 검증점 1-5): T3의
|
||||
equivalence test가 실제 동작하는지 스파이크. 특히 ordering independence와
|
||||
idempotency는 기존 테스트에 없는 속성이라 신규 검증 필요.
|
||||
|
||||
- **`install_ipcq()` 직접 호출자 audit** (구현 전 필수): deprecated wrapper
|
||||
전략은 적절하지만 실제 migration 리스크는 호출자 목록에 따라 다름. 착수 전
|
||||
grep audit:
|
||||
- Pattern: `install_ipcq(` (cwd 전체)
|
||||
- Scope: `src/`, `tests/`, `benches/`, `scripts/`, `src/kernbench/cli/`
|
||||
- 각 호출자의 예상 migration path (→ `dist.init_process_group` vs
|
||||
`build_install_plans` 직접)를 정리한 후 wrapper 도입
|
||||
|
||||
### 🟡 Nice-to-have — scope 경계 관련
|
||||
|
||||
- **Install timing 허용치**: SimPy 시간 상 install이 몇 ns~us 소모. 기존
|
||||
@@ -883,64 +837,6 @@ multi-level 알고리즘이 driving force가 되는 framework 진화 방향.)
|
||||
|
||||
---
|
||||
|
||||
## Test strategy
|
||||
|
||||
### T1. Launcher infrastructure
|
||||
|
||||
`tests/test_ccl_ddp_launcher.py`:
|
||||
- `test_world_size_equals_sip_count` — D1
|
||||
- `test_ahbm_set_device_binds_tensor_to_single_sip` — D10/D11
|
||||
- `test_get_rank_is_greenlet_local` — D9
|
||||
- `test_run_spawns_one_worker_per_rank` — D12/D13
|
||||
- `test_get_rank_debug_warning` — D9 warning path
|
||||
|
||||
### T2. Install plan builder
|
||||
|
||||
`tests/test_ccl_install_plan.py` (new):
|
||||
- `build_install_plans` — ring_1d × leader_only 조합 (단일 PE per rank)
|
||||
- `build_install_plans` — ring_1d × all_pes 조합 (multi-PE per rank; mapper
|
||||
framework 동작 확인, 알고리즘-무관)
|
||||
- Mapper / validator registry resolution (built-in key vs import path vs
|
||||
unknown)
|
||||
- Import path fallback (`"pkg.mod.fn"` 형식) 동작 검증
|
||||
|
||||
### T3. Engine-routed IpcqInitMsg (equivalence — 핵심 검증)
|
||||
|
||||
`tests/test_ipcq_init_routing.py` (new):
|
||||
- **Routing**: `engine.submit(IpcqInitMsg)` → 지정 PE_IPCQ가 실제 설치 수행
|
||||
- **Equivalence**: 동일한 IpcqInitMsg를 (a) sideband `_install_neighbors`
|
||||
직접 호출, (b) engine.submit 두 경로로 보낸 뒤 PE_IPCQ 최종 state
|
||||
(`_queue_pairs`, `_installed` 등) 동일성 비교
|
||||
- **Ordering independence**: 서로 다른 PE의 install msg를 engine 큐에 임의
|
||||
순서로 넣어도 최종 state가 동일
|
||||
- **Idempotency (duplicate install)**: 동일 PE에 두 번 install msg → 두
|
||||
번째는 에러 raise (policy: explicit error; D2 검증점 4 참고)
|
||||
- **Multi-PE 병렬 install**: per-PE submit이 interference 없이 완료
|
||||
- **Install 후 send 성공**: 설치 직후 `IpcqSendCmd` 실행해서 neighbor table
|
||||
state가 실제로 유효한지 확인
|
||||
|
||||
### T4. Barrier correctness
|
||||
|
||||
`tests/test_collective_barrier.py` (new):
|
||||
- Single collective 정상
|
||||
- 다중 collective 연속 호출 (epoch 격리)
|
||||
- 동일 rank의 duplicate join → RuntimeError
|
||||
- Rank 1이 all_reduce 전 종료 → SpawnException + barrier.reset()
|
||||
- Conditional branch 시 모든 rank 도달하면 정상
|
||||
|
||||
### T5. E2E
|
||||
|
||||
`tests/test_ccl_allreduce_matrix.py`:
|
||||
- `ring_tcm` / `ring_hbm` / `ring_sram` @ ws=SIP_count
|
||||
|
||||
### T6. 회귀
|
||||
|
||||
기존 `test_ccl_framework`, `test_ccl_install`, `test_ccl_topologies`,
|
||||
`test_ccl_mock_runtime`, `test_pe_ipcq`, `test_ipcq_e2e`, 기타 non-CCL
|
||||
모두 통과.
|
||||
|
||||
---
|
||||
|
||||
## Consequences
|
||||
|
||||
### Positive
|
||||
@@ -970,28 +866,3 @@ multi-level 알고리즘이 driving force가 되는 framework 진화 방향.)
|
||||
- IPCQ PE-level protocol (ADR-0023) 불변.
|
||||
- `DPPolicy` 필드 변경은 ADR-0026.
|
||||
- IO_CPU 역할 불변 (기존 transit 그대로).
|
||||
|
||||
---
|
||||
|
||||
## Affected files
|
||||
|
||||
| File | Change |
|
||||
|------|--------|
|
||||
| `src/kernbench/runtime_api/distributed.py` | D1/D2/D7/D9: world_size fallback, rank_to_sip, plan 소유, engine-routed install/launch, epoch barrier |
|
||||
| `src/kernbench/runtime_api/context.py` | D10/D11: `_AhbmNamespace`, `ctx.ahbm`, `_create_tensor`가 `target_sip` 전달 |
|
||||
| `src/kernbench/runtime_api/multiprocessing.py` (new) | D12/D13: `spawn` + scheduler + exception |
|
||||
| `src/kernbench/ccl/install_plan.py` (new) | D6: `build_install_plans`, `SipInstallPlan`, `PeInstallSpec`, `NeighborTableEntry` |
|
||||
| `src/kernbench/ccl/mappers.py` (new) | D5: `leader_only`, `all_pes`, registry + resolver |
|
||||
| `src/kernbench/ccl/validators.py` (new) | D5: validator registry + resolver |
|
||||
| `src/kernbench/ccl/install.py` | Thin deprecated compat wrapper (D14) |
|
||||
| `src/kernbench/ccl/algorithms/ring_allreduce.py` | D4: `kernel` + `kernel_args` 유지 (큰 변화 없음) |
|
||||
| `src/kernbench/ccl/algorithms/mesh_allreduce.py` | D4 동일 |
|
||||
| `src/kernbench/ccl/algorithms/tree_allreduce.py` | D4 동일 |
|
||||
| `ccl.yaml` | 각 알고리즘에 `mapper` / `validator` 선언 추가 |
|
||||
| `src/kernbench/sim_engine/engine.py` | (If needed) `IpcqInitMsg` → PE_IPCQ 라우팅 확인 hook |
|
||||
| `benches/ccl_allreduce.py` | 새 launcher 기반 rewrite |
|
||||
| `tests/test_ccl_ddp_launcher.py` (new) | T1 |
|
||||
| `tests/test_ccl_install_plan.py` (new) | T2 |
|
||||
| `tests/test_ipcq_init_routing.py` (new) | T3 |
|
||||
| `tests/test_collective_barrier.py` (new) | T4 |
|
||||
| `tests/test_ccl_allreduce_matrix.py` | T5: ws=SIP_count 단순화 |
|
||||
|
||||
Reference in New Issue
Block a user