载入中...
搜索中...
未找到
eve::tensor::q 命名空间参考

struct  QuantPayload
 

函数

bool isQuantDType (DType dt)
 
int quantByteSize (DType dt, int count)
 
uint16_t f32ToF16 (float x)
 
float f16ToF32 (uint16_t h)
 
float fp8E4M3ToF32 (uint8_t v)
 
float fp4E2M1ToF32 (uint8_t nib)
 
uint32_t floatToEfm (float x, int expBits, int manBits, int bias)
 
uint8_t f32ToFp8E4M3 (float x)
 
uint8_t f32ToFp4E2M1 (float x)
 
float efmMaxMagnitude (int expBits, int manBits, int bias)
 
float dequantValue (DType dt, const uint8_t *bytes, const float *scales, int group, int idx)
 
void dequantizeAll (DType dt, const uint8_t *bytes, const float *scales, int group, int count, float *out)
 
QuantPayload quantize (const float *src, int count, DType dt, int group)
 

函数说明

◆ dequantizeAll()

void eve::tensor::q::dequantizeAll ( DType  dt,
const uint8_t *  bytes,
const float *  scales,
int  group,
int  count,
float *  out 
)
inline

在文件 Quant.h204 行定义.

引用了 dequantValue() , 以及 group.

被这些函数引用 eve::tensor::Tensor::dequantized().

◆ dequantValue()

float eve::tensor::q::dequantValue ( DType  dt,
const uint8_t *  bytes,
const float *  scales,
int  group,
int  idx 
)
inline

◆ efmMaxMagnitude()

float eve::tensor::q::efmMaxMagnitude ( int  expBits,
int  manBits,
int  bias 
)
inline

Largest finite magnitude of an e/m format (used for block scaling).

在文件 Quant.h167 行定义.

被这些函数引用 quantize().

◆ f16ToF32()

float eve::tensor::q::f16ToF32 ( uint16_t  h)
inline

在文件 Quant.h56 行定义.

引用了 f, h , 以及 m.

被这些函数引用 dequantValue().

◆ f32ToF16()

uint16_t eve::tensor::q::f32ToF16 ( float  x)
inline

在文件 Quant.h34 行定义.

引用了 b, m , 以及 x.

被这些函数引用 quantize().

◆ f32ToFp4E2M1()

uint8_t eve::tensor::q::f32ToFp4E2M1 ( float  x)
inline

在文件 Quant.h162 行定义.

引用了 floatToEfm() , 以及 x.

被这些函数引用 quantize().

◆ f32ToFp8E4M3()

uint8_t eve::tensor::q::f32ToFp8E4M3 ( float  x)
inline

在文件 Quant.h158 行定义.

引用了 floatToEfm() , 以及 x.

被这些函数引用 quantize().

◆ floatToEfm()

uint32_t eve::tensor::q::floatToEfm ( float  x,
int  expBits,
int  manBits,
int  bias 
)
inline

Round-trip encode of an arbitrary float into a tiny e/m format (nearest, via a cached value table + binary search — no per-element exponential math).

在文件 Quant.h110 行定义.

引用了 a, b, m, v, value , 以及 x.

被这些函数引用 f32ToFp4E2M1() , 以及 f32ToFp8E4M3().

◆ fp4E2M1ToF32()

float eve::tensor::q::fp4E2M1ToF32 ( uint8_t  nib)
inline

在文件 Quant.h98 行定义.

引用了 m , 以及 v.

被这些函数引用 dequantValue().

◆ fp8E4M3ToF32()

float eve::tensor::q::fp8E4M3ToF32 ( uint8_t  v)
inline

在文件 Quant.h82 行定义.

引用了 f, m , 以及 v.

被这些函数引用 dequantValue().

◆ isQuantDType()

bool eve::tensor::q::isQuantDType ( DType  dt)
inline

True for the weight-quantization dtypes (stored packed, dequantized on use).

在文件 Quant.h16 行定义.

引用了 eve::tensor::Fp16, eve::tensor::Fp4E2M1, eve::tensor::Fp8E4M3, eve::tensor::Int4 , 以及 eve::tensor::Int8.

被这些函数引用 eve::tensor::Tensor::isQuantized() , 以及 eve::tensor::TF::quantizeWeight().

◆ quantByteSize()

int eve::tensor::q::quantByteSize ( DType  dt,
int  count 
)
inline

Bytes needed to store count elements of dt (int4/fp4 pack two per byte).

在文件 Quant.h22 行定义.

引用了 eve::tensor::Fp16, eve::tensor::Fp4E2M1, eve::tensor::Fp8E4M3, eve::tensor::Int4 , 以及 eve::tensor::Int8.

被这些函数引用 quantize().

◆ quantize()

QuantPayload eve::tensor::q::quantize ( const float *  src,
int  count,
DType  dt,
int  group 
)
inline