Files
OBLITERATUS/docs/distributed-rank-local-e4.md
Joseph Magly 54a190e78a fix(distributed): bind E4 greedy steps to the replayed count and tighten admission
The E4 receipt accepted greedy_steps 1 to 8 and the builder used the
draft's value, but the worker always replays three greedy steps and
compares them exactly, so any other value passed admission and was
guaranteed to fail after the physical run. Share REFERENCE_GREEDY_STEPS = 3
between admission, the reference builder and the worker, and refuse any
other value before building.

Also compare the live PROBE config and tokenization digests with the job in
the E4 worker, record a workload/job mismatch in the Gloo agreement so both
ranks refuse together, chain the cause of a local admission failure, and
require a plain int workload.
2026-11-27 13:51:14 -05:00

3.8 KiB

Rank-local LMS-E4 workload worker (#287)

Status: EXPERIMENTAL, not_qualified. This page describes the software that an E4 physical run uses. It does not approve a profile. The binding operator contract remains the rank-local guide, including its reviewed registry ci/rank-local-profiles.json, which this change does not edit.

Why E4 needs its own oracle

E4 requires the retained workload (the logical bytes of the exported model) to exceed both hosts' physical memory (SC_PAGE_SIZE * SC_PHYS_PAGES). The E3 tiny reference is built by running the complete model on one host, which an E4 workload cannot do. StreamingLlamaReference (obliteratus/distributed/rank_local_e4.py) builds the same reference tensors from the immutable source, keeping one leaf module's weights resident at a time:

  • tokens, logits and greedy;
  • activation_<i> for every layer site;
  • the selected probe means and directions, computed by the same compute_layer_artifacts that DISTILL uses.

It refuses before any forward pass when its conservative host estimate exceeds the explicit --host-budget-bytes. The result must stay within 1 GiB.

Steps

  1. Write a job draft that sets every field of the four stage configs (stage_configs for probe, excise, verification and export) and the reviewed samples (probe harmful/harmless, verification, refusal_token_ids). Bind them with stage_config_digest and samples_digest. Add reference_inputs.tokens (at most 8 x 128) and greedy_steps, which must be 3 (REFERENCE_GREEDY_STEPS, the count the worker replays). The builder and admission refuse any other value.

  2. On one trusted host, build the reference offline:

    python scripts/build_rank_local_reference.py --source /local0/source-DIGEST \
      --draft job-draft.json --output reference.safetensors --receipt reference-receipt.json \
      --host-budget-bytes <bytes> --device cuda
    

    --device cuda streams leaves through the GPU, closer to the live numerics. The receipt records the device.

  3. Copy the reference and receipt into each rank's local job directory; no shared filesystem is used. Complete the job with "tier": "LMS-E4", workload_logical_bytes, reference, reference_digest, reference_receipt, probe_config_digest and probe_tokenization_digest.

  4. Run scripts/run_rank_local_qualification.py --job <local-job.json> on each host, as for E3, with a reviewed LMS-E4 qualification profile.

Fail-closed checks

  • Before the worker starts, on each host (admit_e4_job):
    • the profile is an E4 qualification profile;
    • the workflow is verify;
    • the declared workload equals the BF16 tensor bytes read from the local source's safetensors headers, and exceeds this host's physical memory;
    • the receipt binds the source, config, reference digest, probe config and tokenization;
    • all stage-config and sample digests match.
  • In the worker, before PROBE (admit_e4_capacity): the live manifest's logical bytes must equal the job's workload. Both ranks then exchange one bounded Gloo record, and both proceed only if they report the same workload and each exceeds its own attested capacity. A disagreement, an invalid observation or a lost peer stops both ranks.
  • Unchanged final checks: publish_qualification and the offline check_rank_local_evidence.py still require the reviewed registry record, the CUDA lane and logical_bytes above both reviewed capacities.

Limits: CPU tests (tests/test_distributed_rank_local_e4*.py) establish software behaviour only (E0/E1). Whether a streamed reference stays within the reviewed BF16 tolerances at full depth on real GPUs is open until a physical E4 run. ci/conditional-test-policy.json still describes the lane as E3. Updating that policy-bound text is a maintainer decision.