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.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.

source
ImportanceSamplers.SamplerExecutionError — Type
SamplerExecutionError

Exception 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.

source

Sampler lifecycle and devices

ImportanceSamplers.SamplerBusyError — Type
SamplerBusyError

Exception 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.

source
ImportanceSamplers.SamplerAlreadyExecutedError — Type
SamplerAlreadyExecutedError

Exception 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.

source
ImportanceSamplers.SamplerDeviceError — Type
SamplerDeviceError

Exception 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.

source

Adaptive rounds

ImportanceSamplers.AMISRoundError — Type
AMISRoundError

Exception 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.

source
ImportanceSamplers.DMPMCRoundError — Type
DMPMCRoundError

Exception 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.

source
ImportanceSamplers.APISRoundError — Type
APISRoundError

Exception 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.

source
ImportanceSamplers.CAISRoundError — Type
CAISRoundError

Exception 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.

source
ImportanceSamplers.FirstOrderGRAMISRoundError — Type
FirstOrderGRAMISRoundError

Exception 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.

source