Exclude sensative layers from quantization in krea

This commit is contained in:
Jaret Burkett
2026-07-13 10:14:53 -06:00
parent 28b05ee4ed
commit 7602e476eb

View File

@@ -379,6 +379,24 @@ class Krea2Model(BaseModel):
# tell the model to invert assistant on inference since we want remove lora effects
self.invert_assistant_lora = True
def get_quantization_exclude_modules(self):
# sensitive modules kept in full precision (fnmatch patterns on module
# names within SingleStreamDiT):
# first - patchified latent input projection
# tmlp* / tproj* - timestep embedder + modulation projection; feed
# every block's DoubleSharedModulation and LastLayer
# txtmlp* - text feature -> model width projection
# txtfusion.projector - tiny (num_txt_layers -> 1) encoder-layer mixer
# last* - final norm/modulated output projection
return [
"first",
"tmlp*",
"tproj*",
"txtmlp*",
"txtfusion.projector",
"last*",
]
def load_model(self):
dtype = self.torch_dtype