vertebrae.profiling

Measured inference-resource profiles for local representation benchmarks.

Classes

AdapterOperationResult

Outcome of an optional framework-specific profiling operation.

ResourceAdapterMetadata

Framework, device, and synchronization context supplied by an adapter.

DeviceMemoryMeasurement

Framework allocator memory observed for one profiling session.

ModelFootprintMeasurement

In-memory model state exposed by a framework adapter.

DeploymentArtifact

Explicit local artifact whose deployment footprint should be measured.

ArtifactFootprint

Measured footprint for one declared deployment artifact.

DistributedResourceProfile

Aggregation of independent worker-local profiling windows.

BaseResourceProfileAdapter

Default unavailable implementations for custom resource adapters.

ResourceProfiler

Observe real extractor calls without introducing repeat inference.

TorchResourceProfileAdapter

Resource hooks for a Torch-backed extractor without forcing model loading.

TensorFlowResourceProfileAdapter

Resource hooks shared by Keras and TensorFlow Hub extractors.

JAXResourceProfileAdapter

Synchronization and device metadata for JAX-backed extractors.

KerasResourceProfileAdapter

Backend-aware resource hooks for multi-backend Keras models.

ONNXResourceProfileAdapter

Default unavailable implementations for custom resource adapters.

Functions

resource_profile_columns(profile, *[, prefix])

Flatten stable local or worker-aggregate fields for result tables.

with_distributed_embedding_footprint(profile, ...[, ...])

Update variant storage while retaining distributed inference evidence.

resource_profile_from_dict(value)

Reconstruct a typed local resource profile from serialized data.

distributed_resource_profile_from_dict(value)

Reconstruct a typed distributed resource summary from serialized data.

resource_profile_like_from_dict(value)

Reconstruct either supported profiling scope from a serialized payload.

aggregate_distributed_resource_profiles(profiles, *, ...)

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

DistributedResourceProfile

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:

DistributedResourceProfile

class vertebrae.profiling.TorchResourceProfileAdapter(extractor, artifacts=(), *, model_getter=None, device_resolver=None, torch_loader=None)[source]

Bases: BaseResourceProfileAdapter

Resource 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: BaseResourceProfileAdapter

Resource 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: BaseResourceProfileAdapter

Synchronization 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: BaseResourceProfileAdapter

Backend-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: BaseResourceProfileAdapter

Default unavailable implementations for custom resource adapters.

Parameters: