FloatBitFlipScenario
Statistics scenarios · Implementation: mlsysim/engine/scenario_definitions/statistics.py.
Construct this scenario with keyword inputs. The fields below show the types and defaults declared by this class.
One stored binary32 value with bit flipped_bit flipped (bit 30 is the top exponent bit).
Notes
Equation: Decode the original and XOR-flipped binary32 words, then compare their numerical scale.
Assumptions: The stored representation is IEEE binary32; the ratio summary requires positive finite values.
Excludes: Fault likelihood, ECC behavior, and propagation through a network.
References
Derivation: Decode the original and XOR-flipped binary32 words, then compare their numerical scale. Individual property contracts identify the exact accounting expression or reusable calculation. Registry entries supply the scenario inputs; this class does not turn them into measured outcomes.
Examples
Evaluate a named scenario using its declared inputs.
>>> from mlsysim import Scenarios
>>> scenario = Scenarios.Fp32WeightExponentFlip
>>> round(float(scenario.stored), 4)
0.042Attributes
| Name | Description |
|---|---|
| corrupted | Value decoded from the binary32 word after the selected bit flip. |
| exponent_bits | |
| flipped_bit | |
| fraction_bits | |
| scale_log2 | Rounded base-two logarithm of corrupted/original value; requires a positive finite |
| stored | Original value rounded to IEEE binary32 before the selected bit is flipped. |
| value | |
| word_bits | Total sign, exponent, and fraction bit count of the configured representation. |
value
Type: float.
Declared default: required.
flipped_bit
Type: int.
Declared default: required.
exponent_bits
Type: int.
Declared default: required.
fraction_bits
Type: int.
Declared default: required.
stored
engine.scenario_types.FloatBitFlipScenario.stored
Original value rounded to IEEE binary32 before the selected bit is flipped.
Equation: _pair[0].
corrupted
engine.scenario_types.FloatBitFlipScenario.corrupted
Value decoded from the binary32 word after the selected bit flip.
Equation: _pair[1].
scale_log2
engine.scenario_types.FloatBitFlipScenario.scale_log2
Rounded base-two logarithm of corrupted/original value; requires a positive finite ratio.
The flip multiplies the value by 2 to this power.
Equation: round(math.log2(corrupted / stored)).
word_bits
engine.scenario_types.FloatBitFlipScenario.word_bits
Total sign, exponent, and fraction bit count of the configured representation.
Equation: 1 + exponent_bits + fraction_bits.