MCPcopy Create free account
hub / github.com/IST-DASLab/MoE-Quant / mse_scale

Function mse_scale

src/quant_utils.py:144–192  ·  view source on GitHub ↗

Find the optimal scale for quantization with respect to the MSE loss x: (..., C), weight p: (P), shrinkage factors scale: (...), initial scale, modified in-place and returned qzero: (...), zero points maxq: () dtype: torch.dtype, target scale dtype, fp16 or bf16 norm

(
    x: torch.Tensor,
    p: torch.Tensor,
    scale: torch.Tensor,
    qzero: torch.Tensor,
    maxq: torch.Tensor,
    dtype: torch.dtype = None,
    norm: float = 2.4,
)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

get_quantization_gridFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected