Float8

For conceptual model usage and type mapping, see:

class pyrogue.Float8(bitSize)[source]

Model class for 8-bit E4M3 floating point numbers (NVIDIA FP8).

Parameters:
  • bitSize (int) – Number of bits being represented. Must be 8.

  • args (Any)

  • kwargs (Any)

Return type:

Any

Notes

Format: 1 sign bit, 4 exponent bits, 3 mantissa bits (E4M3). Bias = 7. No infinity representation. NaN encoded as 0x7F. Maximum representable value is 448.0. Supported by NVIDIA Hopper (H100) and Blackwell GPUs.

pytype

alias of float

toBytes(value)[source]

Convert float to 1-byte E4M3 encoding.

Return type:

bytearray

Parameters:

value (float)

fromBytes(ba)[source]

Decode 1-byte E4M3 encoding to float.

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 (-448.0).

Return type:

float

maxValue()[source]

Return the maximum representable value (448.0).

Return type:

float

class pyrogue.Float8BE(bitSize)[source]

Model class for 8-bit E4M3 floats stored as big endian.

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

Any