ZKDV core¶
Shared ZKDV configuration and lazy backend frontends.
FloatTolerance ¶
SamplingPolicy ¶
Configure transcript-derived update sampling.
state_check_probability is kept for backwards compatibility and should
not be configured. Its only valid value is the default sentinel, -1.0.
ZKDVConfig ¶
ZKDVError ¶
Bases: RuntimeError
Base error for the public ZKDV API.
compilation ¶
Backend-neutral mechanics for compiled training functions.
CompiledFunction ¶
CompiledFunction(driver: Any, function: Callable[..., Any], trees: PyTreeAdapter, api: str)
Submit one compiled backend update through the shared pipeline ABI.
Source code in zkdv/compilation.py
PyTreeAdapter
dataclass
¶
PyTreeAdapter(flatten: Callable[[Any], tuple[list[Any], Any]], leaves: Callable[[Any], list[Any]], unflatten: Callable[[Any, list[Any]], Any])
The three tree operations used by backend-neutral result handling.
ResultSchema
dataclass
¶
ResultSchema(tree: Any, hidden_tree: Any, sources: tuple[int, ...], hidden_leaves: int, delta_leaves: int, private_delta: bool, extra_leaves: int)
Reconstruct user results without returning transaction values twice.
driver ¶
Shared lifecycle for backend-specific ZKDV drivers.
Driver ¶
Driver(path: str | Path, config: ZKDVConfig | None, *, backend: str, annotation: Any, max_in_flight: int, replay_snapshot_interval: int)
Own one backend transcript and its asynchronous pipeline lifecycle.
Source code in zkdv/driver/__init__.py
errors ¶
flowcontrol ¶
Bounded completion queue for asynchronous pipeline transactions.
PipelineQueue ¶
Bound unresolved transactions and complete their native submissions.
Source code in zkdv/flowcontrol.py
acquire ¶
acquire(policy: Policy) -> None
Admit one transaction under every active transaction's policy.
Source code in zkdv/flowcontrol.py
close ¶
Release executors after the owning driver has joined the pipeline.
Source code in zkdv/flowcontrol.py
overlap ¶
Per-transaction training and verification overlap policies.
Policy ¶
Bases: IntEnum
Control how a transaction shares device-buffer residency with its neighbors.
pipeline ¶
Shared state machine for one pending backend update.
PendingUpdate ¶
PendingUpdate(pipeline: Any, index: int, submission: Any, batch: Any, opt_state: Any, batch_evidence: Any, parameter_evidence: Any, pre_projection: Any, pre_optimizer_hash: Any, overlap: Policy)
One native submission awaiting a fused update's device evidence.
Source code in zkdv/pipeline.py
Pipeline ¶
Bases: ABC
Backend-neutral lifecycle for the native transaction pipeline.
Source code in zkdv/pipeline.py
signature ¶
Framework-independent callable signature normalization.
FunctionSignature ¶
Normalize ordinary named arguments into a stable positional ABI.
Source code in zkdv/signature.py
transaction ¶
Backend-neutral bindings for symbolic training transactions.
InputBinding
dataclass
¶
Reconstruct one registered pytree from a training invocation.
bind_input ¶
bind_input(inputs: Any, value: Any, name: str, trees: PyTreeAdapter) -> InputBinding
Bind a registered subtree to leaf positions in a function ABI.