-
Notifications
You must be signed in to change notification settings - Fork 462
Add support for configurable inference device for the model #5478
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
base: develop
Are you sure you want to change the base?
Conversation
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.
Pull request overview
Adds support for selecting an inference device and ensures the model reloads when the device changes.
Changes:
- Extend model activation / loaded model state to include an inference
device. - Trigger model reload on
INFERENCE_DEVICE_CHANGEDevents (including new unit coverage). - Reload the inference model when the configured device differs from the currently loaded one.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| application/backend/app/models/model_activation.py | Adds device to persisted activation state. |
| application/backend/app/services/active_model_service.py | Loads device from active pipeline and reloads model when device changes. |
| application/backend/app/services/event/event_bus.py | Emits model-reload signal on inference device change. |
| application/backend/app/workers/dispatching.py | Subscribes dispatching worker to inference device change event. |
| application/backend/app/repositories/active_model_repo.py | Adds DB query for active pipeline’s configured device. |
| application/backend/tests/unit/services/test_active_model_service.py | Asserts LoadedModel.device matches activation state. |
| application/backend/tests/unit/services/event/test_event_bus.py | Adds test ensuring device-change triggers model reload. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📊 Test coverage report
|
Docker Image SizesCPU
GPU
XPU
|
leoll2
left a comment
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.
LGTM, preferably ask for an additional review since I pushed some changes myself.
Summary
The emitted event is now handled, and the model is reloaded with the desired inference device.
How to test
Start an inference pipeline, check the logs:
Change the device:
Check the logs again:
Checklist