fix: warn when device list exceeds kubelet gRPC limit - #145
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe plugin validates generated GPU memory device counts against kubelet’s effective response limit, logs excess-entry errors once, adds threshold tests, and documents the per-node GPU memory constraint. ChangesGPU memory entry validation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant apiDevices
participant checkDeviceEntries
participant Logger
apiDevices->>checkDeviceEntries: validate generated memory-device count
checkDeviceEntries-->>apiDevices: return validation error or success
apiDevices->>Logger: log an entry-limit warning once
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
pkg/plugin/server_test.go (1)
254-260: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd an exact-boundary regression case.
The current failure case does not catch over-recommendation when
count*factoris exactly divisible by the limit. Add an assertion that 120,000 entries at factor 1 recommends “at least 2”, not “at least 3”.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/plugin/server_test.go` around lines 254 - 260, Extend TestCheckDeviceEntries with an exact-boundary assertion for 120000 entries at factor 1, verifying checkDeviceEntries returns an error containing “at least 2” and does not over-recommend “at least 3”.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@doc/design.md`:
- Line 18: Update the GPU-memory-factor guidance in the memory-unit registration
example to say the per-node value is at most 60000, reflecting the inclusive
limit. Correct the 80GB examples so one card requires factor 2 and two cards
require factor 3, without stating that factor 4 is required.
In `@pkg/plugin/server.go`:
- Around line 66-71: Update checkDeviceEntries to calculate the recommended
gpuMemoryFactor using ceiling division, avoiding the extra increment when the
scaled device count divides evenly by deviceEntryLimit. Add a regression case in
pkg/plugin/server_test.go around lines 254-260 for 120,000 entries at factor 1,
asserting the recommendation is factor 2.
---
Nitpick comments:
In `@pkg/plugin/server_test.go`:
- Around line 254-260: Extend TestCheckDeviceEntries with an exact-boundary
assertion for 120000 entries at factor 1, verifying checkDeviceEntries returns
an error containing “at least 2” and does not over-recommend “at least 3”.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6e91bad0-ca67-4906-aafb-b331cd414574
📒 Files selected for processing (3)
doc/design.mdpkg/plugin/server.gopkg/plugin/server_test.go
|
Turning that silent 4MB drop into a logged, actionable message is a real improvement. A few thoughts:
|
0c777b7 to
9a0316a
Compare
A low gpuMemoryFactor registers more memory devices than kubelet can receive in one ListAndWatch response. Kubelet drops it and the resource stays at 0 with no hint why. Log the count and the factor to use, once per plugin. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
9a0316a to
c5eebe2
Compare
SataQiu
left a comment
There was a problem hiding this comment.
It seems to be just a log warning, without altering the original behavior.
/lgtm
/cc @archlitchi
Reminder: Answers must be written by human being. You can view the relevant rule here. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: archlitchi, mesutoezdil, SataQiu The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes #2187 in Project-HAMi/HAMi.
gpuMemoryFactordecides how many memory devices the plugin registers per GPU. All of them go out in a singleListAndWatchresponse, and kubelet reads it with the default 4MB gRPC limit, so about 60000 devices. Above that the response is dropped andvolcano.sh/vgpu-memorystays at 0 or keeps its last value, with nothing in the plugin log. An 80GB card produces 81920 devices at factor 1, so two cards already pass the limit. This logs the count and the factor to use, and documents the constraint.Summary by CodeRabbit
Documentation
Bug Fixes