Skip to content

feat: support per-replica worker and GPU placement - #5286

Open
m199369309 wants to merge 5 commits into
xorbitsai:mainfrom
m199369309:feat/per-replica-placement-backend
Open

feat: support per-replica worker and GPU placement#5286
m199369309 wants to merge 5 commits into
xorbitsai:mainfrom
m199369309:feat/per-replica-placement-backend

Conversation

@m199369309

@m199369309 m199369309 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a typed replica_config launch option to the REST API and sync/async Python clients
  • support selecting a worker, GPU indices, n_gpu, and an alias independently for every replica
  • validate replica placement, resolve exact host:port worker addresses while retaining bare-host compatibility, and ignore worker pinning in local deployment
  • preserve existing OCR request handling and propagate API validation errors without wrapping them as HTTP 500 responses
  • document the launch option and add focused unit tests

Stack

This is PR 1/6 and is the backend foundation for the replica-management stack.

Validation

  • 36 focused Python tests passed
  • Black passed
  • Ruff passed
  • Python byte-compilation passed
  • git diff --check

Follow-up PRs

  1. This PR: backend placement foundation (feat: support per-replica worker and GPU placement #5286)
  2. Per-replica placement UI (feat(webui): add per-replica placement controls #5287)
  3. Replica scale API and clients (feat: support scaling running models by replica #5288)
  4. Replica scale UI (feat(webui): add running-model replica scaling #5289)
  5. Worker recovery correctness (fix: preserve replicas across worker recovery #5290)
  6. Runtime resource reporting and display (feat: expose and display per-replica runtime resources #5291)

The independent launch-model stale-request fix is #5285.

@XprobeBot XprobeBot added this to the v3.x milestone Aug 5, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces per-replica placement configuration (replica_config) for model launches in Xinference, allowing users to pin individual replicas to specific workers and GPU indexes. The changes span documentation, REST API endpoints, Python clients, and supervisor scheduling logic, alongside comprehensive unit tests. The review feedback highlights an opportunity to reduce code duplication in the REST API layer by extracting the replica_config validation and parsing logic into a reusable helper function.

Comment thread xinference/api/restful_api.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants