ReferencePassingScenario
Agents scenarios · Implementation: mlsysim/engine/scenario_definitions/agents.py.
Construct this scenario with keyword inputs. The fields below show the types and defaults declared by this class.
Children handed a pasted repository slice, or a reference and the files they then read.
Notes
Equation: The calculation members below define pasted_tokens, reference_total_tokens, full_read_tokens, pasted_cost, reference_cost, reduction, read_fraction, break_even_read_tokens.
Assumptions: Each worker receives the same envelope and reads the stated token count at a constant input price.
Excludes: Cache discounts, output tokens, and differences in task quality.
References
Derivation: Children handed a pasted repository slice, or a reference and the files they then read. Each member records the corresponding algebra or named physics function.
Examples
Evaluate the named configuration and display a modeled result.
>>> from mlsysim import Scenarios
>>> case = Scenarios.SixChildReferencePassing
>>> value = case.reduction
>>> print(f"{value:.3g}")
12.2Attributes
| Name | Description |
|---|---|
| break_even_read_tokens | Per-worker read-token allowance where reference overhead exactly cancels savings. |
| full_read_tokens | Tokens if each referenced worker subsequently reads the entire original slice. |
| input_price | |
| pasted_cost | USD input cost of duplicating the pasted slice across workers. |
| pasted_tokens | Total input tokens when every worker receives the entire pasted slice. |
| read_fraction | Read tokens divided by full slice tokens, dimensionless. |
| read_tokens | |
| reduction | Pasted-to-reference input-token ratio, dimensionless. |
| reference_cost | USD input cost of reference envelopes plus the stated file reads. |
| reference_tokens | |
| reference_total_tokens | Total input tokens when each worker receives a reference and reads the stated files. |
| slice_tokens | |
| workers |
workers
Type: int.
Declared default: required.
slice_tokens
Type: int.
Declared default: required.
reference_tokens
Type: int.
Declared default: required.
read_tokens
Type: int.
Declared default: required.
input_price
Type: Quantity.
Declared default: required.
pasted_tokens
engine.scenario_types.ReferencePassingScenario.pasted_tokens
Total input tokens when every worker receives the entire pasted slice.
Equation: workers * slice_tokens.
reference_total_tokens
engine.scenario_types.ReferencePassingScenario.reference_total_tokens
Total input tokens when each worker receives a reference and reads the stated files.
Equation: workers * (reference_tokens + read_tokens).
full_read_tokens
engine.scenario_types.ReferencePassingScenario.full_read_tokens
Tokens if each referenced worker subsequently reads the entire original slice.
A reference after which each child reads the whole slice.
Equation: workers * (reference_tokens + slice_tokens).
pasted_cost
engine.scenario_types.ReferencePassingScenario.pasted_cost
USD input cost of duplicating the pasted slice across workers.
Equation: (Q_(pasted_tokens, 'token') * input_price).to('dollar').
reference_cost
engine.scenario_types.ReferencePassingScenario.reference_cost
USD input cost of reference envelopes plus the stated file reads.
Equation: (Q_(reference_total_tokens, 'token') * input_price).to('dollar').
reduction
engine.scenario_types.ReferencePassingScenario.reduction
Pasted-to-reference input-token ratio, dimensionless.
Equation: pasted_tokens / reference_total_tokens.
read_fraction
engine.scenario_types.ReferencePassingScenario.read_fraction
Read tokens divided by full slice tokens, dimensionless.
Equation: read_tokens / slice_tokens.
break_even_read_tokens
engine.scenario_types.ReferencePassingScenario.break_even_read_tokens
Per-worker read-token allowance where reference overhead exactly cancels savings.
Reads per child at which the reference saves nothing.
Equation: slice_tokens - reference_tokens.