Errors
Troubleshooting explains common causes and remedies. Adaptive round errors preserve the pre-call learned proposal but do not restore the RNG.
Targets, weights, and transforms
ImportanceSamplers.AllZeroWeightsError — Type
AllZeroWeightsErrorException thrown when normalized weights are requested but every raw log weight is -Inf. The samples remain available and lognormalizer returns -Inf.
ImportanceSamplers.InvalidTransformError — Type
InvalidTransformError(reason, location)Raised when a finite scalar transform input cannot produce a valid logical value. location identifies the logical scalar or block without retaining a sample array.
ImportanceSamplers.SamplerExecutionError — Type
SamplerExecutionErrorException wrapping a failure from one logical sample during proposal drawing, target evaluation, proposal-density evaluation, or log-weight construction.
The phase and sample_index fields locate the failure. A batch-wide failure uses index zero because no particular sample is implicated. captured preserves the original exception and backtrace. A failed run never returns a partial result.
Sampler lifecycle and devices
ImportanceSamplers.SamplerBusyError — Type
SamplerBusyErrorException thrown when a prepared sampler is entered while it is already running. Prepared samplers are mutable and non-reentrant. Do not share one sampler between concurrent calls.
ImportanceSamplers.SamplerAlreadyExecutedError — Type
SamplerAlreadyExecutedErrorException thrown when device transfer is requested after a prepared sampler's first execution has begun. Device placement is fixed for the lifetime of an executed prepared sampler.
ImportanceSamplers.SamplerDeviceError — Type
SamplerDeviceErrorException thrown when a requested device cannot execute a prepared sampler. The reason field identifies the rejected capability, such as an unavailable backend, unspecified scalar policy, opaque target closure, CPU-only gradient source or form, unsupported proposal, or missing device RNG.
Adaptive rounds
ImportanceSamplers.AMISRoundError — Type
AMISRoundErrorException thrown when an AMIS call fails before its learned proposal can be committed. round and phase locate the failure, cause stores the underlying exception, and diagnostics reports the requested round_size, completed_rounds, and cumulative_sample_count retained through those completed rounds. Factorization failures additionally report the smallest stable covariance summary: its minimum_diagonal and maximum_absolute_entry. diagnostics.transfers counts any explicit failure-only device scalar transfers. The prepared sampler retains the proposal committed by its previous successful call.
ImportanceSamplers.NPMCRoundError — Type
NPMCRoundErrorAn N-PMC round failed before committing its fitted proposal. round, phase, cause, and diagnostics follow the AMISRoundError contract. Clipping to an all-zero adaptation population throws this error with an AllZeroWeightsError cause, even when some raw weights are nonzero.
ImportanceSamplers.DMPMCRoundError — Type
DMPMCRoundErrorException thrown when a DM-PMC round cannot complete. round and phase locate the failure, cause stores the underlying exception, and diagnostics reports the requested round size and number of completed rounds. The prepared sampler retains its pre-call proposal population.
ImportanceSamplers.APISRoundError — Type
APISRoundErrorException thrown when an APIS epoch cannot complete. round and phase locate the failure, cause stores the underlying exception, and diagnostics reports the requested epoch size and number of completed epochs. The prepared sampler retains its pre-call proposal population.
ImportanceSamplers.CAISRoundError — Type
CAISRoundErrorException thrown when a CAIS round cannot complete. round and phase locate the failure, cause stores the underlying exception, and diagnostics reports the requested round size and number of completed rounds. The prepared sampler retains its complete pre-call proposal population.
ImportanceSamplers.LAISRoundError — Type
A failed LAIS round, retaining the pre-call bank and transition state.
ImportanceSamplers.HAISRoundError — Type
A failed HAIS phase, retaining the pre-call bank and HMC state.
ImportanceSamplers.FirstOrderGRAMISRoundError — Type
FirstOrderGRAMISRoundErrorException thrown when a FirstOrderGRAMIS call cannot complete a round. round and phase locate the failed operation, cause retains the underlying exception, and diagnostics.completed_rounds reports how many round transitions completed. Diagnostics also contain the requested round size, bounded covariance or derivative details when applicable, and explicit device-transfer counts.
The prepared sampler's proposal population is one call-level transaction: a failure leaves the population committed before the call unchanged and returns no partial result. Random numbers consumed before the failure remain consumed.