llmcompressor.utils.triton_utils
JIT-inline primitives shared by observer Triton kernels.
Functions:
-
calculate_candidate_scale–Derive and round a candidate scale from its original min/max range.
-
quantize_dequantize–GPTQ-style QDQ shared by MSE and future observer kernels.
-
round_candidate_scale–Round a floating candidate scale as compressed-tensors qparams do.
calculate_candidate_scale
calculate_candidate_scale(
min_value,
max_value,
p,
q_min,
q_max,
SCALE_ROUND_TYPE: constexpr,
QUANT_TYPE: constexpr,
SYMMETRIC: constexpr,
)
Derive and round a candidate scale from its original min/max range.
Source code in src/llmcompressor/utils/triton_utils.py
quantize_dequantize
quantize_dequantize(
values,
scale,
zero_point,
q_min,
q_max,
QUANT_TYPE: constexpr,
NUM_BITS: constexpr,
HAS_ZP: constexpr,
COMPUTE_DTYPE: constexpr,
)
GPTQ-style QDQ shared by MSE and future observer kernels.
Source code in src/llmcompressor/utils/triton_utils.py
round_candidate_scale
Round a floating candidate scale as compressed-tensors qparams do.