Add model to WeightTransferEngine.__init__ (#42922)

Signed-off-by: SumanthRH <sumanthrh99@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Sumanth R Hegde
2026-05-22 17:52:15 -07:00
committed by GitHub
co-authored by mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 552bbe6f4e
commit 3cb83c9592
7 changed files with 78 additions and 29 deletions
+6 -1
View File
@@ -65,7 +65,10 @@ class WeightTransferEngine(ABC, Generic[TInitInfo, TUpdateInfo]):
update_info_cls: type[TUpdateInfo]
def __init__(
self, config: WeightTransferConfig, parallel_config: ParallelConfig
self,
config: WeightTransferConfig,
parallel_config: ParallelConfig,
model: torch.nn.Module,
) -> None:
"""
Initialize the weight transfer engine.
@@ -73,9 +76,11 @@ class WeightTransferEngine(ABC, Generic[TInitInfo, TUpdateInfo]):
Args:
config: The configuration for the weight transfer engine
parallel_config: The configuration for the parallel setup
model: The local model instance which will receive the weights
"""
self.config = config
self.parallel_config = parallel_config
self.model = model
def parse_init_info(self, init_dict: dict[str, Any]) -> TInitInfo:
"""