ywkang
22fd0d2b9d
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 >
2026-05-19 11:42:45 -07:00
ywkang
e7f376ebaa
ADR-0027 rev7 (Megatron TP + worker-wait generalization) + ADR-0026 typo fix
...
ADR-0027 is a design-only change (no production code). Rev 7 closes design
across 7 iterations of review. Key decisions:
- D0 (worker-wait generalization): ctx.wait in worker context yields to
main scheduler, which drains env.run. Solves ADR-0024 Phase B orphan
bug (ring_default_ws strict xfail). Normative contracts on resume
invariant, fast-path, main-context non-reentrance, barrier
loop-until-empty, and scheduler non-progress as user contract.
- D0.5 (host-read barrier): Tensor.numpy/data/__getitem__/__repr__/copy_
auto-drain pending before reading. Closed-set via explicit registry
(T5.g). copy_ uses global-pending barrier with explicit
over-serialization tradeoff.
- D1 (torch.multiprocessing.spawn): real-PyTorch API-signature parity,
cooperative greenlet scheduler internally. Explicit non-goal on
process isolation / address space / failure isolation. Sibling
cleanup via SystemExit + SpawnException(errors) wrapping root-cause
ranks.
- D4/D5 (TP layers): ColumnParallelLinear / RowParallelLinear use
torch.launch(gemm_kernel) — no host-side torch.matmul. Yield-safety
contract normatively required for all TP forward paths.
- Supersedes ADR-0024 D7/D12/D13 as design (none landed). Source of
truth declared normative.
Test strategy: T1-T8 with numerical-correctness primary (not mean/
aggregate-only), orphan invariant direct assertion, host-read barrier
closed-set via registry. Phase 2 acceptance = 524 passed + 0 xfail
(ring_default_ws unblocked by D0).
ADR-0026 typo fix: torch.cuda.set_device → torch.ahbm.set_device in
DPPolicy docstring (ADR-0024 D10 convention).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-14 14:13:26 -07:00
ywkang
357cab525b
ADR-0026: DPPolicy intra-device only + ShardSpec structural coords
...
DPPolicy no longer carries a cross-SIP axis. SIP-level placement is
solely controlled by torch.ahbm.set_device(rank) (ADR-0024); DPPolicy
itself describes only the cube × PE layout within one SIP. ShardSpec
switches to structural (sip, cube, pe) coordinates; the flat pe_index
field/property is fully removed — silent drift between global-flat and
SIP-local interpretations was a foot-gun flagged by ADR-0024 D11.
Breaking API (explicit TypeError / AttributeError):
- DPPolicy(sip=...) / DPPolicy(num_sips=...) -> TypeError
- ShardSpec.pe_index -> AttributeError
- ShardSpec(pe_index=...) -> TypeError
- resolve_dp_policy now takes target_sip= (required), no num_sips.
Downstream migration:
- PE allocator dict keyed by (sip, cube, pe) tuples, in both
_ensure_allocators and _free_tensor. deploy_tensor uses tuple lookup.
- _create_tensor passes target_sip=current_sip; post-hoc pe_index
shifting removed entirely.
- launch._compute_local_shape drops the dp.sip branch.
- Internal resolvers (column_wise / row_wise / replicate / tiled_*)
return _LocalPeShard (cube-local identifier) instead of ShardSpec —
resolve_dp_policy lifts them to full structural coords.
Tests:
- New tests/test_adr0026_dppolicy_intra_device.py (12 tests) pins the
contract end-to-end.
- test_sip_parallel.py rewritten: SIP composition now modeled as two
resolve_dp_policy(target_sip=...) calls (ADR-0024 launcher style).
- Call-site migration: test_tensor, test_va_integration, test_va_offset,
test_runtime_api_tensor, test_tl_recv_async, test_ccl_* and benches
gemm_single_pe, gpt3_qkv, va_offset_verify, ccl_allreduce (legacy
branch) all use intra-device DPPolicy and structural ShardSpec.
Result: 523 passed, 1 strict xfail (ring_default_ws — unchanged
ADR-0024 Phase B blocker; architectural fix deferred to ADR-0027).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-14 13:02:19 -07:00
ywkang
e1084800ab
docs: add ADRs 0024–0031 for SIP-TP launcher stack
...
ADR-0024 (SIP-level TP launcher): rank = SIP abstraction, engine-routed
install, mp.spawn parity, epoch barrier, ShardSpec structural coords.
ADR-0025 (IPCQ direction addressing): address-based matching for meta
arrival and credit return; fixes 2-rank bidirectional ring deadlock.
ADR-0026 (DPPolicy intra-device only): remove sip/num_sips fields;
ShardSpec uses structural (sip, cube, pe); pe_index property removed.
ADR-0027 (Megatron-style TP API): ColumnParallelLinear / RowParallelLinear
on top of ADR-0024 launcher. Backlog until 0024/0025/0026 land.
ADR-0028 (DTensor support): stub / future work.
ADR-0029 (Hierarchical all-reduce): 3-level reduce using all_pes mapper
and multi_pe_sip_local validator from ADR-0024. Backlog.
ADR-0030 (IPCQ PhysAddr integration): blocked on ADR-0031.
ADR-0031 (PhysAddr PE-resource extension): stub; local_offset range-based
partition approach; specific ranges TBD.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-14 00:38:27 -07:00