dmx.compressor.numerical.format
Classes
|
This is a block floating point format simulated in FP32, using QPyTorch. |
|
This is a fixed point format simulated in FP32, using QPyTorch. |
|
This is a floating point format simulated in FP32, using QPyTorch. |
|
This is an abstract class of tensor numerical format. |
|
This is a MXFP tensor format. |
|
This is a MXINT tensor format. |
|
This is a dummy numerical format whose cast() does not do anything but passing same input through. |
|
This is a scaled block floating point tensor format. |
- class dmx.compressor.numerical.format.BlockFloatingPoint(precision=8, block_size=64, symmetric=True, rounding='nearest')
Bases:
FormatThis is a block floating point format simulated in FP32, using QPyTorch.
- property bfp_id
- property bit_precision: float
- blocked: bool = True
- property bytes_per_elem: float
- cast(x: Tensor, block_dim: int)
- classmethod from_shorthand(sh: str)
- static make_mantissa_asymmetric(dmx_result, fp32_inp, n_mantissa_bits=8)
- class dmx.compressor.numerical.format.FixedPoint(precision, fraction, clamp=True, symmetric=True, rounding='nearest')
Bases:
FormatThis is a fixed point format simulated in FP32, using QPyTorch.
- property bit_precision: float
- blocked: bool = False
- property bytes_per_elem: float
- cast(x, *args)
- classmethod from_shorthand(sh: str)
- class dmx.compressor.numerical.format.FloatingPoint(mantissa=23, exponent=8, bias=None, flush_subnormal=True, unsigned=False, rounding='nearest')
Bases:
FormatThis is a floating point format simulated in FP32, using QPyTorch.
- property bit_precision: float
- blocked: bool = False
- property bytes_per_elem: float
- cast(x, *args)
- classmethod from_shorthand(sh: str)
- property largest_representable_power_of_two
- class dmx.compressor.numerical.format.Format
Bases:
ABCThis is an abstract class of tensor numerical format. Child classes to implement cast() and from_shorthand() method.
- bfp_id: int | None = None
- property bit_precision: float | None
- blocked: bool
- property bytes_per_elem: float | None
- cast(*input: Any)
- static from_shorthand(sh: str)
- class dmx.compressor.numerical.format.MXFP(element_format: FloatingPoint, block_size=32)
Bases:
FormatThis is a MXFP tensor format.
- property bit_precision: float
- blocked: bool = True
- property bytes_per_elem: float
- cast(x: Tensor, block_dim: int) Tensor
- classmethod from_shorthand(sh: str)
- class dmx.compressor.numerical.format.MXINT(precision=8, block_size=32)
Bases:
BlockFloatingPointThis is a MXINT tensor format.
- classmethod from_shorthand(sh: str)
- class dmx.compressor.numerical.format.Same
Bases:
FormatThis is a dummy numerical format whose cast() does not do anything but passing same input through.
- property bit_precision: float | None
- blocked: bool = False
- property bytes_per_elem: None
- cast(x, *args)
- classmethod from_shorthand(sh: str)
- class dmx.compressor.numerical.format.ScaledBlockFloatingPoint(block_format: FixedPoint, scaler_format: FloatingPoint, block_size=64)
Bases:
FormatThis is a scaled block floating point tensor format.
- property bfp_id
- property bit_precision: float
- blocked: bool = True
- property bytes_per_elem: float
- cast(x: Tensor, block_dim: int) Tensor
- determine_scaler_exponent_bias_from(x: Tensor) None
Determines scaler_format.bias based on the value of the quantized tensor as a side-effect
- classmethod from_shorthand(sh: str)