ADR housekeeping: category prefixes, lifecycle folders, retroactive 0034-0037
Filename + lifecycle:
- ADR rename to ADR-NNNN-<cat>-title.md with 8 3-letter category prefixes
(dev / mem / lat / prog / algo / par / api / ver). Numbers stay immutable.
- ADR Lifecycle split into 3 folders, documented in CLAUDE.md Part 2:
docs/adr/ (Accepted), docs/adr-proposed/ (Proposed/Stub/Draft),
docs/adr-history/ (Superseded/Merged). Status field gains "Draft" for
retroactive docs pending verification.
Merges (one ADR per topic, no change-history annotations):
- ADR-0017 absorbs ADR-0019 (Cube NOC + per-PE HBM connectivity, 10 D-items)
- ADR-0014 absorbs ADR-0021 (PE pipeline execution model, 8 D-items incl.
TileToken self-routing and multi-op composite epilogue scope)
- ADR-0023 absorbs docs/ipcq-dma-codesign-hw.md as new "HW Realization
Notes (Informative)" section (D16-D23 + Open HW Questions). codesign-hw.md
deleted; ADR-0019/0021 moved to adr-history with one-line stub status
Retroactive documentation (G4 closures, code-verified):
- ADR-0037 forwarding component (TransitComponent: first-flit overhead,
serial worker, path-based routing, single impl/multiple names)
- ADR-0036 IO_CPU component (target_start_ns global barrier stamping,
per-cube fan-out, response aggregation)
- ADR-0035 M_CPU & M_CPU.DMA component (3 fan-out paths, DMA Resources,
target_start_ns passthrough)
- ADR-0034 HBM controller internal design (per-PC state, address-based
selection, flit-aware per-flit commit, async finalize, command-only
fallback path)
Content updates:
- ADR-0010 expanded to full CLI surface (run/probe/web), retitled
"Command Line Interface and Execution Semantics"
- ADR-0007 D2 rewritten to current state; ADR-0015 supersession notes pruned
- ADR-0005 wrapped in Decision header with D1-D5; ADR-0022 metadata
block replaced with standard Status header
- ADR-0024 trimmed to rank=SIP launcher essentials (D1-D4);
ADR-0027 cleaned of supersession history
- ADR-0033 D6 cleanup: address-based PC selection moved out of future-work
(now documented in ADR-0034 D3); related D1/D3 wording realigned
- Cross-references back-filled in 5 ADRs (G3 gaps closed)
Onboarding docs split:
- docs/onboarding/ created
- moved: hw-architecture-overview.md, latency-model.md, di-presentation.md,
ccl-author-guide{,.en}.md
- references updated in README, ADR-0023{,.en}, src/kernbench/ccl/__init__.py
Source / test / yaml: ADR-NNNN cross-references in docstrings and YAML
comments updated after the merges (ADR-0021->0014 D6, ADR-0019->0017 D8).
No behavior change.
Tooling:
- tools/verify_adr_lang_pairs.py + tests/test_verify_adr_lang_pairs.py
(ADR EN/KO pair invariant checker)
- .claude/commands/report.md tracked (/report slash command)
- .gitignore: allow .claude/commands/*.md while keeping settings files ignored
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -58,7 +58,7 @@ def _get_active_context():
|
||||
|
||||
|
||||
class _AhbmNamespace:
|
||||
"""torch.ahbm — per-greenlet SIP device binding (ADR-0024 D10).
|
||||
"""torch.ahbm — per-greenlet SIP device binding (ADR-0024 D3).
|
||||
|
||||
Real-PyTorch parity idiom: ``torch.cuda.set_device(rank)``. KernBench's
|
||||
backend is 'ahbm' (not CUDA), so this namespace avoids pretending to be
|
||||
@@ -124,7 +124,7 @@ class RuntimeContext:
|
||||
dc = DistributedContext()
|
||||
dc._ctx_ref = self # back-reference for AhbmCCLBackend to reach ctx.launch etc.
|
||||
self.distributed = dc
|
||||
# ADR-0024 D10: torch.ahbm (KernBench-native) + torch.accelerator
|
||||
# ADR-0024 D3: torch.ahbm (KernBench-native) + torch.accelerator
|
||||
# (PyTorch 2.x portable) namespaces for per-greenlet device binding.
|
||||
self.ahbm = _AhbmNamespace()
|
||||
self.accelerator = _AcceleratorNamespace(self.ahbm)
|
||||
@@ -472,7 +472,7 @@ class RuntimeContext:
|
||||
eff_num_pe = dp.num_pes if dp.num_pes is not None else self._pes_per_cube
|
||||
eff_num_cubes = dp.num_cubes if dp.num_cubes is not None else self._num_cubes
|
||||
# ADR-0026 D4: resolve structural coords directly at resolve time.
|
||||
# ``torch.ahbm.set_device(rank)`` (ADR-0024 D10) selects the target
|
||||
# ``torch.ahbm.set_device(rank)`` (ADR-0024 D3) selects the target
|
||||
# SIP; if unset, fall back to SIP 0 for single-driver compatibility.
|
||||
current_sip = (
|
||||
self.ahbm.current_device() if hasattr(self, "ahbm") else None
|
||||
@@ -619,7 +619,7 @@ class RuntimeContext:
|
||||
Creates per-SIP KernelLaunchMsg with local va_base per tensor
|
||||
(like host driver sending per-rank launch commands).
|
||||
|
||||
When ``_defer_wait=True`` (ADR-0024 D7), returns the list of
|
||||
When ``_defer_wait=True`` (ADR-0027 D0.4), returns the list of
|
||||
``(handle, sip_id, meta)`` tuples instead of waiting. Caller is
|
||||
responsible for waiting — used by collective ops to yield between
|
||||
submit and wait so all sibling ranks can submit first.
|
||||
@@ -786,7 +786,7 @@ class RuntimeContext:
|
||||
last_handle = h
|
||||
|
||||
if _defer_wait:
|
||||
# ADR-0024 D7: return the pending-list so the caller can yield
|
||||
# ADR-0027 D0.4: return the pending-list so the caller can yield
|
||||
# between submit and drain. Used by collective ops that need
|
||||
# all sibling ranks to submit before any rank waits.
|
||||
return [
|
||||
|
||||
@@ -178,7 +178,7 @@ class DistributedContext:
|
||||
|
||||
def __init__(self) -> None:
|
||||
self._backend: AhbmCCLBackend | None = None
|
||||
# ADR-0024 D9: greenlet-local rank registry. Bench launcher calls
|
||||
# ADR-0024 D2: greenlet-local rank registry. Bench launcher calls
|
||||
# _bind_rank(g, rank) when spawning workers; get_rank() resolves the
|
||||
# current greenlet to its rank. Unbound greenlets fall back to 0 for
|
||||
# single-driver test compat.
|
||||
@@ -220,7 +220,7 @@ class DistributedContext:
|
||||
def get_rank(self) -> int:
|
||||
"""Return the rank bound to the current greenlet (default 0).
|
||||
|
||||
ADR-0024 D9: workers spawned by the bench launcher each get a rank
|
||||
ADR-0024 D2: workers spawned by the bench launcher each get a rank
|
||||
registered via ``_bind_rank``. Callers outside any bound greenlet
|
||||
fall back to rank 0 for single-driver test compat.
|
||||
"""
|
||||
@@ -230,7 +230,7 @@ class DistributedContext:
|
||||
return int(self._rank_by_greenlet.get(g, 0))
|
||||
|
||||
def _bind_rank(self, g: Any, rank: int) -> None:
|
||||
"""Bind a greenlet to a rank so ``get_rank()`` returns it (ADR-0024 D9)."""
|
||||
"""Bind a greenlet to a rank so ``get_rank()`` returns it (ADR-0024 D2)."""
|
||||
self._rank_by_greenlet[g] = int(rank)
|
||||
|
||||
def get_backend(self) -> str:
|
||||
|
||||
@@ -65,7 +65,7 @@ def _drain_pending(ctx: Any) -> None:
|
||||
# Populate _completed so fast-path in ctx.wait short-circuits
|
||||
# on the return leg.
|
||||
ctx._completed.add(h)
|
||||
# (b) Collective backend queue (ADR-0024 D7 + D0.4-(2)).
|
||||
# (b) Collective backend queue (ADR-0027 D0.4-(2)).
|
||||
if backend is not None:
|
||||
pending_list = getattr(backend, "_pending_collective_handles", None)
|
||||
if pending_list is not None:
|
||||
|
||||
Reference in New Issue
Block a user