Files
OBLITERATUS/docs/distributed-model-load.md
T
Joseph MaglyandClaude Opus 5.5 2ef2a76792 feat(distributed): verify collective edits fail closed
(cherry picked from commit 2fbc38cd512f1130b4931ba5a7ffaf2e666d3008)

Ported for #244 (part 4/6). Internal-only content from the archived
commit was dropped: .aiwg records and the internal security-docs test.
Doc conflicts keep upstream wording and add only the VERIFY references.
The new Gloo test file carries the gloo marker and a duration entry.
Marked experimental in user docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:53:55 -04:00

8.4 KiB

EXPERIMENTAL distributed model-load candidate

OBLITERATUS contains an EXPERIMENTAL development adapter for loading one exact dense, bias-free, untied LlamaForCausalLM checkpoint with Transformers native tensor parallelism. This experimental TP2 stack was accepted in issue #244. It is not a supported user workflow, does not add a model-surgery command, and does not establish multi-host operation.

The default CPU/offline suite proves the schema, registry, artifact admission, placement mathematics, evidence, consensus, and failure contracts (E0/E1). The required two-GPU lane has not yet qualified an exact candidate (E2). Until that retained lane passes, documentation and tracker records must describe native TP loading as unqualified.

Exact admitted row

The registry contains one row:

Property Required value
Adapter llama-for-causal-lm-bf16-native-tp2-v1
Model/config class LlamaForCausalLM / LlamaConfig
Layout Dense, bias-free, untied Llama decoder
Precision/artifact BF16 Hugging Face safetensors only
Tensor-parallel world Exactly two ranks and two homogeneous local CUDA GPUs
Control/data planes Retained Gloo control group and explicit NCCL one-dimensional device mesh
Torch 2.13.0
Transformers 5.15.0
Accelerate 1.14.0
safetensors 0.8.0
Runtime parameter storage Ordinary rank-local Parameter objects

The project describes placement as DTensor-equivalent logical placement. It does not claim that the pinned Transformers implementation retains runtime DTensor parameter objects. The private manifest records the global shape, rank-local shape, complete shard intervals, owners, replicas/ties, hook sites, surgery roles, and local_tensor_parameter as the observed storage kind.

The fixed native plan is column-wise for the attention Q/K/V projections and MLP gate/up projections, row-wise for attention output and MLP down projections, and column-wise with gathered output for lm_head. auto, inferred, partially matched, changed, or fallback plans are refused.

Admission boundary

Model loading requires a successful fixed-membership preflight in the same process and live Gloo group. A schema-version 2 profile adds this required section to the existing closed profile:

{
  "model": {
    "adapter_id": "llama-for-causal-lm-bf16-native-tp2-v1",
    "artifact_revision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "hf_config_digest": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
    "load_timeout_seconds": 120
  }
}

artifact_revision is a 40-to-64-character lower-case hexadecimal immutable revision or project-generated fixture digest. hf_config_digest is the canonical digest of the exact admitted config.json. These fields supplement; they do not replace the preflight source/model/tokenizer, code, commit, topology, software, storage, and evidence bindings.

The source must already exist as an immutable local directory. Workers do not download models, use Hub credentials, execute remote/custom code, load pickle, install packages, compile extensions, invoke the ordinary loader, use device_map, offload, retry, or choose an alternate plan. Quantized/packed, adapter, MoE, multimodal, recurrent/SSM/hybrid, tied, custom-kernel, unknown, extra, missing, or non-BF16 state is rejected before model construction.

An exact execution also binds separate digests for the acquisition manifest, profile, code checkout, dependency lock, installed package tree, runtime, installed TP API, immutable image, CUDA Torch wheel, hardware, topology, and both process groups. The closed external profile supplies seven independently reviewed expected identities: acquisition manifest, lock, package set, runtime, installed API, image, and CUDA Torch wheel. Every candidate worker recomputes the package-set, runtime, and reviewed installed-API fingerprints and fails on drift. The session derives and validates the other fourteen bindings from the accepted profile, live preflight, process groups, mount, loaded handle, and manifest. This avoids asking an operator to predict runtime identities such as the post-preflight attestation digest. Version strings are not substitutes for these identities. The immutable-source mechanism and read-only mount/object identity must be observed; file mode bits alone are insufficient.

