@@ -1414,15 +1414,10 @@ def compile_repeated_blocks(self, *args, **kwargs):
14141414 can reduce end-to-end compile time substantially, while preserving the
14151415 runtime speed-ups you would expect from a full `torch.compile`.
14161416
1417- The set of sub-modules to compile is discovered in one of two ways:
1418-
1419- 1. **`_repeated_blocks`** – Preferred. Define this attribute on your
1420- subclass as a list/tuple of class names (strings). Every module whose
1421- class name matches will be compiled.
1422-
1423- 2. **`_no_split_modules`** – Fallback. If the preferred attribute is
1424- missing or empty, we fall back to the legacy Diffusers attribute
1425- `_no_split_modules`.
1417+ The set of sub-modules to compile is discovered by the presence of
1418+ **`_repeated_blocks`** attribute in the model definition. Define this
1419+ attribute on your model subclass as a list/tuple of class names
1420+ (strings). Every module whose class name matches will be compiled.
14261421
14271422 Once discovered, each matching sub-module is compiled by calling
14281423 `submodule.compile(*args, **kwargs)`. Any positional or keyword
@@ -1431,22 +1426,16 @@ class name matches will be compiled.
14311426 """
14321427 repeated_blocks = getattr (self , "_repeated_blocks" , None )
14331428
1434- if not repeated_blocks :
1435- logger .warning ("`_repeated_blocks` attribute is empty. Using `_no_split_modules` to find compile regions." )
1436-
1437- repeated_blocks = getattr (self , "_no_split_modules" , None )
1438-
14391429 if not repeated_blocks :
14401430 raise ValueError (
1441- "Both `_repeated_blocks` and `_no_split_modules` attribute are empty. "
1442- "Set `_repeated_blocks` for the model to benefit from faster compilation. "
1431+ "`_repeated_blocks` attribute is empty. "
1432+ f "Set `_repeated_blocks` for the class ` { self . __class__ . __name__ } ` to benefit from faster compilation. "
14431433 )
1444-
14451434 has_compiled_region = False
14461435 for submod in self .modules ():
14471436 if submod .__class__ .__name__ in repeated_blocks :
1448- has_compiled_region = True
14491437 submod .compile (* args , ** kwargs )
1438+ has_compiled_region = True
14501439
14511440 if not has_compiled_region :
14521441 raise ValueError (
0 commit comments