Skip to content

fix local gpu queue incomplete preferences#2877

Merged
bghira merged 4 commits into
mainfrom
agent/local-gpu-incomplete-queue-preferences
Jul 23, 2026
Merged

fix local gpu queue incomplete preferences#2877
bghira merged 4 commits into
mainfrom
agent/local-gpu-incomplete-queue-preferences

Conversation

@bghira

@bghira bghira commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

Ports the queued local GPU preference fix from whitejt2/SimpleTuner@53bc999.

Queued local jobs store GPU preferences in allocated_gpus until the allocator starts them. When a multi-process job only has an incomplete preference, such as [0] for two processes, the pending-job processor can treat it as a hard constraint and leave the job queued even when enough other GPUs are available.

This change drops incomplete queued GPU preferences before persisting or reprocessing them, while preserving complete explicit preferences and any_gpu behavior.

Validation

  • .venv/bin/python -m unittest tests.test_local_gpu_allocator tests.test_training_service_gpu -v

@bghira
bghira marked this pull request as ready for review July 23, 2026 14:13
@bghira
bghira requested a review from Copilot July 23, 2026 14:13
bghira and others added 2 commits July 23, 2026 08:26

Copilot AI 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.

Pull request overview

Ports a fix for local GPU queue handling so that queued local jobs don’t get stuck when they have an incomplete GPU preference list (e.g., [0] for a 2-process job). This ensures the allocator can still start jobs when enough GPUs are available, while preserving explicit complete preferences and any_gpu behavior.

Changes:

  • Add _queued_preferred_gpus() to drop incomplete queued GPU preferences before persisting allocated_gpus.
  • Update LocalGPUAllocator.process_pending_jobs() to fall back from incomplete stored preferences at queue-processing time.
  • Add/extend unit tests to cover the persistence and pending-job fallback behavior.

Reviewed changes

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

File Description
simpletuner/simpletuner_sdk/server/services/training_service.py Adds queued GPU preference sanitization and uses it when enqueuing local jobs.
simpletuner/simpletuner_sdk/server/services/local_gpu_allocator.py Ensures queued jobs with incomplete preferences don’t deadlock the allocator.
tests/test_training_service_gpu.py Adds tests for queued GPU preference persistence rules.
tests/test_local_gpu_allocator.py Adds a regression test for pending-job fallback from incomplete GPU preferences and improves the mock store’s allocated GPU tracking.

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

Comment thread simpletuner/simpletuner_sdk/server/services/training_service.py
Comment thread simpletuner/simpletuner_sdk/server/services/local_gpu_allocator.py Outdated
@bghira
bghira merged commit 9eeb4ca into main Jul 23, 2026
2 checks passed
@bghira
bghira deleted the agent/local-gpu-incomplete-queue-preferences branch July 23, 2026 14:36
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