Files
OBLITERATUS/docs/distributed-rank-local.md
Joseph Magly 002e6e56e1 feat: complete local readiness across UI, MCP and memory admission
Integrate bounded admission, UI ownership and controls, opt-in durable MCP execution, rank-local TP2 groundwork, regression hardening and operator guides. Physical larger-memory and two-host qualification remain separate.
2026-10-20 17:58:20 -04:00

14 KiB

Rank-local TP2 candidate (#287)

Status: EXPERIMENTAL, not_qualified. The shipped exact-profile registry is empty. Ordinary two-host preflight/load/export still refuse before acquiring storage. There is no supported two-host UI selection. LMS-E0/E1 tests establish software behavior only; they cannot satisfy LMS-E2, LMS-E3, LMS-E4 or approve physical support. The existing one-host v1/v2 protocol and hardware checker keep their scope and schema.

This candidate chooses local storage on each rank and Gloo replication. It does not require selection or provisioning of a shared filesystem. Each source must still be the exact offline, read-only, content-addressed artifact admitted by the existing model session. Gloo/NCCL provide no claimed authentication or transport security; use the same trusted hosts and private network required by the manual qualification governance in conditional testing.

Explicit operator selection

Schema v3 extends the complete v2 profile with this required section:

{
  "rank_storage": {
    "schema_version": 1,
    "profile_id": "maintainer-reviewed-exact-profile",
    "scope": "qualification",
    "tier": "LMS-E3",
    "ranks": [
      {"rank": 0, "source": "/local0/source-DIGEST", "staging": "/local0/private-stage", "storage_digest": "64-lowercase-hex-observation"},
      {"rank": 1, "source": "/local1/source-DIGEST", "staging": "/local1/private-stage", "storage_digest": "64-lowercase-hex-observation"}
    ]
  }
}

Use exact TP2 geometry: world size two, local world size one, coordinator zero, group rank equal to global rank and local rank zero. The outer source/staging fields select rank zero; its evidence path is <rank0-stage>/<run_id>.rank-0/preflight.json. config.for_rank(rank) selects only the corresponding local roots, storage observation and evidence sink while retaining the common configuration digest. Absolute normalized staging roots must be distinct, private (0700), worker owned and disjoint from the source. No peer-provided pathname is opened. Rank-local evidence is not interchangeable with the old shared attempt receipt schema.

Each rank creates <run_id>.rank-<rank> exclusively and retains owner.json. Attempts and export IDs cannot be reused, including after failure. Preflight compares each storage observation against that rank's mapping, admits resources on every rank, and exchanges bounded lifecycle summaries over primitive Gloo frames. Load evidence is privately created on each rank; only digest-bound load summaries and source-mount summaries cross the control plane. A lost collective or teardown produces failure/quarantine with unknown peer termination. No local file is treated as evidence that a peer terminated.

Approval authority and policy ownership

OBLITERATUS distributed-runtime maintainers own storage safety, bounded wire schemas, admission and recovery. Release/conditional-testing maintainers own exact-candidate execution authorization, physical evidence review and support promotion. Operators select and observe roots, preserve evidence and resolve fences under that review. Neither an operator boolean nor an asserted digest grants a capability.

ci/rank-local-profiles.json extends the existing closed exact-model-profile pattern. It is repository policy, with no alternate registry path or environment override. Its local content must match the versioned blob in the selected Git checkout; an untracked or edited approval file is rejected. This is an additional integrity check, not a new authentication service. Maintainers must review any registry addition and select the exact signed candidate through the trusted manual workflow. A valid Git signature alone is not maintainer authorization. Neither a committed review URL nor the presence of a signed commit authenticates maintainer authority outside that trusted checkout/manual-workflow boundary. Do not execute an arbitrary signed fork as a trusted candidate.

Each closed registry record contains profile_id, scope, tier, mapping_digest, policy_digest, bindings, evidence, and a repository maintainer review URL. review_bindings(config, attestations) produces the requested exact bindings for review, never approval. These bind the Python implementation, immutable source/model/tokenizer/config/TP adapter and plan, software versions, execution/resource floors/timeouts/network policy, and ordered observed rank/host/device/storage identities. Hardware identities use the existing rendezvous salt: review the exact rendezvous and hardware observations. External package/image/runtime/API identities must additionally pass the existing exact load-profile checks on both ranks.

The rank-local hardware binding also includes each rank's actual preflight host capacity and its os-sysconf-physical-host-memory-v1 observation domain: SC_PAGE_SIZE * SC_PHYS_PAGES, bound to the observed rank and host identity. Free memory, a smaller cgroup budget and caller estimates are different domains and cannot be substituted for that physical-host capacity. Changes to capacity or its domain require a new exact hardware review.

policy_digest() explicitly binds the non-Python conditional policy, risk map, trusted manual workflow and this operator contract. The registry is excluded from that digest to avoid self-reference; its complete canonical record digest is independently bound into publication and qualification evidence. The Python code digest does not stand in for these policy bindings. Run/config/commit and export identities are additionally bound into the retained evidence, and the live checkout/code checks remain mandatory.

Qualification records have scope qualification and authorize collection only. Physical support requires a separately reviewed exact physical_support record retaining same-candidate E2/E3/E4 evidence digests. E0/E1 are rejected in that record even alongside physical evidence. Neither a passing checker nor a qualification dispatch writes approvals or changes support tables. The shipped registry contains no such approval, so physical qualification remains incomplete.

Bounded reconstruction and independent reload

Rank zero writes every reconstructed tensor, one tensor at a time, using the existing placement-aware reconstruction and verified live-state roots. It never gathers a complete model. Every tensor has one canonical safetensors file. Admission includes source-inspection overlap, retained state, the largest tensor and shard, metadata, streaming buffers, validation workspace, prior output and fresh disk/host/device observations. Each rank must satisfy its own resource limits. Peers need storage for an independent complete canonical validation tree, but not host RAM for a complete model.

Canonical weights, metadata, index and final manifest are streamed in fixed 32-KiB primitive tensor buffers. Each chunk binds the export identity, complete file digest/size, offset and chunk digest. Oversized files, nonzero padding, truncation, corruption and replay fail closed. Each receiver creates files exclusively, fsyncs and hashes the complete result, then independently reopens the safetensors, index, configuration and tokenizer. Collective votes admit every fallible local preparation and validation step. Intermediate directories are opened relative to retained directory descriptors with O_DIRECTORY and O_NOFOLLOW; every component's inode and worker ownership are rechecked. A pathname replacement cannot redirect receiver writes into a foreign directory. The export deadline and cancellation callback reach every chunk boundary. Both conditions are agreed in a fixed collective order before proceeding or aborting, including when a cancellation callback fails on only one rank.

Physical candidate export requires StreamingLlamaReload, not an arbitrary callback. It constructs a meta Llama skeleton, opens weights for one leaf module at a time, evicts those weights after each invocation, and compares bounded logits and greedy sequences against the still-live verified reference on each rank. It checks the independent tokenizer and exact key/config bindings. Prompts are bounded to eight sequences of 128 tokens and eight generated tokens. Its conservative estimator must fit the explicit semantic reload host budget before staging starts. GPU candidate sessions prohibit protocol test adapters. CPU synthetic validators remain E1 and are never physical qualification.

Publication, kill windows and recovery

Only the coordinator publishes. The rank-local publisher holds a private pinned root and an exclusive destination fence throughout staging, validation and promotion. Root/destination/staging identities, immutable source and verified live state are rechecked before unanimous STAGED votes and the final barrier. The general atomic_checkpoint_directory API remains unchanged: its exception rollback does not supply this candidate's hard-crash recovery contract.

The candidate retains append-only, fsynced records in .<output>.rank-local-state-<export_id>: PREPARED, STAGED, PROMOTION_INTENT, BACKED_UP, PROMOTED, COMMIT_DECIDED, ACKNOWLEDGED, COMPLETE, or ABORTED/UNCERTAIN/RETURN_UNCERTAIN. The new state/fence/staging directory entries are synced into their parent root. The intent file and journal directory are synced, then the parent root is synced again before the old destination moves. A failure of either required root sync prevents the destructive rename. The old tree remains in an owned backup after the destination rename through peer validation-tree cleanup, result preparation, cancellation/deadline checks and the final unanimous readiness decision. Only then does the coordinator durably record COMMIT_DECIDED, bound to the common summary, before retiring the backup and releasing the fence. Files and containing directories are synced after each rename and cleanup. The unavoidable interval between backup and destination renames can leave the destination absent after a kill; the durable intent and backup identify the recovery obligation. The publisher never claims an atomic multi-rank transaction across process death.

Before COMMIT_DECIDED, lost promotion acknowledgement or failed peer cleanup yields LMS_EXPORT_STATE_UNCERTAIN, retires the transaction and preserves the fence, backup and durable state. After the durable unanimous decision, commit is irrevocable: acknowledgement or cleanup can still fail and a caller can receive LMS_EXPORT_STATE_UNCERTAIN while another caller returns success. The journal reports the commit decision separately from return uncertainty. Backup retirement and a subsequent publisher are permitted after that decision; an old caller never recreates or adopts a fence that a subsequent publisher may own. This distinction does not claim globally atomic function returns. Before promotion, cleanup removes only directories whose captured identity still belongs to this attempt. Replaced roots or foreign staging trees are retained for inspection. recovery_inventory(root, output, export_id) reports observed durable states without renaming, deleting, adopting an attempt or inventing agreement. After a kill, inspect that state and owned artifacts under maintainer review; do not delete a fence merely to retry. No automatic recovery or retry reuses a run ID. Peer validation trees are temporary local copies, not published checkpoints.

Separate qualification lane and remaining physical work

The existing one-host check_llama_tp_hardware_evidence.py remains one-host-only. For a reviewed tiny E3 reference job, the source checkout provides scripts/run_rank_local_qualification.py --job <local-worker-job.json>, invoked by an already authorized external fixed two-rank scheduler inside the exact read-only source namespace. The job uses the existing offline tiny-Llama reference/probe/EXCISE/VERIFY inputs, a v3 profile, per-host local reference files and exact external load bindings. Each process uses its own job pathname; no peer job path is sent. It does not provision, SSH, launch hosts, select a shared backend or accept a flag as authorization. The registry must already approve that exact qualification profile. The trusted manual exact-signed-candidate review remains a prerequisite to running this worker.

Retain each local qualification-rank-N.json, the bounded rank-local-qualification.json envelope, the coordinator canonical manifest, and the exact v3 profile. After authorized evidence collection, validate copied artifacts offline:

python scripts/check_rank_local_evidence.py --candidate-sha <exact-signed-candidate> \
  --config profile.json --evidence rank-local-qualification.json \
  --rank-evidence qualification-rank-0.json qualification-rank-1.json \
  --manifest distributed-export-manifest.json

The checker rejects E0/E1/E2 substitution, wrong heads/profiles, incomplete rank measurements, host/device identity collisions, non-coordinator writers and disagreement with the manifest and reviewed registry. Publication rejects caller capacity fields that differ from actual preflight. Each retained rank record and summary binds the same capacity/domain observation, and the offline checker reconstructs the reviewed hardware digest including those observations. Editing capacities and recomputing record hashes cannot change the approved hardware. Its E4 check additionally requires measured workload bytes exceeding both reviewed physical host-memory capacities; a claimed tier alone is insufficient. The tiny reference worker is explicitly E3-only. A larger admitted workload must exercise the same public live-session/export API and budgeted streaming reload under a separately reviewed E4 physical run; the tiny full-reference oracle is not a capacity test.

Outstanding physical requirements are actual same-candidate E2 hardware results, distinct physical hosts and exact local-root observations, authorized destructive fault tests, reviewed larger-capacity E4 workload/resource evidence, protected retention and maintainer support/publication review. CPU test results cannot remove any of those requirements.