[Data] Remove constructor from ClusterAutoscaler base class#59733
Conversation
Signed-off-by: machichima <nary12321@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request successfully removes the constructor from the ClusterAutoscaler base class, simplifying its subclasses. The changes in DefaultClusterAutoscaler and DefaultClusterAutoscalerV2 correctly adapt to this by removing the super().__init__ call. The corresponding test files are also updated accordingly. I've found one minor opportunity for further cleanup in DefaultClusterAutoscaler to remove an unused dependency, which aligns well with the goal of this PR.
| self._topology = topology | ||
| self._resource_manager = resource_manager | ||
| self._execution_id = execution_id |
There was a problem hiding this comment.
The self._resource_manager is assigned but never used within the DefaultClusterAutoscaler class. It can be removed to simplify the code, which aligns with the goal of this PR. To fully remove the unused dependency, you would also need to remove resource_manager from the __init__ signature and from the call site in python/ray/data/_internal/cluster_autoscaler/__init__.py.
| self._topology = topology | |
| self._resource_manager = resource_manager | |
| self._execution_id = execution_id | |
| self._topology = topology | |
| self._execution_id = execution_id |
|
@bveeramani PTAL. Thank you! |
Signed-off-by: machichima <nary12321@gmail.com>
575bb9a to
abae532
Compare
…ect#59733) ## Description The constructor in ClusterAutoscaler base class is not necessary, and it adds complexity because it requires all ClusterAutoscaling implementations to accept the same dependencies This PR remove the constructor in ClusterAutoscaler. Sub-classes can prevent using the dependencies that are not used ## Related issues Closes ray-project#59684 ## Additional information > Optional: Add implementation details, API changes, usage examples, screenshots, etc. --------- Signed-off-by: machichima <nary12321@gmail.com> Signed-off-by: jasonwrwang <jasonwrwang@tencent.com>
…ect#59733) ## Description The constructor in ClusterAutoscaler base class is not necessary, and it adds complexity because it requires all ClusterAutoscaling implementations to accept the same dependencies This PR remove the constructor in ClusterAutoscaler. Sub-classes can prevent using the dependencies that are not used ## Related issues Closes ray-project#59684 ## Additional information > Optional: Add implementation details, API changes, usage examples, screenshots, etc. --------- Signed-off-by: machichima <nary12321@gmail.com>
…ect#59733) ## Description The constructor in ClusterAutoscaler base class is not necessary, and it adds complexity because it requires all ClusterAutoscaling implementations to accept the same dependencies This PR remove the constructor in ClusterAutoscaler. Sub-classes can prevent using the dependencies that are not used ## Related issues Closes ray-project#59684 ## Additional information > Optional: Add implementation details, API changes, usage examples, screenshots, etc. --------- Signed-off-by: machichima <nary12321@gmail.com>
aa640334e16 # Add util package c535e50e365 # [Data] - Add support for callable classes for UDFExpr (ray-project#56725) 0266765ec39 # [Data] Remove constructor from ClusterAutoscaler base class (ray-project#59733) 03416b2e69f # [Data] DefaultAutoscalerV2 doesn't scale nodes from zero (ray-project#59896) 207295e23db # [Data] Introduce seams to DefaultAutoscaler2 to make it more testable (ray-project#59933) c5eceb4ce7a # [Data] DefaultClusterAutoscalerV2 raises KeyError: 'CPU' Fix (ray-project#60208) 0bb15c93e5c # [data] Allow configuring DefaultClusterAutoscalerV2 thresholds via en… (ray-project#60133) e52695c23df # [Data] Fix autoscaler to respect user-configured resource limits (ray-project#60283) 15c929bbc21 # [Data] Reorganize sections of `DefaultAutoscalerV2` constructor (ray-project#60347) b5ffc068613 # [Data] Fix autoscaler to request previous allocation instead of empty resources when not scaling up (ray-project#60321)
Description
The constructor in ClusterAutoscaler base class is not necessary, and it adds complexity because it requires all ClusterAutoscaling implementations to accept the same dependencies
This PR remove the constructor in ClusterAutoscaler. Sub-classes can prevent using the dependencies that are not used
Related issues
Closes #59684
Additional information