Repository navigation
[autoscaler][Data] Accept fractional resource values in request_resources - #63306
Conversation
Signed-off-by: Lehui Liu <[email protected]>
Signed-off-by: Lehui Liu <[email protected]>
Signed-off-by: Lehui Liu <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request enables support for fractional resource requests in the autoscaler by allowing float values in resource bundles and removing the rounding logic in the autoscaling coordinator. The feedback identifies several areas for improvement: the num_cpus parameter should be updated to accept floats for consistency, resource values should be validated as non-negative to prevent issues with NaN or negative inputs, and the reallocation logic needs to be updated from floor division to true division to avoid truncating fractional resources. Additionally, it is recommended to expand test coverage to explicitly verify that booleans are rejected and floats are accepted.
Signed-off-by: Lehui Liu <[email protected]>
Signed-off-by: Lehui Liu <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 53cc949. Configure here.
Signed-off-by: Lehui Liu <[email protected]>
Signed-off-by: Lehui Liu <[email protected]>
Signed-off-by: Lehui Liu <[email protected]>
…rces (ray-project#63306) ray-project#59353 open-sourced the `AutoscalingCoordinator` including a `math.ceil` block on incoming resource bundles. The block traces back to that validator was added back in ray-project#26626 to fix a *shape* bug (ray-project#23166 ). The literal `int` came from an informal type annotation; It seems that neither v1 (KV → load_metrics → bin-packing) nor v2 (proto `map<string, double>`) requires it. Drop the value-type check in the SDK and remove the `math.ceil` workaround in Ray Data --------- Signed-off-by: Lehui Liu <[email protected]> Signed-off-by: phattruong <[email protected]>
…rces (ray-project#63306) ray-project#59353 open-sourced the `AutoscalingCoordinator` including a `math.ceil` block on incoming resource bundles. The block traces back to that validator was added back in ray-project#26626 to fix a *shape* bug (ray-project#23166 ). The literal `int` came from an informal type annotation; It seems that neither v1 (KV → load_metrics → bin-packing) nor v2 (proto `map<string, double>`) requires it. Drop the value-type check in the SDK and remove the `math.ceil` workaround in Ray Data --------- Signed-off-by: Lehui Liu <[email protected]> Signed-off-by: Alexandr Plashchinsky <[email protected]>

Description
#59353 open-sourced the
AutoscalingCoordinatorincluding amath.ceilblock on incoming resource bundles. The block traces back to that validator was added back in #26626 to fix a shape bug (#23166 ). The literalintcame from an informal type annotation;It seems that neither v1 (KV → load_metrics → bin-packing) nor v2 (proto
map<string, double>) requires it.Drop the value-type check in the SDK and remove the
math.ceilworkaround in Ray DataRelated issues
Related to #63241
Additional information
Submitting a Ray Train job with fractional CPU, see full repro script here: https://gist.github.com/liulehui/6d2548f0ff85e7e19f7908b46b224280
before the change:
after the change: