qbcompiler.configs.models.HessianQuantConfig Class Reference

qbcompiler.configs.models.HessianQuantConfig Class Reference#

Mobilint SDK qb Compiler: qbcompiler.configs.models.HessianQuantConfig Class Reference
Mobilint SDK qb Compiler v1.3
MCS002-EN
qbcompiler.configs.models.HessianQuantConfig Class Reference

Configuration for HessianQuant algorithm. More...

Inheritance diagram for qbcompiler.configs.models.HessianQuantConfig:

Classes

class  Attributes

Public Member Functions

"HessianQuantConfig" with_updates (self, **kwargs)
 Return a copy with updated fields.

Static Public Attributes

 model_config
bool apply = Field(default=False, description="If true, apply HessianQuant")
str hessian_dtype
str accumulation_device
 Attributes
 default_factory
 alias

Detailed Description

Configuration for HessianQuant algorithm.

Defines parameters controlling whether and how HessianQuant is applied during quantization, including layer-level inclusion/exclusion lists.

Parameters
applybool. If true, apply HessianQuant
hessian_dtypestr. Storage dtype for the accumulated HessianQuant Hessian. bf16 halves its memory footprint (host RAM when the Hessian lives on CPU, VRAM when on GPU) — critical for large models such as MoE with thousands of expert FFN Hessians. Compute stays float32 regardless: the per-batch matmul and accumulation run in float32 and the solve upcasts back to float32; only the persistent accumulator is bfloat16.:
0: fp32 - Store the Hessian in float32.
1: bf16 - Store the Hessian in bfloat16 (half the memory).
accumulation_devicestr. Device the HessianQuant Hessian is accumulated on during calibration. gpu accumulates on the calibration device, which is 3-5x faster because the whole d x d accumulator is otherwise copied off the device once per layer per batch; the Hessian is parked on the host as soon as the last batch is in, so this does not raise peak VRAM for the rest of the compile. cpu accumulates on the host instead, bounding VRAM during calibration itself for models whose summed Hessian does not fit alongside the activations. auto follows resourceManagement.useGPUOnlyForCalibration, which is the knob that already says whether this compile is VRAM-bound: false picks gpu, true picks cpu. Resolved once at config load and logged; a CPU compile always accumulates on the host regardless.:
0: auto - Follow useGPUOnlyForCalibration: false picks gpu, true picks cpu.
1: cpu - Accumulate on the host, bounding VRAM during calibration itself.
2: gpu - Accumulate on the calibration device, then park on the host.
attributesAttributes. HessianQuant algorithm attributes

Definition at line 774 of file models.py.

Member Function Documentation

◆ with_updates()

"HessianQuantConfig" qbcompiler.configs.models.HessianQuantConfig.with_updates ( self,
** kwargs )

Return a copy with updated fields.

Definition at line 845 of file models.py.

Member Data Documentation

◆ model_config

qbcompiler.configs.models.HessianQuantConfig.model_config
static
Initial value:
= ConfigDict(
populate_by_name=True,
extra="forbid",
)

Definition at line 792 of file models.py.

◆ apply

bool qbcompiler.configs.models.HessianQuantConfig.apply = Field(default=False, description="If true, apply HessianQuant")
static

Definition at line 797 of file models.py.

◆ hessian_dtype

str qbcompiler.configs.models.HessianQuantConfig.hessian_dtype
static
Initial value:
= Field(
default="fp32",
alias="hessianDtype",
description="Storage dtype for the accumulated HessianQuant Hessian. bf16 halves its memory footprint (host RAM when the Hessian lives on CPU, VRAM when on GPU) — critical for large models such as MoE with thousands of expert FFN Hessians. Compute stays float32 regardless: the per-batch matmul and accumulation run in float32 and the solve upcasts back to float32; only the persistent accumulator is bfloat16.",
)

Definition at line 798 of file models.py.

◆ accumulation_device

str qbcompiler.configs.models.HessianQuantConfig.accumulation_device
static
Initial value:
= Field(
default="auto",
alias="accumulationDevice",
description="Device the HessianQuant Hessian is accumulated on during calibration. gpu accumulates on the calibration device, which is 3-5x faster because the whole d x d accumulator is otherwise copied off the device once per layer per batch; the Hessian is parked on the host as soon as the last batch is in, so this does not raise peak VRAM for the rest of the compile. cpu accumulates on the host instead, bounding VRAM during calibration itself for models whose summed Hessian does not fit alongside the activations. auto follows resourceManagement.useGPUOnlyForCalibration, which is the knob that already says whether this compile is VRAM-bound: false picks gpu, true picks cpu. Resolved once at config load and logged; a CPU compile always accumulates on the host regardless.",
)

Definition at line 803 of file models.py.

◆ Attributes

qbcompiler.configs.models.HessianQuantConfig.Attributes
static

Definition at line 843 of file models.py.

◆ default_factory

qbcompiler.configs.models.HessianQuantConfig.default_factory
static

Definition at line 843 of file models.py.

◆ alias

qbcompiler.configs.models.HessianQuantConfig.alias
static

Definition at line 843 of file models.py.


The documentation for this class was generated from the following file: