Admit OOM-tolerant generation diagnostics and KL capture separately from
mandatory work; when their admission fails, the existing diagnostic-skip
path runs instead of failing the phase. Mandatory demand is unchanged and
still rejects in default and strict mode.
Release unused allocator cache before observing CUDA memory at every
boundary, as the main pipeline already did, so the informed and benchmark
transitions cannot reject work the cache would serve. Resolve an explicit
unindexed "cuda" device map to the current CUDA device in admit_model_load.
Shrink the warning-scope tests by stubbing model work they do not test.
Refs #245
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run real-peak admission tests at four CPU threads in the PR suite, with the
one- and eight-thread variants marked slow, and shrink their geometry to
the smallest size that still discriminates the modelled workspace terms.
Evaluate the differential matrix per handle so every combination keeps its
invariant at a fraction of the cost. The PR core selection had grown past
its ten-minute limit.
The smaller geometries exposed CPU estimate gaps, now modelled: autocast
parameter-copy staging, SDPA operand casts under CPU autocast and per-worker
reduced-precision GEMM scratch. These stay estimate-only; CUDA calibrated
numbers are unchanged.
Refs #245
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Require retained and overwritten floating tensors to stay finite after
casting to every bound load dtype, checked in bounded chunks, in run
validation and assembled verification.
- Recompute the GSQ revision and prepared digest immediately before
spawning save_model.py and after it exits; drift refuses the spawn or
fails assembly before the output is certified.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Recompute the GSQ revision and prepared digest immediately before
spawning the child and after it exits (success, failure, interrupt);
any drift refuses the launch or binds the run as unverified source.
- Require scales to stay finite after casting to the bound load dtype,
and decoded products to be finite in that dtype, in both run-shard
validation and assembled-output verification; record run_dtype in the
manifest.
- Require every packed projection's input dimension to be divisible by
the group size, as the loader has no padding path for group strategy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refinement admits the validation gate alone, not the evaluation capture it
never runs, so default mode cannot reject a run for forwards that do not
happen. Repeated admissions inside one benchmark method, Concept Lab
action, informed/Ouroboros loop or concept evaluation share a warning
scope: each boundary still observes memory afresh, but a phase/device
warns once per invocation.
Refs #245
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- tensor_digest streams the canonical bytes through 4 MiB CPU chunks in
C order. Digests are byte-identical to the previous whole-tensor
serialization for every dtype (BF16 included), shape and stride, and
numerical._tensor_digest reuses it. VERIFY reserves the bounded 8 MiB
digest working set explicitly.
- The live VERIFY wrapper performs one unanimous combined host admission
before EXCISE starts: retained baseline + EXCISE's own journal and
restoration working set + VERIFY's peak + margin, against a single
memory observation. It denies with LMS_EXCISE_RESOURCE_DENIED before
any mutation. Rollback releases post-edit snapshots before loading the
journal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Require the exact config-group and weights key sets the pinned
assembler writes, with exact JSON types, so per-group format overrides,
block_structure, and unknown nested keys fail closed.
- Restore and back up prepared files via staged temp files and
os.replace with the recorded mode, so read-only originals roll back
cleanly and retries are not blocked by retained backups.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quality metrics are reduced in bounded 16-row chunks with float64
accumulators, so the KL intermediates no longer scale with the whole
snapshot. Padded log-probability batches are released inside the existing
voted steps. Host admission now budgets an explicit peak:
inputs + two retained snapshots + max(forward/log-prob batch, metric chunk)
+ margin. Tests cover the analytic peak, live allocation sizes, batch
lifetimes and numerical equivalence with the unchunked metrics.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Record the launch-time GSQ revision and prepared-tree digest (and any
unrecorded-digest opt-in) in the launch record, run binding, and
manifest; prepared_tree_verified requires the launch-time source to
match the pin. assemble refuses an unverified training source unless
--allow-unverified-training-source is passed.
- Fail closed on unknown top-level quantization_config keys and require
kv_cache_scheme, global_compression_ratio, and run_compressed to be
absent or null.
- Hash canonical POSIX relative paths in both tree digests (unchanged
on POSIX).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Render model.dtype and quantization.logits_dtype from the base
checkpoint's unanimous float weight dtype (safetensors headers), with a
validated --dtype override; run, validate, and assemble refuse a config
whose dtype disagrees with the base. A bf16 base renders exactly as
before.
- Preserve original permission bits across atomic prepare, backups, and
rollback; new files honor the umask.
- Download the e2e snapshot in a GSQ-interpreter subprocess so no HF
client sockets outlive the call inside pytest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Rollback after a VERIFY failure now proves the whole model against the
pristine baseline (voted, with consensus) before lifecycle emission or
journal deletion. EXCISE alone proves only its edited operations. A
failed proof keeps the journals, quarantines and reports
LMS_VERIFY_STATE_UNCERTAIN instead of a clean rollback.
- Inference-mode setup moved inside the preparation vote, so nothing
fallible sits between the vote and the TP forward. Failures inside
the forward are documented as the bounded timeout / rank-loss boundary
and tested with a real internal all_reduce.
- Retained logit rows are cloned out of the padded batch, so retained
storage equals the admitted bytes.
- The hardware evidence checker validates each attempt against its own
mount attestation while still requiring the same physical host and GPUs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Admit VALIDATE before the iterative-refinement gate, and re-admit EXCISE
afterwards, so strict mode can reject the gate before it materialises.
Treat forward workspace as estimate-only when a decoder layer is split
across devices, since the estimator would charge every participant with
the whole layer; unsplit single- and multi-GPU numbers are unchanged.
Admit the stages that informed/Ouroboros loops, Concept Lab, concept
baseline and evaluation, checkpoint verification and the benchmark script
run outside the main pipeline. Work without a qualified bound is
unmodelled: default mode warns and proceeds, strict mode rejects.
Refs #245
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adapt the ported VERIFY stage to the symmetric-failure consensus model
from part 3. Every rank-local step that can raise outside the consensus
primitives (plan/record preparation, tensor broadcasts and copies, forward
inputs, metrics, digests, evidence, summary and result construction) is
followed by a unanimous control-group vote before the next collective, and
raw records go straight into the symmetric primitives. VERIFY votes use a
dedicated sequence range disjoint from EXCISE.
Rollback now requires unanimous committed eligibility and goes through the
hardened EXCISE restoration. Journal cleanup or lifecycle failure after
acceptance quarantines with LMS_VERIFY_STATE_UNCERTAIN, and cancellation
and the deadline are rechecked before the journal is deleted and before
VERIFIED is returned. Docs use the upstream #244 framing and are marked
EXPERIMENTAL.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Patch the pinned assembler to also copy chat_template.jinja,
chat_template.json, chat_templates/*.jinja, added_tokens.json,
processor_config.json, and video_preprocessor_config.json; the
prepared tree digest is updated accordingly.
- Bind those files in the base-model hash set so drift before or during
assembly is refused.
- Require each such base file to appear byte-identical in the assembled
output.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Carry dequantization provenance into the post-conversion load check so
converted weights keep their estimated tier without charging conversion
workspace twice; admit_model_load gains an additive `dequantized` keyword.
Charge generation scores and logits retained by output_scores or
output_logits as a separate estimated component instead of inflating the
calibrated forward demand, which is unchanged when they are off.
Refs #245
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Mirror compressed-tensors ignore matching for packed Linear modules,
including plain class-name entries ("Linear", "Module"), so a
class-wide ignore that would skip packed projections is rejected.
- Require every packed group's decoded weights (unpacked codes times
scale, in the scale dtype) to be finite in both run-shard validation
and assembled-output verification, checked in bounded row chunks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(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>
A rank-local preparation failure in gloo_all_gather_records,
require_consensus_digest or unanimous_vote now still joins the same
fixed-shape all_gather with a poison payload; the failing rank re-raises its
own error and every peer raises ContractError, so no rank can leave for a
different collective. The fixed-buffer/identical-bytes boundary is documented
as the process-fault limit handled by the bounded timeout and rank-loss path.
EXCISE now checks cancellation and the deadline after the final operation
before returning COMMITTED, and public rollback's ABORTING/ABORTED lifecycle
emissions are covered by quarantine handling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep basic distillation calibrated when the pipeline carries inactive SAE
metadata, and keep the ordinary-edit component calibrated when optional
operations add work on top of surgery. Emit one admission warning per
phase and device across a whole SUMMON invocation (dequantization and
load), while still running both capacity checks.
Model per-thread CPU Flash attention packing and LoRA GEMM workspace plus
allocator granularity, and pin torch threads (1/4/8) in every real-peak
test through shared helpers so the bounds hold on multi-core CI runners.
Shrink the slow admission peak tests below five seconds.
Refs #245
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Re-verify consumed shards, progress.json, base-model files, and the
GSQ/model configs after save_model.py returns; refuse if any changed
during assembly.
- Require quantization_status "compressed", no input/output activation
schemes, and the static, non-reordered weight scheme the pinned
assembler writes.
- Require assembled index references to be plain top-level
assembler-named shards contained in the output directory.
- Map the GSQ source pin, CLI entrypoint, and docs to the GSQ tests, and
let mapped non-production paths select their surface tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Hold an exclusive launch lock in the checkpoint directory for the
snapshot-launch-bind sequence; never overwrite a run binding and refuse
run directories that predate the launch.
- Refuse configs whose activation buffers would reach the disk-backed
mmap threshold.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Require explicit 2-bit symmetric GPTQ+GSQ settings, matching group
sizes, num_workers 0, and the in-RAM activation threshold at launch,
validation, and assembly.
- Require the base index key set to equal the top-level shard keys.
- Match ignore entries with compressed-tensors semantics (re.match).
- Apply digest exclusions to checkout-relative path components.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit ba6e1bb45a964dd0980b2e1440debd93cf94da45)
Ported for #244 (part 3/6). Internal-only content from the archived
commit was dropped: .aiwg records and the internal security-docs test.
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>
Tag each demand component calibrated or estimated. Default mode rejects
only when calibrated demand exceeds free memory and warns once per phase
and device about estimated or unmodelled overage. OBLITERATUS_PHASE_ADMISSION
gains strict (reject on the total) next to off. A data-driven matrix test
checks that default mode never rejects runs main can complete.
Refs #245
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Compute the prospective prepared-tree digest from staged contents and
refuse before writing anything when it does not match the record.
- Refuse a standalone model.safetensors beside an assembled index, even
when the index references it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Require the base weight index to reference exactly the top-level
shards and map each key to the file that holds it; include the index
in the launch hash set.
- Bind the single new run directory when the GSQ child is interrupted,
recording the interruption, then re-raise.
- Require assembled output to be a single model.safetensors or an index
covering exactly the shards present.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Copy the pre-launch config and base-model hashes into the run binding
and refuse to bind if either changed during training.
- Bind a single new run directory even after a non-zero exit, recording
the exit status and completed layer, so validate --allow-partial can
certify the prefix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve attention compute dtype per projection, account for Mamba2
torch-fallback scan intermediates and the LoRA construct/merge path, and
flag Bayesian optimization as unmodelled before optimizer work.
Refs #245
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Refuse --resume; record a launch binding (config and base-model
hashes) in the single run directory a launch creates, and require it
when validating against a GSQ config.
- Refuse unindexed tensors inside assembled shards.
- Pin WORLD_SIZE/RANK/LOCAL_RANK for the GSQ child and drop inherited
torch.distributed launcher variables.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Fail closed on any tensor key present in more than one base shard.
- Restrict the workflow to single-GPU runs; the pinned distributed
Qwen3.5 lookup is not prefix-safe and is unvalidated.
- Require the assembled compressed-tensors metadata to declare the exact
4-bit symmetric group pack container with the validated group size.
- Fail the opted-in e2e gate when the checkout variable is missing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Default the base model directory to the config's directory when
weights exist there, always derive assembly shapes from base weights,
and compare packed weight_shape with the base in the output verifier.
- Once the e2e gate is explicitly enabled, fail (not skip) on missing
checkout, unrunnable interpreter, or failed CUDA probe; the decision
logic is covered by CPU tests in the default gate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Share eligibility and selection helpers with execution, use realized
dtypes and per-batch lengths, deduplicate tied checkpoint storage, skip
unconsumed checkpoint keys, follow PyTorch's CPU SDPA dispatch, and
account for hidden-state outputs and validation-gate workspace.
Refs #245
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Require a new or empty assembly output directory and refuse weight
files the loader could prefer over the assembled index.
- Require complete packed/scale/shape trios and an exact match between
assembled packed modules and the validated projection set.
- Cross-check explicit projection shapes against base weights.
- Let validate --allow-partial certify genuinely interrupted runs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Dispatch llama, qwen3, and qwen3.5 models from the declared config
model type regardless of the path name.
- Require --model-config to be the base model's own config.json and
reject configs whose topology disagrees with the base weights;
partial assembly requires a matching partial validation.
- Reject zero-point and group-index tensors for the symmetric packed
container in validation and post-assembly verification.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use the loader's effective dtype for native quantized loads, follow the
executed sliding-window cache and full-input eager prefill scores, charge
SDPA math-backend scores when that backend may run, admit repair
snapshots and workspaces before their phases, and resolve remote code
with the loader's revision, token and offline constraints.
Refs #245
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Switch GSQ's Qwen3 dense save path to the current compressed-tensors
packing helper, matching the Qwen3.5 patch.
- Require run-shard tensors that overwrite base weights to exist in the
base model with matching dtype/shape and finite, non-empty contents;
check every retained tensor in the assembled output the same way.
- Record promotion intent before os.replace so a post-rename interrupt
is rolled back.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Record SHA-256 of every base-model file the assembler reads or copies
and refuse assembly if any is added, removed, or changed.
- Roll back staged adapter promotions on KeyboardInterrupt/SystemExit.
- Document --no-cov for the single conditional e2e test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Charge native pre-quantized checkpoints at their stored sizes, treat
disk-offloaded weights as streaming workspace, model distillation demand
per method, apply the loader's FlashAttention fallback before admission
builds the model, and follow Falcon's executed KV-cache geometry. Paths
that cannot be modelled reject explicitly and name the opt-out.
Refs #245
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit f9a289e267889c297cefcdc67eea92c4b8eb8d4d)
Ported for #244 (part 2/6). Internal-only content from the archived
commit was dropped: .aiwg records and the internal security-docs test.
Marked experimental in user docs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Launch GSQ without GSQ_* / WANDB_* override variables and refuse
configs with environment placeholders.
- Resolve models to local snapshots at config time (Hub ids require a
revision) and require run/validate/assemble to use the same directory.
- Exclude Qwen3.5 vision and MTP modules from the assembled
quantization ignore list, and verify every dense 2-D weight in the
assembled output is ignored and every packed module is not.
- Enforce the assembler's 4-bit pack container width.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DiskSnapshot admitted six largest-tensor copies against a fixed 1 GiB
default, so any model with a tensor over ~179 MB (e.g. a large-vocabulary
embedding) could not create a restore point regardless of free memory.
staging_bytes now defaults to None, which admits half of currently
available host memory (DEFAULT_STAGING_HOST_FRACTION). Explicit values keep
their existing hard-cap semantics, min(staging_bytes, available). Rejection
stays fail-closed and names required bytes, admitted bytes, the budget
source and the snapshot.staging_bytes / staging_bytes= knob.
Closes#269
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bound unrecognised integer tensors conservatively instead of rejecting
them, wait briefly for the lifecycle grant lock and report contention
explicitly, restore export preparation state when REBIRTH is rejected,
and assert every phase's real entry work in the boundary tests.
Refs #245
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Record per-file SHA-256 of consumed shards and progress.json plus the
validation settings and GSQ config hash in the manifest; assemble
re-verifies hashes and re-runs validation before save_model.py.
- Cross-check attention/MLP, group size, and model identity between the
validation settings and the GSQ config.
- Require every shard key to belong to its file's layer and reject
quantization metadata for non-target modules (e.g. lm_head).
- Require finite scales and positive recorded shapes.
- Absolutize local model paths when rendering configs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Validate exactly the shard files the pinned assembler consumes
(layers_N filenames); reject stray or renamed shards and filename/key
layer mismatches.
- Check packed tensor dtypes, non-empty contents, and shapes against the
base model's projection shapes; fail closed without base weights.
- Record prepared_tree_verified only when the pin and tree digest both
match; refuse a manifest on digest mismatch.
- Render absolute checkpoint/log/cache paths, refuse relative
checkpoint_dir at run time, and bind assembly to the run's validated
manifest.
- Stage adapter patches and promote them atomically with rollback.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use plan_native_export/native_export_host_demand as the REBIRTH host
demand when a native plan exists and the full-model accounting
otherwise. Treat an unset generation use_cache as the model default, and
surface demand-modelling failures as phase admission errors.
Refs #245
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>