Skip to main content

PersonalizationStorageScenario

Training scenarios · Implementation: mlsysim/engine/scenario_definitions/training.py.

Construct this scenario with keyword inputs. The fields below show the types and defaults declared by this class.

contexts personalized models stored as full copies or as one backbone plus adapters.

Notes

Equation: Independent copies=contexts*backbone_bytes; shared storage=backbone_bytes+contexts*adapter_bytes.

Assumptions: One backbone can be reused across all contexts and parameters share the declared storage width.

Excludes: Activation caches, optimizer state, and context-switching overhead.

References

Implementation references: mlsysim.physics.memory_from_params. These helper contracts state the source assumptions; the scenario binds their inputs and derives the displayed ratios and budgets.

Examples

The named registry scenario supplies the stated inputs; this is a modeled calculation, not a new measurement.

>>> from mlsysim import Scenarios
>>> scenario = Scenarios.CameraModelTenContextPersonalization
>>> round(scenario.total_savings, 6)
9.52381

Attributes

Name Description
adapter_params
adapter_size One context’s adapter storage via the same parameter-to-memory conversion.
bytes_per_param
contexts
model_params
model_size Backbone weight storage via memory_from_params; bytes follow the supplied parameter-width quantity.
per_context_savings Backbone-to-adapter size ratio for one context; excludes the amortized shared backbone.
total_copies Storage for one complete backbone copy per context.
total_savings Dimensionless ratio of independent copies to shared-backbone storage; a multiplicative saving, not a fractional reduction.
total_shared Storage for one shared backbone plus one adapter per context.

model_params

Type: Quantity.

Declared default: required.

adapter_params

Type: Quantity.

Declared default: required.

bytes_per_param

Type: Quantity.

Declared default: required.

contexts

Type: int.

Declared default: required.

model_size

engine.scenario_types.PersonalizationStorageScenario.model_size

Backbone weight storage via memory_from_params; bytes follow the supplied parameter-width quantity.

Equation: The calculation follows the stated accounting rule; the method body shows each intermediate term.

adapter_size

engine.scenario_types.PersonalizationStorageScenario.adapter_size

One context’s adapter storage via the same parameter-to-memory conversion.

Equation: The calculation follows the stated accounting rule; the method body shows each intermediate term.

total_copies

engine.scenario_types.PersonalizationStorageScenario.total_copies

Storage for one complete backbone copy per context.

Equation: self.contexts * self.model_size

total_shared

engine.scenario_types.PersonalizationStorageScenario.total_shared

Storage for one shared backbone plus one adapter per context.

Equation: self.model_size + self.contexts * self.adapter_size

total_savings

engine.scenario_types.PersonalizationStorageScenario.total_savings

Dimensionless ratio of independent copies to shared-backbone storage; a multiplicative saving, not a fractional reduction.

Equation: (self.total_copies / self.total_shared).to_base_units().magnitude

per_context_savings

engine.scenario_types.PersonalizationStorageScenario.per_context_savings

Backbone-to-adapter size ratio for one context; excludes the amortized shared backbone.

Equation: (self.model_size / self.adapter_size).to_base_units().magnitude

Back to top