Skip to main content

LabelingVersusTrainingScenario

Data scenarios · Implementation: mlsysim/engine/scenario_definitions/data.py.

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

A labeling budget against one training run: epochs over dataset_examples at throughput_per_accelerator on accelerators, priced at a low and a high hourly rate.

Notes

Equation: training hours = epochs * examples / aggregate throughput; bill = occupied device-hours * price.

Assumptions: Accelerators sustain the same fixed per-device sample rate and training volume is constant.

Excludes: Scaling loss, retries, evaluation overhead, and changes in labeling quality.

References

Derivation: training hours = epochs * examples / aggregate throughput; bill = occupied device-hours * price. The individual properties state units and intermediate accounting; this class introduces no fitted coefficient.

Examples

The named scenario supplies illustrative inputs; the output is calculated.

>>> from mlsysim import Scenarios
>>> case = Scenarios.ImageNetLabelingVersusResNetRun
>>> round(float(case.train_time.to('h').magnitude), 3)
1.251

Attributes

Name Description
accelerators
dataset_examples
epochs
labeling_budget
labeling_time_high
labeling_time_low
price_high
price_low
ratio_high Labeling budget divided by the low-price training bill, a dimensionless upper cost
ratio_low Labeling budget divided by the high-price training bill, a dimensionless lower
throughput_per_accelerator
train_cost_high High-price training bill in USD for all occupied device-hours.
train_cost_low Low-price training bill in USD for all occupied device-hours.
train_time Ideal training hours from epochs times examples divided by aggregate constant

labeling_budget

Type: Quantity.

Declared default: required.

dataset_examples

Type: Quantity.

Declared default: required.

epochs

Type: int.

Declared default: required.

throughput_per_accelerator

Type: Quantity.

Declared default: required.

accelerators

Type: int.

Declared default: required.

price_low

Type: Quantity.

Declared default: required.

price_high

Type: Quantity.

Declared default: required.

labeling_time_low

Type: Optional[Quantity].

Declared default: None.

labeling_time_high

Type: Optional[Quantity].

Declared default: None.

train_time

engine.scenario_types.LabelingVersusTrainingScenario.train_time

Ideal training hours from epochs times examples divided by aggregate constant throughput.

Equation: return (dataset_examples * epochs / (accelerators * throughput_per_accelerator)).to('hour').

train_cost_low

engine.scenario_types.LabelingVersusTrainingScenario.train_cost_low

Low-price training bill in USD for all occupied device-hours.

Equation: return (accelerators * train_time * price_low).to('USD').

train_cost_high

engine.scenario_types.LabelingVersusTrainingScenario.train_cost_high

High-price training bill in USD for all occupied device-hours.

Equation: return (accelerators * train_time * price_high).to('USD').

ratio_low

engine.scenario_types.LabelingVersusTrainingScenario.ratio_low

Labeling budget divided by the high-price training bill, a dimensionless lower cost ratio.

Equation: return (labeling_budget / train_cost_high).to('').magnitude.

ratio_high

engine.scenario_types.LabelingVersusTrainingScenario.ratio_high

Labeling budget divided by the low-price training bill, a dimensionless upper cost ratio.

Equation: return (labeling_budget / train_cost_low).to('').magnitude.

Back to top