[Bugfix] Re-sync parameter tp_rank after process_weights_after_loading (fix replicated / disable_tp weight reload) (#48025)
Signed-off-by: Alex Xu <alexxu@roblox.com> Co-authored-by: YQ-Wang <yiqingwang@roblox.com> Co-authored-by: alexhxu <alex.xu1015@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
YQ-Wang
alexhxu
Cursor
parent
c71a583aa9
commit
d96aee0951
@@ -364,6 +364,11 @@ def _layerwise_process(layer: torch.nn.Module, info: LayerReloadingInfo):
|
||||
quant_method = getattr(layer, "quant_method", None)
|
||||
if isinstance(quant_method, QuantizeMethodBase):
|
||||
quant_method.process_weights_after_loading(layer)
|
||||
# Re-reconcile parameter TP state: process_weights_after_loading may
|
||||
# have re-created Parameters (stamped with the global rank), which would
|
||||
# otherwise break replicated (disable_tp) weights on a subsequent reload.
|
||||
if hasattr(layer, "update_param_tp_status"):
|
||||
layer.update_param_tp_status()
|
||||
|
||||
# Copy processed values into original tensor storage (preserves cudagraph refs)
|
||||
# this code is a no-op if not reloading (because kernel tensors is empty)
|
||||
|
||||
Reference in New Issue
Block a user