llmcompressor.entrypoints.higgs.base
HIGGS: Heuristic ILP-Guided Grouped Scheme Mixed-Precision Quantization
MSE collection and high-level API for ILP-based mixed-precision quantization.
Classes:
-
HiggsMSECollectorConverter–First-pass converter that collects per-layer MSE data, solves the ILP,
Functions:
-
get_higgs_config–Compute optimal mixed-precision config via ILP on per-layer MSE.
HiggsMSECollectorConverter
HiggsMSECollectorConverter(
candidate_schemes: List[Union[str, QuantizationScheme]],
targets: Union[str, List[str]] = "Linear",
ignore: List[str] = None,
device: Union[str, device] = None,
target_avg_bitwidth: Optional[float] = None,
target_avg_act_bitwidth: Optional[float] = None,
allow_unquantized: bool = False,
)
Bases: Converter
First-pass converter that collects per-layer MSE data, solves the ILP, and produces an optimal QuantizationConfig. Does NOT modify tensors.
Methods:
-
create_config–Solve ILP after all shards processed and return optimized config.
-
process–Compute MSE for each candidate scheme; return tensors unchanged.
-
set_weight_names–Precompute fused dependencies from the complete checkpoint index.
-
validate–Validate HIGGS inputs without materializing checkpoint tensors.
Source code in src/llmcompressor/entrypoints/higgs/base.py
create_config
Solve ILP after all shards processed and return optimized config.
Source code in src/llmcompressor/entrypoints/higgs/base.py
process
Compute MSE for each candidate scheme; return tensors unchanged.
Source code in src/llmcompressor/entrypoints/higgs/base.py
set_weight_names
Precompute fused dependencies from the complete checkpoint index.
Source code in src/llmcompressor/entrypoints/higgs/base.py
validate
Validate HIGGS inputs without materializing checkpoint tensors.
Source code in src/llmcompressor/entrypoints/higgs/base.py
get_higgs_config
get_higgs_config(
model_stub: Union[str, PathLike],
candidate_schemes: List[Union[str, QuantizationScheme]],
targets: Union[str, List[str]] = "Linear",
ignore: List[str] = None,
target_avg_bitwidth: Optional[float] = None,
target_avg_act_bitwidth: Optional[float] = None,
device: Optional[Union[str, device]] = None,
allow_unquantized: bool = False,
return_collector: bool = False,
) -> QuantizationConfig
Compute optimal mixed-precision config via ILP on per-layer MSE.
Reads model weights (model-free, no GPU model load), evaluates each candidate scheme's MSE on every layer, and solves an ILP to minimize weighted MSE under a bitwidth budget.
The returned QuantizationConfig can be applied via oneshot() or model_free_ptq().
Args: model_stub: HuggingFace model ID or path to model directory candidate_schemes: List of quantization schemes to choose from targets: Layer types to quantize (e.g., "Linear") ignore: Layers to skip (e.g., ["lm_head"]) target_avg_bitwidth: Optional constraint on average weight bitwidth target_avg_act_bitwidth: Optional constraint on average activation bitwidth device: Device for MSE computation (GPU recommended) allow_unquantized: Allow the ILP to leave layers unquantized at 16 bits return_collector: Return the collector alongside the optimized config.
Returns: QuantizationConfig with optimized config_groups
Source code in src/llmcompressor/entrypoints/higgs/base.py
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 | |