BatchTune
BatchTune is a lightweight PyTorch utility for finding either the maximum safe batch size or the batch size with the best measured training throughput.
- Safe maximum batch size — estimates the memory limit without intentionally triggering OOM.
- Best batch size — benchmarks throughput and selects the most efficient batch size for the current training pipeline and hardware.
- Supports CUDA and MPS.
- Allows passing custom DataLoader parameters without changing the usual PyTorch workflow.
- Verbose output — shows memory probes and throughput benchmarks for monitoring and manual analysis.
Usage
best_bs = find_best_batch_size(
model,
optimizer,
loss_fn,
dataset,
device=device,
verbose=True,
)
Created by Denys Bondarchuk. Feel free to reach out or contribute to the project.
Metadata
Release files for batchtune 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| batchtune-0.1.1.tar.gz | 4.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| batchtune-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.0 kB
Release files / batchtune-0.1.1.tar.gz
| Download URL | batchtune-0.1.1.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba72bc73c9f4ea0c184ac461e7ad7b12fa616c11268b7f0f0c567c87927f4845
|
|
BLAKE2b-256 checksum How to use checksums |
56dca219a88a7c8b047981c2a47ceddcc366554fa4e68c4487bcf6fb6bdf87a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / batchtune-0.1.1-py3-none-any.whl
| Download URL | batchtune-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0191f38525b4191c2a98492d5979016c90fd2d1dbebbe7d9d0e54373610e9cda
|
|
BLAKE2b-256 checksum How to use checksums |
e8a21187ef5d920d105c1d02dcd98ba6521cc40cc411ca0281074c7b09805d19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for batchtune 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.