Files
OBLITERATUS/docs/distributed-two-host-qualification-runbook.md

14 KiB

Two-host TP2 physical qualification runbook (E3/E4)

Use this runbook to collect physical LMS-E3 and LMS-E4 evidence for the rank-local candidate on rented hardware. The protocol itself is described in the two-host protocol note. This runbook does not grant authorization. A passing run does not change support status, and neither does a passing checker. Only a maintainer-reviewed registry record can do that.

0. Preconditions (blockers if missing)

  • An exact signed candidate commit has been selected through the trusted manual workflow (conditional testing). This is the observation candidate. Section 2 replaces it with the final candidate that contains the reviewed registry record.
  • Written authorization for the observation-only step in section 2 on these hosts. Use scripts/observe_rank_local_profile.py from the selected signed observation candidate. Live preflight and the qualification worker require a matching registry record before collecting attestations.
  • Same-candidate LMS-E2 evidence is collected against the final candidate (section 2, step 5), not against the observation candidate.
  • Destructive fault tests are authorized in writing for these hosts.
  • For E4, a reviewed capacity model and workload whose retained bytes exceed both hosts' physical memory (SC_PAGE_SIZE * SC_PHYS_PAGES).
  • For E4, a fully bound E4 workload job for scripts/run_rank_local_qualification.py, following the E4 workload worker. That path is EXPERIMENTAL and not_qualified until physical E4 evidence is reviewed.
  • For the fault cases in section 4, a reviewed fault harness that gives each case a fresh export_id and an isolated destination. No such harness ships. Without it, run no fault case; the E3 handoff in section 6 then has no fault-case inventories and must say so.

1. Provision the two hosts

  1. Rent two distinct physical hosts with one CUDA GPU each. Use the same GPU model, driver, CUDA and software versions on both (the profile is homogeneous). Do not use two VMs on one physical machine; E3 requires distinct physical hosts.

  2. Put both hosts on a private network that only these hosts can reach. Gloo and NCCL provide no authentication or encryption.

  3. On each host, create local roots owned by the worker user, mode 0700, and disjoint from each other:

    • /local<r>/source-<digest>: the exact offline, read-only, content-addressed model source.
    • /local<r>/private-stage: staging.

    No shared filesystem is needed or used.

  4. Check out the exact candidate read-only on both hosts and run git verify-commit HEAD.

