fix local gpu queue incomplete preferences#2877
Merged
Merged
Conversation
…enqueue fix local queue processing after enqueue
Contributor
There was a problem hiding this comment.
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 persistingallocated_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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the queued local GPU preference fix from whitejt2/SimpleTuner@53bc999.
Queued local jobs store GPU preferences in
allocated_gpusuntil 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_gpubehavior.Validation
.venv/bin/python -m unittest tests.test_local_gpu_allocator tests.test_training_service_gpu -v