Skip to main content

ResidualAdapterScenario

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.

Residual bottleneck adapters of width to bottleneck, one at each of sites.

Notes

Equation: Adapter parameters follow calc_residual_adapter_params; total scales by insertion-site count.

Assumptions: Identical adapter shape at every site and uniform parameter storage width.

Excludes: Base-model weights, optimizer state, and adapter quality.

References

Implementation references: mlsysim.physics.calc_residual_adapter_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.CompactEncoderResidualAdapters
>>> scenario.params_per_adapter
25360

Attributes

Name Description
adapter_bytes Storage of one adapter in decimal KB at the supplied parameter width.
bottleneck
bytes_per_param
params_per_adapter One bottleneck adapter’s parameter count from calc_residual_adapter_params, including its defined bias terms.
params_total Adapter parameter count across identical insertion sites.
sites
total_bytes Storage across all adapter sites in decimal MB; excludes the base network and training state.
width

width

Type: int.

Declared default: required.

bottleneck

Type: int.

Declared default: required.

sites

Type: int.

Declared default: required.

bytes_per_param

Type: Quantity.

Declared default: required.

params_per_adapter

engine.scenario_types.ResidualAdapterScenario.params_per_adapter

One bottleneck adapter’s parameter count from calc_residual_adapter_params, including its defined bias terms.

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

params_total

engine.scenario_types.ResidualAdapterScenario.params_total

Adapter parameter count across identical insertion sites.

Equation: self.params_per_adapter * self.sites

adapter_bytes

engine.scenario_types.ResidualAdapterScenario.adapter_bytes

Storage of one adapter in decimal KB at the supplied parameter width.

Equation: (self.params_per_adapter * self.bytes_per_param).to(‘KB’)

total_bytes

engine.scenario_types.ResidualAdapterScenario.total_bytes

Storage across all adapter sites in decimal MB; excludes the base network and training state.

Equation: (self.params_total * self.bytes_per_param).to(‘MB’)

Back to top