mixle.experimental.typed_runtime.compression moduleΒΆ
Explicit exact/approximate delta transport with acknowledged error feedback.
- class CompressedDelta(method, shape, dtype, arrays, receipt, feedback_token)[source]
Bases:
objectImmutable wire payload whose residual transition is pending acknowledgement.
- Parameters:
- reconstruct()[source]
Reconstruct a dense delta in the declared dtype and shape.
- Return type:
- property payload_hash: str
Deterministic transport fingerprint.
- class CompressionAcknowledgement(key, feedback_token, payload_hash, applied, residual_l2_norm_before, residual_l2_norm_after)[source]
Bases:
objectCommitted or rejected residual transition for one delivered payload.
- class CompressionReceipt(key, method, input_bytes, payload_bytes, rank_or_nnz, realized_l2_error, relative_l2_error, pending_residual_l2_norm, exact, approximation_authorized, maximum_relative_l2_error)[source]
Bases:
objectMeasured bytes/error and authorization for one staged transport payload.
- Parameters:
- property compression_ratio: float
Dense bytes divided by transmitted payload bytes.
- class ErrorFeedbackCompressor(*, default_rank=1, default_topk_fraction=0.1, exact_threshold_bytes=4_096)[source]
Bases:
objectCompressor whose residual changes only after acknowledged payload application.
- residual(key)[source]
Return a copy of one committed error-feedback residual.
- compress(key, delta, contract, *, allow_approximation=False, maximum_relative_l2_error=None, rank=None, topk_fraction=None)[source]
Stage one payload without changing committed residual state.
Lossy transport requires
allow_approximation=True, a finite error budget, and a non-exact update contract. Merge-law metadata never authorizes approximation. Callacknowledge()after delivery/application; until then another payload forkeyis refused.
- acknowledge(delta, *, applied)[source]
Commit a staged residual only after the payload was applied, or discard it on failure.
- Parameters:
delta (CompressedDelta)
applied (bool)
- Return type:
CompressionAcknowledgement
- state_dict()[source]
Return checkpointable committed state; in-flight transitions must be resolved first.