Skip to main content

ServiceLifecycleCostScenario

Economics scenarios · Implementation: mlsysim/engine/scenario_definitions/economics.py.

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

A service’s multi-year cost in three terms: repeated training cycles, recurring inference, and operations, with a GPU-hour carbon factor.

Inference: daily_users x items_per_user requests a day, each service_time of dedicated accelerator time (unbatched, not overlapped), billed at inference_rate. A training cycle is data preparation and a final run in GPU-hours at training_rate plus a search of search_experiments at search_cost_per_experiment; cycles of them over years. serving_cut and training_cut are fractional savings to compare.

Notes

Equation: Lifecycle cost adds repeated preparation/search/training cycles, dedicated inference device-hours, and recurring operations; carbon multiplies device-hours by a supplied coefficient.

Assumptions: Requests use serial unbatched dedicated service time; tariffs, volumes, annual operations, and carbon coefficients stay fixed.

Excludes: Discounting, hardware purchase accounting, dynamic batching, shared capacity, and a measured power/emissions trace.

References

Derivation: Lifecycle cost adds repeated preparation/search/training cycles, dedicated inference device-hours, and recurring operations; carbon multiplies device-hours by a supplied coefficient. This is declared scenario accounting rather than a fitted empirical law.

Examples

>>> from mlsysim import Scenarios
>>> scenario = Scenarios.RankingServiceLifecycleCost
>>> value = scenario.inferences_per_day
>>> round(float(value), 3)
200000000.0

Attributes

Name Description
carbon_per_gpu_hour
carbon_ratio Inference kilograms divided by nonzero training kilograms, dimensionless.
cost_ratio Inference USD divided by nonzero training USD over the lifetime.
cycle_cost USD per training cycle, summing preparation, search, and final training.
cycle_gpu_hours Device-hours per training cycle across preparation, search, and final training.
cycles
daily_users
data_prep_cost USD for one cycle’s preparation device-hours at the training tariff.
data_prep_time
final_run_cost USD for one final training run at the training tariff.
final_run_time
gpu_hours_per_day Dedicated accelerator hours per day, request count times serial service duration.
gpus_busy Average concurrently busy accelerators over a full day, not a peak-capacity requirement.
inference_carbon Kilograms attributed to inference device-hours using the same supplied coefficient.
inference_cost USD inference cost over the entire service lifetime.
inference_cost_per_day USD billed per day for dedicated inference device-hours.
inference_cost_per_year USD inference cost over the registered number of days per year.
inference_gpu_hours Dedicated inference device-hours over the entire service lifetime.
inference_rate
inferences_per_day Daily request count from users times items requested per user.
items_per_user
operations_annual
operations_cost USD operations cost across the declared service years, without discounting.
operations_per_year USD sum of all declared annual operations charges.
search_cost USD for all candidate search experiments within one training cycle.
search_cost_per_experiment
search_experiments
search_time Device-hours purchased by the search budget at the training tariff.
service_days Service lifetime in days, using the registered days-per-year convention.
service_time
serving_cut
serving_saving USD saved by the declared fractional inference-cost reduction.
serving_saving_carbon Kilograms avoided under the same fractional inference-work reduction.
shares Dimensionless shares of lifetime USD cost assigned to training, inference, and
total_cost USD lifetime sum of training, inference, and operations.
training_carbon Kilograms attributed to training device-hours using the supplied kg-per-device-hour
training_cost USD for every declared training cycle over the service lifetime.
training_cut
training_rate
training_saving USD saved by the declared fractional training-cost reduction.
training_saving_carbon Kilograms avoided under the same fractional training-work reduction.
years

daily_users

Type: float.

Declared default: required.

items_per_user

Type: float.

Declared default: required.

service_time

Type: Quantity.

Declared default: required.

inference_rate

Type: Quantity.

Declared default: required.

training_rate

Type: Quantity.

Declared default: required.

data_prep_time

Type: Quantity.

Declared default: required.

search_experiments

Type: int.

Declared default: required.

search_cost_per_experiment

Type: Quantity.

Declared default: required.

final_run_time

Type: Quantity.

Declared default: required.

cycles

Type: int.

Declared default: required.

years

Type: int.

Declared default: required.

operations_annual

Type: Dict[str, Quantity].

Declared default: required.

carbon_per_gpu_hour

Type: Quantity.

Declared default: required.

serving_cut

Type: float.

Declared default: 0.0.

training_cut

Type: float.

Declared default: 0.0.

inferences_per_day

engine.scenario_types.ServiceLifecycleCostScenario.inferences_per_day

Daily request count from users times items requested per user.

Equation: daily_users * items_per_user.

gpu_hours_per_day

engine.scenario_types.ServiceLifecycleCostScenario.gpu_hours_per_day

Dedicated accelerator hours per day, request count times serial service duration.

Equation: (inferences_per_day * service_time).to('hour').

gpus_busy

engine.scenario_types.ServiceLifecycleCostScenario.gpus_busy

Average concurrently busy accelerators over a full day, not a peak-capacity requirement.

Equation: gpu_hours_per_day.to('hour').magnitude / HOURS_PER_DAY.

inference_cost_per_day

engine.scenario_types.ServiceLifecycleCostScenario.inference_cost_per_day

