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

[tune] let placement groups be cleaned up by reconciliation #18650

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions python/ray/tune/ray_trial_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def _stop_trial(self,
trial: Trial,
error=False,
error_msg=None,
destroy_pg_if_cannot_replace=True):
destroy_pg_if_cannot_replace=False):
"""Stops this trial.

Stops this trial, releasing all allocating resources. If stopping the
Expand Down Expand Up @@ -613,7 +613,7 @@ def stop_trial(self,
trial: Trial,
error: bool = False,
error_msg: Optional[str] = None,
destroy_pg_if_cannot_replace: bool = True) -> None:
destroy_pg_if_cannot_replace: bool = False) -> None:
"""Only returns resources if resources allocated.

If destroy_pg_if_cannot_replace is False, the Trial placement group
Expand Down
2 changes: 1 addition & 1 deletion python/ray/tune/trial_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def stop_trial(self,
trial: Trial,
error: bool = False,
error_msg: Optional[str] = None,
destroy_pg_if_cannot_replace: bool = True) -> None:
destroy_pg_if_cannot_replace: bool = False) -> None:
"""Stops the trial.

Stops this trial, releasing all allocating resources.
Expand Down
5 changes: 3 additions & 2 deletions python/ray/tune/utils/placement_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ def _stage_pgf_pg(self, pgf: PlacementGroupFactory):

def can_stage(self):
"""Return True if we can stage another placement group."""
return len(self._staging_futures) < self._max_staging
return (len(self._staging_futures) + len(
self._pgs_for_removal)) < self._max_staging

def update_status(self):
"""Update placement group status.
Expand Down Expand Up @@ -537,7 +538,7 @@ def return_or_clean_cached_pg(self, pg: PlacementGroup):

def return_pg(self,
trial: "Trial",
destroy_pg_if_cannot_replace: bool = True):
destroy_pg_if_cannot_replace: bool = False):
"""Return pg, making it available for other trials to use.

If destroy_pg_if_cannot_replace is True, this will only return
Expand Down