configure
phasic.configure(**kwargs)Configure phasic globally — or temporarily, as a context manager.
All fields describe USER INTENT, not which library implements the feature. See PhasicConfig for the full list and per-field docstrings.
Field summary: - compute: ‘auto’ | ‘cpu’ | ‘jax-cpu’ | ‘jax-gpu’ - cpu_threads: int or None (None = auto-detect) - parallel_elimination: bool - parallel_elimination_min_subgraph: int or None - parallel_elimination_max_concurrent: int or None - svgd_strategy: ‘auto’ | ‘pmap’ | ‘vmap’ | ‘none’ - high_precision_mode: ‘auto’ | ‘always’ | ‘never’ - high_precision_bits: int or None - ill_condition_threshold: float - warn_on_ill_conditioning: bool - reward_compute_cache: bool - graph_cache: bool - cache_dir: str or None - strict: bool - verbose: bool
Returns
:_ConfigureContext-
A context-manager-shaped object. When used as a regular call (
configure(...)) the settings are applied immediately and persist until further changes. When used aswith configure(...): ...the settings are applied on entry and rolled back to their previous values on exit (including all phasic-tracked env vars).
Raises
:PTDConfigError-
On unknown kwargs, invalid values, or conflicts between configure() arguments and pre-existing env vars.
Examples
>>> import phasic
>>> # Persistent: settings stay applied.
>>> phasic.configure(compute='jax-cpu', cpu_threads=4)>>> # Temporary: rolled back at the end of the block.
>>> with phasic.configure(parallel_elimination=True,
... parallel_elimination_max_concurrent=8):
... # graph.expectation() runs with parallel elimination
... ...
>>> # Outside the block, parallel_elimination is back to False>>> # Capture the live config inside the block:
>>> with phasic.configure(high_precision_mode='always') as cfg:
... print(cfg.high_precision_bits)