Skip to main content

DenseNetworkScenario

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.

A dense network of layer_widths at batch_size: parameters, FLOPs, traffic, memory.

bytes_per_value is the storage width of every weight, gradient, and activation; optimizer_bytes_per_parameter the optimizer’s state per parameter (two FP32 values for Adam). With a dataset, the result also gives the steps in one epoch over its training split.

Notes

Equation: DenseNetworkModel combines adjacent-layer matrix work and training/activation storage.

Assumptions: The layer-width sequence, batch, and precision apply to all dense layers; optional epoch size comes from dataset.training_examples.

Excludes: Attention, convolution, and architecture-specific kernel execution.

References

Derivation: Delegates to mlsysim.engine.solvers.neural.DenseNetworkModel.solve. That contract composes adjacent-layer matrix counts with shared activation and training-state functions in mlsysim.physics.neural. This wrapper supplies widths, storage choices, batch size, and the optional dataset epoch count.

Examples

>>> from mlsysim import Scenarios
>>> s = Scenarios.MnistDenseNetwork
>>> s.result.macs_per_example > 0
True

Attributes

Name Description
architecture The widths joined by arrows, 784 → 128 → 64 → 10.
batch_size
bytes_per_value
dataset
layer_widths
optimizer_bytes_per_parameter
result Evaluate DenseNetworkModel with these widths, storage choices, batch, and optional training-example count.

layer_widths

Type: List[int].

Declared default: required.

batch_size

Type: int.

Declared default: 1.

bytes_per_value

Type: Quantity.

Declared default: required.

optimizer_bytes_per_parameter

Type: Quantity.

Declared default: required.

dataset

Type: Optional[DatasetProfile].

Declared default: None.

result

engine.scenario_types.DenseNetworkScenario.result

Evaluate DenseNetworkModel with these widths, storage choices, batch, and optional training-example count.

Equation: Delegates to mlsysim.engine.solvers.neural.DenseNetworkModel.solve, using the dataset training-example count when available.

architecture

engine.scenario_types.DenseNetworkScenario.architecture

The widths joined by arrows, 784 → 128 → 64 → 10.

Equation: ' → '.join((str(w) for w in layer_widths)).

Back to top