vibespatial.runtime

Submodules

Exceptions

StrictNativeMaterializationError

Unspecified run-time error.

Classes

ExecutionMode

Enum where members are also (and must be) strings

RuntimeSelection

MaterializationBoundary

Enum where members are also (and must be) strings

MaterializationContext

MaterializationEvent

Functions

has_gpu_runtime(→ bool)

select_runtime(→ RuntimeSelection)

set_execution_mode(→ None)

Override the session execution mode. Pass None to clear.

get_requested_mode(→ ExecutionMode)

Return the session-wide requested execution mode.

set_requested_mode(mode)

Temporarily override the requested execution mode for a scope.

clear_materialization_events(→ None)

current_materialization_context(→ MaterializationContext)

get_materialization_events(→ list[MaterializationEvent])

materialization_context(→ collections.abc.Iterator[None])

record_materialization_event(→ MaterializationEvent)

combined_residency(→ Residency)

Return DEVICE when any provided value is device-resident, else HOST.

Package Contents

class vibespatial.runtime.ExecutionMode

Enum where members are also (and must be) strings

AUTO = 'auto'
GPU = 'gpu'
CPU = 'cpu'
class vibespatial.runtime.RuntimeSelection
requested: ExecutionMode
selected: ExecutionMode
reason: str
vibespatial.runtime.has_gpu_runtime() bool
vibespatial.runtime.select_runtime(requested: ExecutionMode | str = ExecutionMode.AUTO) RuntimeSelection
vibespatial.runtime.set_execution_mode(mode: ExecutionMode | str | None) None

Override the session execution mode. Pass None to clear.

Also invalidates the adaptive runtime snapshot cache so the planner re-evaluates on the next dispatch.

vibespatial.runtime.get_requested_mode() ExecutionMode

Return the session-wide requested execution mode.

Priority: explicit set_execution_mode() > env var > AUTO.

vibespatial.runtime.set_requested_mode(mode: ExecutionMode | str | None)

Temporarily override the requested execution mode for a scope.

class vibespatial.runtime.MaterializationBoundary

Enum where members are also (and must be) strings

USER_EXPORT = 'user-export'
INTERNAL_HOST_CONVERSION = 'internal-host-conversion'
DEBUG = 'debug'
class vibespatial.runtime.MaterializationContext
pipeline: str = ''
dataset: str = ''
stage: str = ''
stage_category: str = ''
class vibespatial.runtime.MaterializationEvent
surface: str
boundary: MaterializationBoundary
reason: str
operation: str = ''
detail: str = ''
pipeline: str = ''
dataset: str = ''
stage: str = ''
stage_category: str = ''
d2h_transfer: bool = False
strict_disallowed: bool = False
to_dict() dict[str, Any]
exception vibespatial.runtime.StrictNativeMaterializationError

Unspecified run-time error.

vibespatial.runtime.clear_materialization_events() None
vibespatial.runtime.current_materialization_context() MaterializationContext
vibespatial.runtime.get_materialization_events(*, clear: bool = False) list[MaterializationEvent]
vibespatial.runtime.materialization_context(*, pipeline: str = '', dataset: str = '', stage: str = '', stage_category: str = '') collections.abc.Iterator[None]
vibespatial.runtime.record_materialization_event(*, surface: str, boundary: MaterializationBoundary | str, reason: str, operation: str = '', detail: str = '', pipeline: str = '', dataset: str = '', stage: str = '', stage_category: str = '', d2h_transfer: bool = False, strict_disallowed: bool = False) MaterializationEvent
vibespatial.runtime.combined_residency(*values: object) Residency

Return DEVICE when any provided value is device-resident, else HOST.

Accepts explicit Residency values, strings, or arbitrary objects with a residency attribute. This lets dispatch wrappers preserve device stickiness without special-casing every owned-array type.