MCPcopy Create free account
hub / github.com/Aveiro-Lin/GraphiContact / quantize_4bit

Function quantize_4bit

src/bitsandbytes/bitsandbytes/functional.py:1124–1268  ·  view source on GitHub ↗

Quantize tensor A in blocks of 4-bit values. Quantizes tensor A by dividing it into blocks which are independently quantized to FP4. Parameters ---------- A : torch.Tensor The input tensor. absmax : torch.Tensor The absmax values. out : torch.Tensor

(
    A: Tensor,
    absmax: Optional[torch.Tensor] = None,
    out: Optional[torch.Tensor] = None,
    blocksize=64,
    compress_statistics=False,
    quant_type="fp4",
    quant_storage=torch.uint8,
)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 2

quantize_fp4Function · 0.85
quantize_nf4Function · 0.85

Calls 8

pre_callFunction · 0.85
is_on_gpuFunction · 0.85
get_ptrFunction · 0.85
post_callFunction · 0.85
get_4bit_typeFunction · 0.85
quantize_blockwiseFunction · 0.85
QuantStateClass · 0.85
meanMethod · 0.80

Tested by

no test coverage detected