Skip to content

[Pools] Fix incorrect worker resource-fit checks - #10596

Open
siyuzhou wants to merge 1 commit into
skypilot-org:masterfrom
siyuzhou:fix/pool-resource-fit-numeric
Open

[Pools] Fix incorrect worker resource-fit checks#10596
siyuzhou wants to merge 1 commit into
skypilot-org:masterfrom
siyuzhou:fix/pool-resource-fit-numeric

Conversation

@siyuzhou

@siyuzhou siyuzhou commented Aug 28, 2026

Copy link
Copy Markdown

Resources.cpus and absolute Resources.memory values are strings, so
_task_fits() compares them lexicographically. Parse them with the existing
resource arithmetic parser before checking capacity. Preserve memory-per-CPU
values such as 3x by resolving the multiplier against the task CPU request.
Reject non-finite parsed demand or capacity values so NaN cannot pass a fit
check.

Extend the existing unit test with multi-digit CPU and memory values, fitting
and non-fitting 3x cases, and non-finite CPU and memory demand and capacity.
These cover false rejection, false acceptance, and fail-closed validation.

Tested:

  • bash format.sh
  • pytest tests/unit_tests/test_serve_utils.py::test_task_fits

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@siyuzhou
siyuzhou force-pushed the fix/pool-resource-fit-numeric branch 2 times, most recently from 214c463 to 3f1b0d4 Compare August 28, 2026 20:44

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 0 new potential issues.

Devin Review

@siyuzhou siyuzhou changed the title [Pools] Compare worker resources numerically [Pools] Fix incorrect worker resource-fit checks Aug 28, 2026
@siyuzhou
siyuzhou force-pushed the fix/pool-resource-fit-numeric branch from 3f1b0d4 to 24e1277 Compare August 29, 2026 00:27
@siyuzhou
siyuzhou force-pushed the fix/pool-resource-fit-numeric branch from 24e1277 to 8596671 Compare August 29, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant