vertebrae.profiling
Measured inference-resource profiles for local representation benchmarks.
Classes
Outcome of an optional framework-specific profiling operation. |
|
Framework, device, and synchronization context supplied by an adapter. |
|
Framework allocator memory observed for one profiling session. |
|
In-memory model state exposed by a framework adapter. |
|
Explicit local artifact whose deployment footprint should be measured. |
|
Measured footprint for one declared deployment artifact. |
|
Aggregation of independent worker-local profiling windows. |
|
Default unavailable implementations for custom resource adapters. |
|
Observe real extractor calls without introducing repeat inference. |
|
Resource hooks for a Torch-backed extractor without forcing model loading. |
|
Resource hooks shared by Keras and TensorFlow Hub extractors. |
|
Synchronization and device metadata for JAX-backed extractors. |
|
Backend-aware resource hooks for multi-backend Keras models. |
|
Default unavailable implementations for custom resource adapters. |
Functions
|
Flatten stable local or worker-aggregate fields for result tables. |
|
Update variant storage while retaining distributed inference evidence. |
|
Reconstruct a typed local resource profile from serialized data. |
Reconstruct a typed distributed resource summary from serialized data. |
|
Reconstruct either supported profiling scope from a serialized payload. |
|
|
Aggregate worker observations without presenting them as one local run. |
Module Contents
- class vertebrae.profiling.AdapterOperationResult[source]
Outcome of an optional framework-specific profiling operation.
- class vertebrae.profiling.ResourceAdapterMetadata[source]
Framework, device, and synchronization context supplied by an adapter.
- class vertebrae.profiling.DeviceMemoryMeasurement[source]
Framework allocator memory observed for one profiling session.
- class vertebrae.profiling.ModelFootprintMeasurement[source]
In-memory model state exposed by a framework adapter.
- class vertebrae.profiling.DeploymentArtifact[source]
Explicit local artifact whose deployment footprint should be measured.
- class vertebrae.profiling.ArtifactFootprint[source]
Measured footprint for one declared deployment artifact.
- class vertebrae.profiling.DistributedResourceProfile[source]
Aggregation of independent worker-local profiling windows.
- vertebrae.profiling.resource_profile_columns(profile, *, prefix='')[source]
Flatten stable local or worker-aggregate fields for result tables.
- Parameters:
profile (ResourceProfileLike)
prefix (str)
- Return type:
Dict[str, Any]
- class vertebrae.profiling.BaseResourceProfileAdapter[source]
Default unavailable implementations for custom resource adapters.
- class vertebrae.profiling.ResourceProfiler(config, extractor, *, streaming, context=None)[source]
Observe real extractor calls without introducing repeat inference.
- Parameters:
extractor (Any)
streaming (bool)
context (Optional[Dict[str, Any]])
- vertebrae.profiling.with_distributed_embedding_footprint(profile, raw_embeddings, evaluated_embeddings, *, store=None, raw_key=None, evaluated_key=None, raw_stat=None, evaluated_stat=None, persisted_storage=True)[source]
Update variant storage while retaining distributed inference evidence.
- Parameters:
profile (Optional[DistributedResourceProfile])
raw_embeddings (Any)
evaluated_embeddings (Any)
store (Any)
raw_key (Optional[str])
evaluated_key (Optional[str])
raw_stat (Any)
evaluated_stat (Any)
persisted_storage (bool)
- Return type:
Optional[DistributedResourceProfile]
- vertebrae.profiling.resource_profile_from_dict(value)[source]
Reconstruct a typed local resource profile from serialized data.
- Parameters:
value (Dict[str, Any])
- Return type:
ResourceProfile
- vertebrae.profiling.distributed_resource_profile_from_dict(value)[source]
Reconstruct a typed distributed resource summary from serialized data.
- Parameters:
value (Dict[str, Any])
- Return type:
- vertebrae.profiling.resource_profile_like_from_dict(value)[source]
Reconstruct either supported profiling scope from a serialized payload.
- Parameters:
value (Optional[Dict[str, Any]])
- Return type:
Optional[ResourceProfileLike]
- vertebrae.profiling.aggregate_distributed_resource_profiles(profiles, *, merged_embeddings, all_shard_keys=None, store=None, merged_key=None, merged_stat=None, persisted_storage=True)[source]
Aggregate worker observations without presenting them as one local run.
- Parameters:
profiles (Sequence[Tuple[str, ResourceProfile]])
merged_embeddings (Any)
all_shard_keys (Optional[Sequence[str]])
store (Any)
merged_key (Optional[str])
merged_stat (Any)
persisted_storage (bool)
- Return type:
- class vertebrae.profiling.TorchResourceProfileAdapter(extractor, artifacts=(), *, model_getter=None, device_resolver=None, torch_loader=None)[source]
Bases:
BaseResourceProfileAdapterResource hooks for a Torch-backed extractor without forcing model loading.
- Parameters:
extractor (Any)
artifacts (Sequence[Union[str, DeploymentArtifact]])
model_getter (Optional[Callable[[], Any]])
device_resolver (Optional[Callable[[Any], Any]])
torch_loader (Optional[Callable[[], Any]])
- class vertebrae.profiling.TensorFlowResourceProfileAdapter(extractor, artifacts=(), *, model_getter=None, backend='tensorflow', profiling_device=None)[source]
Bases:
BaseResourceProfileAdapterResource hooks shared by Keras and TensorFlow Hub extractors.
- Parameters:
extractor (Any)
artifacts (Sequence[Union[str, DeploymentArtifact]])
model_getter (Optional[Callable[[], Any]])
backend (str)
profiling_device (Optional[str])
- class vertebrae.profiling.JAXResourceProfileAdapter(extractor, *, values_getter=None, jax_loader=None, backend='jax', profiling_device=None)[source]
Bases:
BaseResourceProfileAdapterSynchronization and device metadata for JAX-backed extractors.
- Parameters:
extractor (Any)
values_getter (Optional[Callable[[], Any]])
jax_loader (Optional[Callable[[], Any]])
backend (str)
profiling_device (Optional[str])
- class vertebrae.profiling.KerasResourceProfileAdapter(extractor, artifacts=(), *, profiling_device=None)[source]
Bases:
BaseResourceProfileAdapterBackend-aware resource hooks for multi-backend Keras models.
- Parameters:
extractor (Any)
artifacts (Sequence[Union[str, DeploymentArtifact]])
profiling_device (Optional[str])
- class vertebrae.profiling.ONNXResourceProfileAdapter(extractor, external_artifacts=())[source]
Bases:
BaseResourceProfileAdapterDefault unavailable implementations for custom resource adapters.
- Parameters:
extractor (Any)
external_artifacts (Sequence[Union[str, DeploymentArtifact]])