USD billed per day for dedicated inference device-hours.

Equation: (gpu_hours_per_day * inference_rate).to('dollar').

inference_cost_per_year

engine.scenario_types.ServiceLifecycleCostScenario.inference_cost_per_year

USD inference cost over the registered number of days per year.

Equation: (inference_cost_per_day * DAYS_PER_YEAR).to('dollar').

data_prep_cost

engine.scenario_types.ServiceLifecycleCostScenario.data_prep_cost

USD for one cycle’s preparation device-hours at the training tariff.

Equation: (data_prep_time * training_rate).to('dollar').

search_cost

engine.scenario_types.ServiceLifecycleCostScenario.search_cost

USD for all candidate search experiments within one training cycle.

Equation: (search_experiments * search_cost_per_experiment).to('dollar').

search_time

engine.scenario_types.ServiceLifecycleCostScenario.search_time

Device-hours purchased by the search budget at the training tariff.

Equation: (search_cost / training_rate).to('hour').

final_run_cost

engine.scenario_types.ServiceLifecycleCostScenario.final_run_cost

USD for one final training run at the training tariff.

Equation: (final_run_time * training_rate).to('dollar').

cycle_cost

engine.scenario_types.ServiceLifecycleCostScenario.cycle_cost

USD per training cycle, summing preparation, search, and final training.

Equation: (data_prep_cost + search_cost + final_run_cost).to('dollar').

cycle_gpu_hours

engine.scenario_types.ServiceLifecycleCostScenario.cycle_gpu_hours

Device-hours per training cycle across preparation, search, and final training.

Equation: (data_prep_time + search_time + final_run_time).to('hour').

training_cost

engine.scenario_types.ServiceLifecycleCostScenario.training_cost

USD for every declared training cycle over the service lifetime.

Equation: (cycle_cost * cycles).to('dollar').

service_days

engine.scenario_types.ServiceLifecycleCostScenario.service_days

Service lifetime in days, using the registered days-per-year convention.

Equation: DAYS_PER_YEAR * years.

inference_gpu_hours

engine.scenario_types.ServiceLifecycleCostScenario.inference_gpu_hours

Dedicated inference device-hours over the entire service lifetime.

Equation: (gpu_hours_per_day * service_days).to('hour').

inference_cost

engine.scenario_types.ServiceLifecycleCostScenario.inference_cost

USD inference cost over the entire service lifetime.

Equation: (inference_cost_per_day * service_days).to('dollar').

operations_per_year

engine.scenario_types.ServiceLifecycleCostScenario.operations_per_year

USD sum of all declared annual operations charges.

Equation: sum(operations_annual.values(), Q_(0, 'dollar')).to('dollar').

operations_cost

engine.scenario_types.ServiceLifecycleCostScenario.operations_cost

USD operations cost across the declared service years, without discounting.

Equation: (operations_per_year * years).to('dollar').

total_cost

engine.scenario_types.ServiceLifecycleCostScenario.total_cost

USD lifetime sum of training, inference, and operations.

Equation: (training_cost + inference_cost + operations_cost).to('dollar').

shares

engine.scenario_types.ServiceLifecycleCostScenario.shares

Dimensionless shares of lifetime USD cost assigned to training, inference, and operations.

Equation: {'training': (training_cost / t).to('').magnitude, 'inference': (inference_cost / t).to('').magnitude, 'operations': (operations_cost / t).to('').magnitude}.

cost_ratio

engine.scenario_types.ServiceLifecycleCostScenario.cost_ratio

Inference USD divided by nonzero training USD over the lifetime.

Equation: (inference_cost / training_cost).to('').magnitude.

training_carbon

engine.scenario_types.ServiceLifecycleCostScenario.training_carbon

Kilograms attributed to training device-hours using the supplied kg-per-device-hour coefficient.

Equation: (cycle_gpu_hours.to('hour').magnitude * cycles * carbon_per_gpu_hour).to('kg').

inference_carbon

engine.scenario_types.ServiceLifecycleCostScenario.inference_carbon

Kilograms attributed to inference device-hours using the same supplied coefficient.

Equation: (inference_gpu_hours.to('hour').magnitude * carbon_per_gpu_hour).to('kg').

carbon_ratio

engine.scenario_types.ServiceLifecycleCostScenario.carbon_ratio

Inference kilograms divided by nonzero training kilograms, dimensionless.

Equation: (inference_carbon / training_carbon).to('').magnitude.

serving_saving

engine.scenario_types.ServiceLifecycleCostScenario.serving_saving

USD saved by the declared fractional inference-cost reduction.

Equation: (inference_cost * serving_cut).to('dollar').

serving_saving_carbon

engine.scenario_types.ServiceLifecycleCostScenario.serving_saving_carbon

Kilograms avoided under the same fractional inference-work reduction.

Equation: (inference_carbon * serving_cut).to('kg').

training_saving

engine.scenario_types.ServiceLifecycleCostScenario.training_saving

USD saved by the declared fractional training-cost reduction.

Equation: (training_cost * training_cut).to('dollar').

training_saving_carbon

engine.scenario_types.ServiceLifecycleCostScenario.training_saving_carbon

Kilograms avoided under the same fractional training-work reduction.

Equation: (training_carbon * training_cut).to('kg').

Back to top