[chore][1/N] Avoid using default mutable parameters (#11478)

Signed-off-by: Kai-Hsun Chen <khchen@x.ai>
This commit is contained in:
Kai-Hsun Chen
2025-10-12 05:26:39 -07:00
committed by GitHub
parent be740acdb0
commit 43190becfa
2 changed files with 4 additions and 4 deletions

View File

@@ -492,7 +492,7 @@ def make_layers(
pp_size: Optional[int] = None,
prefix: str = "",
return_tuple: bool = False,
offloader_kwargs: Dict[str, Any] = {},
offloader_kwargs: Optional[Dict[str, Any]] = None,
) -> Tuple[torch.nn.Module, int, int]:
"""Make a list of layers with the given layer function"""
# circula imports
@@ -517,7 +517,7 @@ def make_layers(
layer_fn(idx=idx, prefix=add_prefix(idx, prefix))
for idx in range(start_layer, end_layer)
),
**offloader_kwargs,
**(offloader_kwargs or {}),
)
+ [
PPMissingLayer(return_tuple=return_tuple)