Lifecycle and evidence

The model session owns the transition from an accepted preflight capability to LOADED. It keeps the Gloo control group live, creates the exact NCCL data plane, contains FD1/FD2 plus Python warnings/logging, validates the model and complete placement manifest, publishes one private record per rank, reaches bounded rank consensus, and then requires unanimous LOADED stage messages. An outer process supervisor must be able to terminate native code that does not honor a Python deadline.

The internal live_model_session context yields the validated model handle and both live group capabilities only after evidence and unanimous LOADED. It keeps them guarded until the context exits, allowing later roadmap stages to continue the same lifecycle. The narrower execute_model_session wrapper is a load-only verifier: it closes the live capability and completes teardown before returning digest-only results.

Any disagreement, unexpected output, timeout, rank loss, source change, evidence failure, or uncertain cleanup aborts the whole fixed attempt. There is no fallback or in-process retry. Cleanup uncertainty is QUARANTINED; retry requires fresh run and rendezvous identities and fresh worker processes.

Full manifests remain in an owner-only local evidence directory. Collectives, CI summaries, and tracker records contain only bounded counts, digests, stable LMS_* codes, evidence tier, and result. Raw paths, hosts, device identifiers, exceptions, environment, prompts, tokens, tensors, and model values are not retained.

Evidence tiers are closed:

  • protocol_cpu proves code-verifiable E0/E1 behavior and explicitly records GPU, NCCL, and native-TP noncoverage.
  • candidate_local_gpu is permitted only after the exact two-GPU lane executes every mandatory parity, activation, manifest, resource, fault, cleanup, and evidence assertion at one signed candidate head.

Neither tier claims multi-host execution, over-one-host capacity, production readiness, transport authentication/encryption, surgery, export, or support.

Conditional two-GPU gate

The llama-tp-local-gpu gate is manual and currently not_qualified. It requires exactly two homogeneous CUDA GPUs with native BF16, Gloo and NCCL, an exact signed checkout, a local hash-verified CUDA Torch wheel, and externally provisioned exact image/package/runtime/API identities. Its tiny Llama fixture and single-process reference are generated locally and never downloaded; the read-only reference safetensors digest is bound into the acquisition record.

export OBLITERATUS_LLAMA_TP_EVIDENCE_PATH=conditional-evidence/llama-tp-hardware.json
python scripts/run_conditional_gate.py llama-tp-local-gpu
python scripts/check_llama_tp_hardware_evidence.py \
  --evidence conditional-evidence/llama-tp-hardware.json \
  --candidate-sha "$CONDITIONAL_CANDIDATE_SHA" \
  --image-digest "$OBLITERATUS_TP_IMAGE_DIGEST" \
  --lock uv.lock \
  --torch-wheel-digest "$OBLITERATUS_TP_TORCH_WHEEL_SHA256" \
  --package-digest "$OBLITERATUS_TP_PACKAGE_DIGEST" \
  --runtime-digest "$OBLITERATUS_TP_RUNTIME_DIGEST" \
  --api-digest "$OBLITERATUS_TP_API_DIGEST"

These commands are qualification tooling, not an operator model-load command. A selected CI job rejects skipped tests and missing evidence; unavailable hardware produces explicit noncoverage rather than a pass.

Deliberate remaining boundary

The EXPERIMENTAL, still-unqualified PROBE/DISTILL candidate, transactional EXCISE/rollback candidate and collective VERIFY candidate now extend the live model capability. Canonical atomic safetensors export remains future work. A multi-host support claim additionally requires evidence from the same candidate on at least two physical hosts, including a model whose admitted live state exceeds one qualified host. This local TP2 adapter does not establish that support.

See the preflight contract, conditional testing policy.