Float6

For conceptual model usage and type mapping, see:

class pyrogue.Float6(bitSize)[source]

Model class for 6-bit E3M2 floating point numbers (NVIDIA Blackwell FP6).

Parameters:
  • bitSize (int) – Number of bits being represented. Must be 8 (stored in 1-byte word).

  • args (Any)

  • kwargs (Any)

Return type:

Any

Notes

Format: 1 sign bit, 3 exponent bits, 2 mantissa bits (E3M2). Bias = 3. No infinity representation. No NaN representation. All 64 bit patterns are finite values or zero. Maximum representable value is 28.0. Stored in lower 6 bits of a uint8_t byte. Supported by NVIDIA Blackwell GPUs.

pytype

alias of float

toBytes(value)[source]

Convert float to 1-byte E3M2 encoding (6 active bits in uint8).

NaN and infinity inputs are clamped to max finite value (+/-28.0) since E3M2 has no NaN or infinity encodings.

Return type:

bytearray

Parameters:

value (float)

fromBytes(ba)[source]

Decode 1-byte E3M2 encoding to float.

All 64 bit patterns decode to finite values or zero (no NaN/Inf).

Return type:

float

Parameters:

ba (bytes)

fromString(string)[source]

Parse a string into a float value.

Return type:

float

Parameters:

string (str)

minValue()[source]

Return the minimum representable value (-28.0).

Return type:

float

maxValue()[source]

Return the maximum representable value (28.0).

Return type:

float

class pyrogue.Float6BE(bitSize)[source]

Model class for 6-bit E3M2 floats stored as big endian.

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

Any