fix: make FSDP2 executor work with ABC+Generic model hierarchy
- Wrap each child module individually, skip root (CPython layout conflict between ABC+Generic and FSDP2 __class__ assignment) - Remove manual unshard in clip_grad_norm (DTensor compatible) - Fix _no_sync to iterate modules() instead of checking root - Add reshard after unwrap_model - Guard __init_subclass__ type resolution against dynamic subclasses - Add fsdp2 to --parallel_mode CLI choices
This commit is contained in:
+4
-1
@@ -67,7 +67,10 @@ class BaseFactory(ABC, Generic[T]):
|
||||
if _get_origin(orig_base) is BaseFactory:
|
||||
(arg,) = _get_args(orig_base)
|
||||
cls._entries = {}
|
||||
cls._component_base = _resolve_type(arg, cls)
|
||||
try:
|
||||
cls._component_base = _resolve_type(arg, cls)
|
||||
except Exception:
|
||||
cls._component_base = None
|
||||
return
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user