Releases: comiam/gpu-experiment-scheduler
Releases · comiam/gpu-experiment-scheduler
Release list
v1.0.0
Changelog
v1.0.0 - 2026-04-17
Initial public release.
Core
- LPT scheduling - tasks sorted by weight descending; heavy experiments start first, short ones fill gaps at the end.
- Load-aware dispatch - each new task goes to the GPU with the smallest active workload (sum of
Task.weight). - Per-GPU worker pools - configurable
workers_per_gpu(default: 1) to overlap CPU-bound preprocessing with GPU kernels. - Subprocess isolation - every task runs in its own process with
CUDA_VISIBLE_DEVICESset; no shared CUDA contexts. Taskdataclass -(weight, name, seed, cmd)with comparison by weight for LPT,.labelproperty for logging.build_task_matrix()- generates a deduplicated, LPT-sorted task list from anames * seedsgrid withcmd_factorycallback; optionalavailable_nameswhitelist.run_schedule()- main entry point; returns(gpu_id, label, return_code, elapsed_sec)per task.
Resume & progress
--resume- skip tasks whoseseed_*.jsonalready exists in the results directory.scan_completed()- walksresults_dir/<timestamp>/<name>/seed_N.json; supports custom prefix/suffix and optional JSON validation of corrupt/incomplete files.- Progress tracking -
[done/total pct%]tag injected into every log line viaProgressFormatter; ETA based on completed weight; failure count shown asN!.
Robustness
--task-timeout- per-task timeout in seconds; timed-out tasks reportrc=-1.--max-failures- stop scheduling new tasks after N failures, drain in-flight work, report summary.- Stall detection (
stall_warning) - warns when a GPU has no activity for a configurable duration; logs in-flight task labels. - Dead worker recovery - detects crashed worker processes; marks their in-flight tasks as failed (
rc=-9) and continues.
CLI (python -m lab_orchestrator)
- Config loading from YAML (
.yaml/.yml, requirespyyaml), JSON, or Python (.pywithCONFIGdict). - Two command formats:
cmd_template(string with{name}/{seed}placeholders) andcmd_parts(structuredbase+per_name+common). --gpus 0,1,2,3- explicit GPU selection; auto-detect viatorch.cuda.device_count()when omitted.--dry-run- simulate scheduling with heap-based timeline; print per-GPU task assignments and estimated wall-clock.--workers-per-gpu N- concurrent workers sharing each GPU.--results-dir- custom results directory for resume scanning.
tmux mode
--tmux/--tmux-session/--venv/--cwd- generate a bash script with one tmux window per task instead of running programmatically.generate_tmux_script()- programmatic API with LPT-based GPU assignment, virtualenv activation, customrenderercallback, andextra_contextpassthrough.
GPU utilities
detect_gpus()- auto-detect CUDA devices via PyTorch; warns about fork-mode CUDA initialization.parse_gpu_ids()- parse"0,1,2"strings or fall back to auto-detect.
Seed management
set_seed()- fix random state across stdlibrandom, NumPy, PyTorch, TensorFlow, and JAX; auto-detects installed frameworks.deterministic=True- enabletorch.use_deterministic_algorithms, setCUBLAS_WORKSPACE_CONFIGandTF_DETERMINISTIC_OPS.frameworks=filter andwarn_missing=flag for selective seeding.
Logging
- Per-task log files:
logs/<run_timestamp>/gpu<N>_<name>_seed<S>.logcapturing stdout+stderr. - Summary at end: total GPU-hours, wall-clock time, list of failed tasks with return codes.
fmt_duration()- human-readable duration formatting (45s,2m,1h01m).
Examples
examples/sklearn_digits/- minimal working example (no GPU needed): 3 models * 5 seeds with SVM, Random Forest, KNN on digits dataset.examples/sweep/- GPU sweep template withtrain.py+sweep.py+experiments.yaml.examples/experiment_template.py- self-contained launcher + training in one file with checkpointing.examples/tmux_example.py- tmux script generation from code.
Packaging
- Zero hard dependencies - stdlib
multiprocessing+subprocessonly. - Optional extras:
gpu(torch >= 2.0),yaml(pyyaml >= 6.0),dev(ruff, mypy, pytest, flake8). lab-orchestratorCLI entry point viapyproject.toml.- Python >= 3.10 required.
- MIT license.
- Full type annotations; passes
mypy --disallow-untyped-defs. - Test suite: 30+ tests covering task building, GPU parsing, tmux generation, seed reproducibility, resume scanning, progress formatting, dry-run, config loading, and integration.