MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / scaled_nvfp4_quant

Function scaled_nvfp4_quant

lightx2v_kernel/python/lightx2v_kernel/gemm.py:11–55  ·  view source on GitHub ↗

Quantize input tensor to FP4 and return quantized tensor and scale. This function quantizes the last dimension of the given tensor `input`. For every 16 consecutive elements, a single dynamically computed scaling factor is shared. This scaling factor is quantized using the `input_g

(input: torch.Tensor, input_global_scale: torch.Tensor)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 7

load_fp4_weightMethod · 0.90
act_quant_nvfp4Method · 0.90
test_nvfp4_gemmFunction · 0.90
load_fp4_weightMethod · 0.90
act_quant_fp4Method · 0.90
quantize_fp4Function · 0.90
act_quant_nvfp4Method · 0.85

Calls 1

defaultMethod · 0.45

Tested by 4

test_nvfp4_gemmFunction · 0.72
load_fp4_weightMethod · 0.72
act_quant_fp4Method · 0.72
quantize_fp4Function · 0.72