gpushift 0.1.2__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. {gpushift-0.1.2 → gpushift-0.1.3}/CHANGELOG.md +5 -0
  2. {gpushift-0.1.2 → gpushift-0.1.3}/PKG-INFO +1 -1
  3. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/__init__.py +1 -1
  4. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/scheduler.py +7 -1
  5. {gpushift-0.1.2 → gpushift-0.1.3}/tests/test_scheduler.py +16 -0
  6. {gpushift-0.1.2 → gpushift-0.1.3}/.gitignore +0 -0
  7. {gpushift-0.1.2 → gpushift-0.1.3}/LICENSE +0 -0
  8. {gpushift-0.1.2 → gpushift-0.1.3}/README.md +0 -0
  9. {gpushift-0.1.2 → gpushift-0.1.3}/examples/hf_trainer_resumable.py +0 -0
  10. {gpushift-0.1.2 → gpushift-0.1.3}/examples/lightning_resumable.py +0 -0
  11. {gpushift-0.1.2 → gpushift-0.1.3}/examples/pytorch_resumable.py +0 -0
  12. {gpushift-0.1.2 → gpushift-0.1.3}/pyproject.toml +0 -0
  13. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/__main__.py +0 -0
  14. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/_entry.py +0 -0
  15. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/_proc.py +0 -0
  16. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/autostart.py +0 -0
  17. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/checkpoint.py +0 -0
  18. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/cli.py +0 -0
  19. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/config.py +0 -0
  20. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/control.py +0 -0
  21. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/cpustat.py +0 -0
  22. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/daemon.py +0 -0
  23. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/db.py +0 -0
  24. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/gpumem.py +0 -0
  25. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/gpus.py +0 -0
  26. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/hook.py +0 -0
  27. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/notify.py +0 -0
  28. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/paths.py +0 -0
  29. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/runner.py +0 -0
  30. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/ui.html +0 -0
  31. {gpushift-0.1.2 → gpushift-0.1.3}/src/gpushift/ui.py +0 -0
  32. {gpushift-0.1.2 → gpushift-0.1.3}/tests/conftest.py +0 -0
  33. {gpushift-0.1.2 → gpushift-0.1.3}/tests/jobs/counter.py +0 -0
  34. {gpushift-0.1.2 → gpushift-0.1.3}/tests/test_hook.py +0 -0
  35. {gpushift-0.1.2 → gpushift-0.1.3}/tests/test_integration.py +0 -0
  36. {gpushift-0.1.2 → gpushift-0.1.3}/tests/test_units.py +0 -0
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.3 (2026-11-13)
4
+
5
+ - A job that needs more GPU memory than is free with no jobs running (because
6
+ other programs use it) no longer blocks the jobs behind it.
7
+
3
8
  ## 0.1.2 (2026-11-12)
4
9
 
5
10
  - Removed automatic free mode (freeing the GPUs while you run a game or other
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: gpushift
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Share one GPU machine between AI coding agents and yourself: a GPU job queue that steps aside when you need the GPUs.
5
5
  Project-URL: Homepage, https://github.com/EdwardGlockner/gpushift
6
6
  Project-URL: Issues, https://github.com/EdwardGlockner/gpushift/issues
@@ -4,4 +4,4 @@ Keep this module free of imports: ``gpushift.checkpoint`` is imported by user
4
4
  training scripts and must stay dependency-free.
5
5
  """
6
6
 
7
- __version__ = "0.1.2"
7
+ __version__ = "0.1.3"
@@ -17,6 +17,8 @@ Starvation guard (in-order head with reservations)
17
17
  expected duration says it ends before the waiting job could start anyway
18
18
  (when the running jobs it waits for are expected to end). Jobs without an
19
19
  estimate, or waiting on jobs without one, are simply held back.
20
+ * A job that wouldn't fit even on an idle machine right now (programs outside
21
+ gpushift use the GPU memory it needs) holds nothing back until it would.
20
22
  Without the guard, any job that fits may start, like task-spooler.
21
23
 
22
24
  Dependencies (--after)
@@ -225,6 +227,7 @@ def plan(
225
227
  them, held-back jobs wait."""
226
228
  durations = durations or {}
227
229
  remaining = remaining or {}
230
+ idle = Usage(machine) # the machine with no jobs on it
228
231
  u = Usage(machine)
229
232
  ends: list[tuple[Req, list[int], float | None]] = []
230
233
  for req, gpus in running:
@@ -247,7 +250,10 @@ def plan(
247
250
  start(req, g)
248
251
  continue
249
252
  if g is None:
250
- if guard and (req.barrier or req.uses_gpu):
253
+ # A job that wouldn't fit even with no jobs running (programs outside
254
+ # gpushift hold the memory it needs) holds nothing back: waiting for
255
+ # the queue to empty wouldn't help it.
256
+ if guard and (req.barrier or req.uses_gpu) and idle.fit(req) is not None:
251
257
  deadline = min(deadline, reservation(req, ends, machine))
252
258
  barrier_waiting = barrier_waiting or req.barrier
253
259
  gpu_waiting = True
@@ -234,6 +234,22 @@ def test_packing_respects_memory_and_can_be_off():
234
234
  assert plan([sized(1, 1000), sized(2, 1000), sized(3, 1000)], [], off) == [(1, [0]), (2, [1])]
235
235
 
236
236
 
237
+ def test_a_job_that_cannot_fit_now_holds_nothing_back():
238
+ # The desktop holds 1.5 GB of GPU 0, so a 7.7 GB job fits nowhere, even
239
+ # with no jobs running: the jobs behind it run meanwhile.
240
+ m = Machine(gpus=[0, 1], shared_gpu=1, slots=4, capacity={0: 6700, 1: 6144})
241
+ running = [(one(1), [0])]
242
+ assert plan([sized(2, 7700), one(3)], running, m) == [(3, [1])]
243
+ est = simulate([(sized(2, 7700), 60.0), (one(3), 60.0)], [(one(1), [0], 600.0)], m)
244
+ assert est[2] is None and est[3] == 0.0
245
+ # Once it would fit on an idle machine, it holds the others back again.
246
+ m = Machine(gpus=[0, 1], shared_gpu=1, slots=4, capacity={0: 8192, 1: 6144})
247
+ assert plan([sized(2, 7700), one(3)], running, m) == []
248
+ # Same for a whole-machine job while a program outside gpushift uses GPU 0.
249
+ m = Machine([0, 1], 1, 4, mem_ok={1})
250
+ assert plan([two(2), one(3)], [], m) == [(3, [1])]
251
+
252
+
237
253
  # ------------------------------------------------------------ running jobs ahead of their turn
238
254
 
239
255
  H = 3600.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes