Repository navigation
The first release. Evencut finds the GPU time a data-parallel training run loses to padding and waiting, wins it back with a drop-in batch sampler, and picks the machine that finishes the job for the least money.
pip install "evencut[train]"New features
evencut-train diagnose: shows where the GPU time of a planned run goes (useful work, padding, small batches, waiting for the slowest GPU) and what each batching strategy would cost, from a file of sequence lengths. No GPU needed; it takes seconds.BalancedBatchSampler: a one-line change to a PyTorchDataLoader. Every optimizer step trains on the same sequences a shuffledDistributedSamplerputs in it; only which GPU gets which sequence changes. Recipes for PyTorch DDP, the Hugging Face Trainer (EvencutTrainer), Lightning and Accelerate.evencut-train probe: measures a machine for your model shape in about two minutes: step time against batch size, gradient sync, power draw and GPU links.evencut-train pick: ranks machines (your probe files, or vast.ai offers) by the time, cost and energy to finish your job, with the GPU count and batch size for each.- The partitioning engine underneath: exact, proven-optimal splits of an ordered list of costs into k parts, as a C++20 header, a C ABI, a CLI, a Python package, an HTTP service and a Docker image.
Measured
- Rented 2x A100: 1.69x faster steps than
DistributedSampleron Dolly-15k (Hugging Facegroup_by_length: 1.58x). - RTX 4060 simulating 8 GPUs: 4.05x on Dolly-15k and 3.09x on Wikipedia-TR.
- Across 8 rented machines the probe predicted step times within 3.6% (median), and named the cheapest machine for the job in 7 of 8 cases.
- Not every machine gains: on a 2x RTX 4090 box the step got only 5% faster, and
diagnosewith a probe shows that before you change anything.
Every number and its source: How we tested.
Platforms
Wheels with the native library for Linux (x86-64, ARM64), Windows (64- and 32-bit) and macOS (Apple Silicon, Intel); Python 3.9 to 3.13. Elsewhere pip builds from source, or installs the pure-Python backend if no C++20 compiler is available. NVIDIA GPUs are tested; AMD (ROCm) support is prepared but not yet tested on hardware.