2. Build and review the exact profile

  1. Write a schema v3 profile with exact TP2 geometry (world size 2, local world size 1, coordinator 0) and a rank_storage section with scope: "qualification" and tier: "LMS-E3" (later "LMS-E4"). Give each rank its own source, staging and observed storage_digest (the value of preflight.storage_mount_digest(staging) on that host, which the attestation's storage_digest must equal). Fix the rendezvous_id now: host and device digests are keyed by it, so changing it later invalidates the reviewed hardware binding.

  2. Observation-only step (authorized hosts, no admission). Live preflight cannot produce the attestations for a new profile: run_preflight calls config_review(config) before it probes either host and refuses while the registry has no matching record. Instead, run the reviewed helper from the preconditions once per host under the launch environment in section 3. On rank 0, run the command below, using the corresponding rank-1 paths on the peer.

    PYTHONPATH="$PWD" python scripts/observe_rank_local_profile.py \
      --profile /local0/profile.json \
      --output /local0/private-observations/rank-0.json
    

    The output directory must already exist, be worker-owned, mode 0700, and have no symlink components. Existing output files are refused. Retain these review inputs in private storage. The helper verifies the exact selected commit signature with an explicit repository and scrubbed Git environment, and checks package/helper bytes against its signed tree before and after probing. The interpreter, installed dependencies, Git/GPG, import caches and already loaded modules are trusted bootstrap inputs; use a trusted, read-only checkout and runtime. This is not execution attestation. It checks observed profile identities before writing a canonical rank attestation. A publication-indeterminate error requires inspection of private output before retrying; it is not a successful record. Require the helper's exit status 0 before using output as review evidence. Path existence alone is not success or admission: publication may briefly expose bytes before a later failure and rollback, and rollback cannot retract bytes another observer already read. Discard evidence from any failed helper invocation, even if a file remains. The helper uses the same probes as preflight (SystemProbes().collect(config, launch) and _attestation(config, launch, snapshot) in obliteratus/distributed/preflight.py) and does not call run_preflight, create an attempt directory, load the model or export. These probes initialize the CUDA driver, select a device (which may create a CUDA context), and query device properties and memory. They perform no explicit tensor allocation or model kernels; driver/runtime initialization may consume device resources. CPU tests mock absent CUDA and do not qualify this physical boundary. From the candidate checkout, run rank_local.review_bindings(config, attestations) on both ranks' attestations to produce the requested bindings. They include each host's physical-memory capacity and the os-sysconf-physical-host-memory-v1 domain. The output is a request, not an approval.

  3. Open a maintainer-reviewed PR, based on current main, that adds the exact qualification record (profile_id, scope, tier, mapping_digest, policy_digest, bindings, evidence, review) to ci/rank-local-profiles.json and changes nothing else. The record binds code and policy digests, so compute it in a checkout of that PR's own head, not in the observation candidate:

    • Set the profile's code_digest to preflight.checkout_code_digest() of that checkout. It hashes every obliteratus/**/*.py file, and preflight requires the profile's code_digest to equal the live checkout's.
    • Run rank_local.review_bindings(config, attestations) there, reusing the attestations from step 2. This re-derives code_digest and adapter_digest from that checkout next to the unchanged hardware_digest.
    • Set the record's policy_digest to rank_local.policy_digest() there. It hashes the four files in rank_local.POLICY_FILES.

    Merge with no intervening change to obliteratus/**/*.py or to those policy files: just before merging, confirm that checkout_code_digest() and policy_digest() of the merge result equal the reviewed values. If main changes either input first, rebase the PR, recompute these values in the new head and have the record re-reviewed. That needs no new observation: hardware_digest depends on no code or policy input. Only a change of host, device, staging mount, host capacity or rendezvous_id needs a new observation (and a new authorization for it). Select the merged commit through the trusted manual workflow. This is the final candidate. An edited or untracked registry file is rejected (rank_local.read_review_registry).

  4. Set the profile's commit_sha to the final candidate. commit_sha is not a reviewed binding. Leave every other field, including the code_digest set in step 3, unchanged.

  5. Collect same-candidate LMS-E2 evidence from the one-host llama-tp-local-gpu lane on the final candidate. Collect E3 (section 3) and E4 (section 5) on that same final candidate.

3. Run E3

  1. An already authorized external two-rank scheduler starts one process per host. Each process runs from the final candidate checkout, with that checkout as its working directory and PYTHONPATH (the worker imports tests.conditional). TorchrunEnvironment.from_environ in obliteratus/distributed/launcher.py requires all of these variables and refuses a run when any is missing or wrong:

    Variable Value
    RANK, GROUP_RANK, ROLE_RANK 0 on the coordinator host, 1 on the peer
    LOCAL_RANK 0
    WORLD_SIZE, ROLE_WORLD_SIZE 2
    LOCAL_WORLD_SIZE 1
    MASTER_ADDR, MASTER_PORT the profile's private, allowlisted numeric endpoint
    TORCHELASTIC_RUN_ID the profile's rendezvous_id
    TORCHELASTIC_RESTART_COUNT, TORCHELASTIC_MAX_RESTARTS 0
    OBLITERATUS_RUN_ID the profile's run_id
    GLOO_SOCKET_IFNAME, NCCL_SOCKET_IFNAME the profile's network_interface

    Every other variable, including CUDA_VISIBLE_DEVICES, PATH and PYTHONPATH, must be listed in the profile's allowed_environment_keys. Secret- and proxy-bearing names are always rejected.

    Each process gets its own local job file; no job path is sent to the peer. _run_worker in tests/conditional/test_distributed_llama_tp_cuda.py reads exactly these job keys: workflow (must be "verify"), profile, candidate_sha (the final candidate), reference, reference_digest, result_directory, external_bindings, source_mount_external_evidence_digest, fixture_digest and model_config_digest. run_id and rendezvous_id come from the profile and the launch environment, not from the job. _build_fixture in that file shows the shape. A missing key surfaces only as a refusal before worker admission.

    JOB=/local0/job.json  # this host's own job file; /local1/job.json on rank 1
    CUDA_VISIBLE_DEVICES=0 python scripts/run_rank_local_qualification.py --job "$JOB"
    

    The worker refuses before admission if the profile is not a reviewed E3 CUDA qualification profile, the checkout is not the selected candidate, or the commit signature fails.

  2. Retain qualification-rank-0.json and qualification-rank-1.json, the bounded rank-local-qualification.json envelope, the coordinator's distributed-export-manifest.json, the v3 profile and the scheduler logs.

4. Fault and recovery cases (authorized hosts only)

Pending: physical fault collection is blocked until a reviewed harness exists. The shipped E3 worker hard-codes the export in _export_config() in tests/conditional/test_distributed_llama_tp_cuda.py: export_id is "5" * 32 and the output is canonical-output under each rank's staging root. A new run_id does not change the publication state path (.<output>.rank-local-state-<export_id>). The shipped worker therefore cannot give each case a fresh export_id and an isolated destination while it keeps the prior case's recovery state. Do not run these cases until a reviewed harness supplies both. The table below is the intended matrix.

Repeat with a fresh run_id and export_id for each case. Never reuse an ID.

Case Action Expected
Peer death mid-export Kill rank 1 during replication Rank 0 errors out, prior output intact, no success
Coordinator death at publication Kill rank 0 after PROMOTION_INTENT and again after COMMIT_DECIDED Rank 1 returns LMS_EXPORT_STATE_UNCERTAIN. recovery_inventory() reports outcome uncertain with decision undecided (first kill) or commit (second kill); the fence is kept, and so is the backup if one was taken
Network partition Drop the private link mid-stream Bounded timeout, both ranks fail closed

After each kill, inspect the result with rank_local.recovery_inventory(root, output, export_id) and record its output. Do not delete a fence to retry; resolving a fence needs maintainer review.

5. E4

E4 needs a separate reviewed E4 qualification record and the reviewed E4 workload worker (see preconditions). The workload goes through the public live-session and export API with budgeted StreamingLlamaReload. The checker rejects E4 unless the measured workload bytes exceed both reviewed host capacities.

6. Offline validation and handoff

Copy the artifacts to a trusted machine. Run the checker from a checkout of the final candidate with an unedited ci/rank-local-profiles.json: it reads the registry and policy files from the checkout of the obliteratus package it imports (rank_local.read_review_registry, rank_local.policy_digest), not from the evidence. Set PYTHONPATH="$PWD" so that package is this checkout and not another installed copy. In that checkout:

CANDIDATE_SHA='full-40-hex-final-candidate-sha'
ART=/path/to/retained-artifacts
test "$(git rev-parse HEAD)" = "$CANDIDATE_SHA" && git verify-commit HEAD &&
PYTHONPATH="$PWD" python scripts/check_rank_local_evidence.py --candidate-sha "$CANDIDATE_SHA" \
  --config "$ART/profile.json" --evidence "$ART/rank-local-qualification.json" \
  --rank-evidence "$ART/qualification-rank-0.json" "$ART/qualification-rank-1.json" \
  --manifest "$ART/distributed-export-manifest.json"

Keep the raw artifacts (profile, rank evidence, envelope, manifest, scheduler logs and inventories) in maintainer-controlled storage. Do not post them to #287: the profile and logs carry the rendezvous_id that keys the host and device digests, and private network addresses. Post to #287 only a sanitized summary: the candidate SHA, the checker output, the SHA-256 of each retained artifact, the envelope's reviewed digests (config_digest, code_digest, policy_digest, approval_digest, mapping_digest), and, if the section 4 harness existed, each fault case's inventory outcome, decision and fence_present. Support is promoted only through a separately reviewed physical_support registry record that binds same-candidate E2, E3 and E4 digests. Release the rented hosts only after the evidence is retained.