1 lightning.finite_horizon.diagnostics.commissioning
lightning.finite_horizon.diagnostics.commissioning
Observed optimizer milestones for opt-in engineering commissioning.
These gates inspect successful transactions, never proxy batch/global-step counts. They do not certify learning quality or replace the authenticated final fit receipt. Cloned states are CPU artifacts; live tensors remain untouched.
1.1 Classes
| Name | Description |
|---|---|
| QhCommissioningMilestoneReceipt | Typed observed gate bound to CPU state bytes and declared context. |
| QhCommissioningMilestonesCallback | Observe live finite FP32 state and strict CPU scorer reconstruction. |
| QhCommissioningMilestonesConfig | Declare observed gates and source/input context before fitting. |
| QhMpsMemoryBudgetCallback | Guard observed live MPS tensor allocation after each training batch. |
| QhMpsMemoryObservation | Current allocator values and sampled maxima, never an unsampled peak. |
1.1.1 QhCommissioningMilestoneReceipt
lightning.finite_horizon.diagnostics.commissioning.QhCommissioningMilestoneReceipt(
)Typed observed gate bound to CPU state bytes and declared context.
1.1.1.1 Attributes
| Name | Description |
|---|---|
| schema_version | Fixed serialized milestone schema; version one binds observed gates rather than batch/global-step |
| successful_optimizer_updates | Positive exact completed-update gate observed after a training batch; identifies this milestone and |
| expected_device | Declared required device of live scorer parameters, gradients and moments at the gate; CPU is a |
| context_ids | Composition-provided nonempty source/config/input identities copied from the commissioning |
| state_filename | Milestone-local filename of the saved CPU online/target/optimizer/gradient state, published once |
| state_sha256 | SHA-256 of the exact saved state-file bytes; authenticates the referenced CPU artifact independently |
| strict_reload | Always true after strict scorer reconstruction and exact state equality succeed under a forked CPU |
| optimizer_evidence | Detached successful-transaction identity, tensor counts, tensor residency/dtypes and finite-support |
| memory_observation | Latest sampled MPS allocation evidence when the live-tensor guard is enabled; None for CPU gates or |
1.1.2 QhCommissioningMilestonesCallback
lightning.finite_horizon.diagnostics.commissioning.QhCommissioningMilestonesCallback(
config,
output_dir,
)Observe live finite FP32 state and strict CPU scorer reconstruction.
A gate failure interrupts engineering fitting. Construction and reload run under a forked CPU RNG, preserving the training RNG. No live parameter, gradient, moment, forward result or optimizer state is modified.
1.1.2.1 Methods
| Name | Description |
|---|---|
| on_fit_end | Require the complete engineering budget; never infer absent gates. |
1.1.2.1.1 on_fit_end
lightning.finite_horizon.diagnostics.commissioning.QhCommissioningMilestonesCallback.on_fit_end(
trainer,
pl_module,
)Require the complete engineering budget; never infer absent gates.
1.1.3 QhCommissioningMilestonesConfig
lightning.finite_horizon.diagnostics.commissioning.QhCommissioningMilestonesConfig(
)Declare observed gates and source/input context before fitting.
1.1.3.1 Attributes
| Name | Description |
|---|---|
| milestones | Strictly increasing successful-update gates; final count is engineering budget. |
| expected_device | Required live tensor residency; CPU is for focused verification only. |
| max_allocated_bytes | Opt-in live MPS tensor-allocation limit; driver/cache bytes are separate evidence. |
| context_ids | Composition-provided source/config/input identities sealed in each receipt. |
1.1.4 QhMpsMemoryBudgetCallback
lightning.finite_horizon.diagnostics.commissioning.QhMpsMemoryBudgetCallback(
max_allocated_bytes,
output_dir,
)Guard observed live MPS tensor allocation after each training batch.
Torch driver allocation includes its caching pool and other driver resources; it is recorded independently rather than compared with the live tensor limit. Sampling does not establish a true operation peak. No synchronization, cache eviction, model change or optimizer change is introduced.
1.1.5 QhMpsMemoryObservation
lightning.finite_horizon.diagnostics.commissioning.QhMpsMemoryObservation()Current allocator values and sampled maxima, never an unsampled peak.
1.1.5.1 Attributes
| Name | Description |
|---|---|
| schema_version | Fixed serialized observation schema used by the authenticated memory reader; defaults to version |
| sampling_scope | Maxima and sample_count cover this callback instance lifetime, including its train-batch-end |
| sample_count | Positive number of completed callback memory samples represented by this observation, incremented |
| current_allocated_bytes | Nonnegative live MPS tensor allocation in bytes at the latest callback sample; excludes allocator |
| driver_allocated_bytes | Nonnegative MPS driver allocation in bytes at the same latest sample, including caching and other |
| max_sampled_current_allocated_bytes | Largest live-tensor allocation in bytes among this callback instance samples; a sampled maximum, |
| max_sampled_driver_allocated_bytes | Largest driver allocation in bytes among this callback instance samples; not compared against the |
| max_allocated_bytes | Positive caller-declared live MPS tensor budget in bytes, bound into the record and checked |
| within_live_tensor_budget | Whether the latest live-tensor sample is at most max_allocated_bytes. The reader also checks the |
1.2 Functions
| Name | Description |
|---|---|
| read_commissioning_milestones | Authenticate every declared observed gate; final fit admission is separate. |
| read_mps_memory_observation | Authenticate sampled memory evidence against one declared tensor budget. |
1.2.1 read_commissioning_milestones
lightning.finite_horizon.diagnostics.commissioning.read_commissioning_milestones(
config,
output_dir,
)Authenticate every declared observed gate; final fit admission is separate.
1.2.2 read_mps_memory_observation
lightning.finite_horizon.diagnostics.commissioning.read_mps_memory_observation(
output_dir,
*,
max_allocated_bytes,
)Authenticate sampled memory evidence against one declared tensor budget.