Skip to content

Conversation

@maxxgx
Copy link
Contributor

@maxxgx maxxgx commented Oct 24, 2025

📝 Description

  • Added new device endpoints (remove /models/supported-devices endpoint)
GET /api/inference-devices
{
   devices: ["CPU", "XPU"]
}

GET /api/training-devices
{
   devices: ["CPU", "CUDA"]
}
  • Training job payload now supports device selection:
{"project_id":"0f063adb-2191-410c-b509-ecedd463216b","model_name":"patchcore", "device":"cpu"}

✨ Changes

Select what type of change your PR is:

  • 🚀 New feature (non-breaking change which adds functionality)
  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • 🔄 Refactor (non-breaking change which refactors the code base)
  • ⚡ Performance improvements
  • 🎨 Style changes (code style/formatting)
  • 🧪 Tests (adding/modifying tests)
  • 📚 Documentation update
  • 📦 Build system changes
  • 🚧 CI/CD configuration
  • 🔧 Chore (general maintenance)
  • 🔒 Security update
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)

✅ Checklist

Before you submit your pull request, please make sure you have completed the following steps:

  • 📚 I have made the necessary updates to the documentation (if applicable).
  • 🧪 I have written tests that support my changes and prove that my fix is effective or my feature works (if applicable).
  • 🏷️ My PR title follows conventional commit format.

For more information about code review checklists, see the Code Review Checklist.

Signed-off-by: Ma, Xiangxiang <xiangxiang.ma@intel.com>
Signed-off-by: Ma, Xiangxiang <xiangxiang.ma@intel.com>
Copilot AI review requested due to automatic review settings October 24, 2025 15:18
@maxxgx maxxgx requested a review from samet-akcay as a code owner October 24, 2025 15:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds device selection support for training jobs by introducing separate endpoints for querying inference and training devices, and extending the training job payload to accept an optional device parameter.

  • New endpoints for querying available inference and training devices
  • Training jobs can now specify device via payload
  • Removed deprecated /models/supported-devices endpoint

Reviewed Changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
application/backend/src/utils/devices.py New utility module for querying available inference and training devices
application/backend/src/pydantic_models/devices.py New model for device list responses
application/backend/src/api/endpoints/devices_endpoints.py New endpoints for inference and training device queries
application/backend/src/pydantic_models/job.py Added optional device field to TrainJobPayload
application/backend/src/services/training_service.py Updated training logic to accept and use device parameter
application/backend/src/services/model_service.py Removed get_supported_devices method and related imports
application/backend/src/pydantic_models/model.py Removed SupportedDevices model
application/backend/src/api/endpoints/model_endpoints.py Removed supported-devices endpoint
application/backend/src/main.py Added device_router to application
application/backend/src/core/logging/setup.py Removed redundant global declaration
application/backend/tests/unit/services/test_training_service.py Updated mock to accept device parameter
application/backend/tests/unit/services/test_pipeline_service.py Added train_job_id to test model fixture
application/backend/tests/unit/endpoints/test_models.py Added train_job_id to test model fixture
application/backend/tests/unit/conftest.py Added device field to job payload fixture and train_job_id to model fixture
Comments suppressed due to low confidence (1)

application/backend/src/api/endpoints/model_endpoints.py:1

  • The endpoint path ':supported-devices' uses POST method but appears to be a read-only operation. The original implementation likely should have used GET method instead of POST.
# Copyright (C) 2025 Intel Corporation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: Ma, Xiangxiang <xiangxiang.ma@intel.com>
Copilot AI review requested due to automatic review settings October 24, 2025 15:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: Ma, Xiangxiang <xiangxiang.ma@intel.com>
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@maxxgx maxxgx requested a review from Copilot October 27, 2025 10:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@maxxgx maxxgx merged commit 701aca5 into open-edge-platform:feature/geti-inspect Oct 27, 2025
14 of 17 checks passed
camiloHimura pushed a commit to camiloHimura/anomalib that referenced this pull request Nov 11, 2025
* add training device selection

Signed-off-by: Ma, Xiangxiang <xiangxiang.ma@intel.com>

* fix style

Signed-off-by: Ma, Xiangxiang <xiangxiang.ma@intel.com>

* improve error handling

Signed-off-by: Ma, Xiangxiang <xiangxiang.ma@intel.com>

* reset uv lock

* refactor device names

Signed-off-by: Ma, Xiangxiang <xiangxiang.ma@intel.com>

---------

Signed-off-by: Ma, Xiangxiang <xiangxiang.ma@intel.com>
maxxgx added a commit that referenced this pull request Nov 26, 2025
* add training device selection

Signed-off-by: Ma, Xiangxiang <xiangxiang.ma@intel.com>

* fix style

Signed-off-by: Ma, Xiangxiang <xiangxiang.ma@intel.com>

* improve error handling

Signed-off-by: Ma, Xiangxiang <xiangxiang.ma@intel.com>

* reset uv lock

* refactor device names

Signed-off-by: Ma, Xiangxiang <xiangxiang.ma@intel.com>

---------

Signed-off-by: Ma, Xiangxiang <xiangxiang.ma@intel.com>
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.

3 participants