Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions miles/backends/megatron_utils/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@
from .parallel import verify_megatron_parallel_state
from .replay_utils import register_replay_list_moe
from .update_weight.common import named_params_and_buffers
from .update_weight.update_weight_from_distributed.broadcast import UpdateWeightFromDistributed
from .update_weight.update_weight_from_distributed.p2p import UpdateWeightP2P
from .update_weight.update_weight_from_tensor import UpdateWeightFromTensor

if TYPE_CHECKING:
from miles.ray.rollout.rollout_manager import EnginesAndLock
Expand Down Expand Up @@ -255,16 +252,24 @@ def init(

update_weight_cls = UpdateWeightFromRDT
elif self.args.colocate:
from .update_weight.update_weight_from_tensor import UpdateWeightFromTensor

update_weight_cls = UpdateWeightFromTensor
else:
if self.args.update_weight_transfer_mode == "broadcast":
from .update_weight.update_weight_from_distributed.broadcast import UpdateWeightFromDistributed

update_weight_cls = UpdateWeightFromDistributed
elif self.args.update_weight_transfer_mode == "disk-delta":
# Lazy import: keeps the delta deps (numpy/zstandard/xxhash) off the other paths.
from .update_weight.update_weight_from_distributed.delta import UpdateWeightFromDiskDelta

update_weight_cls = UpdateWeightFromDiskDelta
else:
# Mooncake loads its RDMA shared libraries at import time.
# Other transfer modes must not require a compatible RDMA setup.
from .update_weight.update_weight_from_distributed.p2p import UpdateWeightP2P

update_weight_cls = UpdateWeightP2P
self.weight_updater = update_weight_cls(
self.args,
Expand Down
Loading