-
Notifications
You must be signed in to change notification settings - Fork 1.8k
notify optimizers scheduler of the budget change #6040
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
Conversation
// If GPU is enabled, release all CPU cores except one. | ||
if let Some(_gpu_device) = &gpu_device { | ||
if permit.num_cpus > 1 { | ||
permit.release_cpu_count(permit.num_cpus - 1); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This behavior was broken and would have created problems with changes of this PR. E.g. we don't want to schedule CPU optimization if GPU is available. More correct implementation should involve dedicated GPU permit.
WalkthroughThis pull request refines resource management and optimization processes across multiple modules. In the update handler, the callback signature is modified to support multiple invocations and thread sharing, and terminology is generalized to "Resources." The common budget code consolidates resource release methods into one unified function while adding an optional release callback. Meanwhile, the segment builder removes GPU-specific CPU allocation logic and simplifies permit handling. All changes focus on streamlining control flow and enhancing the responsiveness of resource optimization procedures. Changes
Sequence Diagram(s)sequenceDiagram
participant UH as UpdateHandler
participant RP as ResourcePermit
participant S as Scheduler
UH->>RP: Call launch_optimization(callback)
RP-->>UH: Acquire mutable permit and set on_release callback
RP->>S: Notify scheduler when resources are released
sequenceDiagram
participant SB as SegmentBuilder
participant RP as ResourcePermit
participant Flag as AtomicBool
SB->>RP: Receive immutable permit
SB->>Flag: Check stopped flag
SB-->>SB: Build segment without GPU-specific CPU management
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
⏰ Context from checks skipped due to timeout of 90000ms (6)
🔇 Additional comments (9)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
* notify optimizers scheduler of the budget change * Zero permit count when releasing CPU or IO --------- Co-authored-by: Tim Visée <tim+github@visee.me>
Fixes #6015 for the case, where there are no running updates.
Summary by CodeRabbit