Allow nested transformer block names for quantization, lora targeting, quantizing
This commit is contained in:
1 parent
17c9279828
commit
c8cd78b1a4
4 files changed
+20
-4
No files matched your search
@@ -2135,7 +2135,13 @@ class BaseSDTrainProcess(BaseTrainProcess):
|
||||
compiled_block_count = 0
|
||||
|
||||
for attr_name in BLOCK_LIST_ATTRS:
|
||||
block_list = getattr(inner_unet, attr_name, None)
|
||||
# attr_name may be a dotted path for models that nest their
|
||||
# blocks (e.g. hidream_o1's "model.language_model.layers").
|
||||
block_list = inner_unet
|
||||
for part in attr_name.split('.'):
|
||||
block_list = getattr(block_list, part, None)
|
||||
if block_list is None:
|
||||
break
|
||||
|
||||
if block_list is None:
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user