nemo_automodel.components.quantization.qlora
nemo_automodel.components.quantization.qlora
Module Contents
Classes
Functions
API
Structural contract for the recipe’s quantization configuration node.
Recipes pass a ConfigNode (self.cfg.get("quantization")), not a
plain dict. Only the keys read by create_bnb_config are
declared; the get overloads pin each key to the type transformers
expects for it.
Create the BitsAndBytes configuration used for QLoRA.
Parameters:
The recipe’s quantization section. A ConfigNode satisfies
this protocol; only the two load_in_* flags and the four
bnb_4bit_* settings are read.
Returns: BitsAndBytesConfig | None
The BitsAndBytes configuration, or None when neither 4-bit nor
Raises:
ImportError: If bitsandbytes or transformers is unavailable.ValueError: If the quantization section omits both load flags.
Return whether any module carries a BitsAndBytes quantized state.
Parameters:
Model to inspect.
Returns: bool
True when at least one module has a quant_state of type