Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix launch function in elastic mode run #61847

Merged
merged 1 commit into from
Feb 20, 2024
Merged
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
10 changes: 7 additions & 3 deletions python/paddle/distributed/launch/controllers/collective.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ def build_pod(self):
):
return self._build_pod_with_args()
else:
return self._build_pod_with_master()
if self.ctx.args.auto_parallel_config is None:
skip_run = True
# only when skip_run is Flase, should not reset pod
return self._build_pod_with_master(skip_run)

def _build_pod_with_tuner(self):
auto_parallel_config = self.ctx.args.auto_parallel_config
Expand Down Expand Up @@ -150,7 +153,7 @@ def _build_pod_with_args(self):

return True

def _build_pod_with_master(self):
def _build_pod_with_master(self, reset_pod=True):
self.pod.replicas = self.pod_replicas()

# rank will be reset when restart
Expand Down Expand Up @@ -205,7 +208,8 @@ def _build_pod_with_master(self):

job_endpoints = [i['endpoints'] for i in peer_list]

# self.pod.reset()
if reset_pod:
self.pod.reset()
selected_dev_key = self.ctx.node.device.get_selected_device_key()
selected_dev_list = self.ctx.node.device.get_selected_devices(
self.ctx.args.devices
Expand Down