Skip to main content

A minimalist Python project for deep learning experiment management. It uses Ray for core distributed environment and backend setup, and provides basic, no-frills tracking for models, optimizers, and LR schedulers.

Project description

Main codecov

TinyExp

Simple experiment management for PyTorch.

TinyExp is built around one idea: your configured experiment is your entrypoint.

TinyExp demo

Instead of splitting config, launcher, and execution across many files, TinyExp keeps them together in one experiment definition so iteration stays fast and predictable.

What you get in practice:

  • Experiment-centered configuration (Hydra/OmegaConf)
  • CLI overrides without rewriting code
  • Keep your training loop close to plain PyTorch
  • Run the same experiment definition from local debug to distributed launch

Why TinyExp

TinyExp focuses on simple, maintainable experiment management:

  • Your experiment code stays readable.
  • Your config stays structured and easy to override.
  • Your execution path stays consistent as experiments grow.

Design Philosophy

TinyExp is intentionally light.

It is not trying to be a heavy trainer framework that owns your epoch loop, callback system, or full runtime lifecycle. Instead, it focuses on a smaller goal:

  • keep the experiment itself as the main entrypoint
  • keep the training loop in user space
  • make configuration and launch behavior explicit
  • expose shared capabilities through focused XXXCfg components
  • provide thin helpers rather than framework-owned control flow
  • treat examples as reusable recipes, not just demos

In short, TinyExp should help you write less experiment plumbing, not less experiment logic.

For a longer explanation, see docs/philosophy.md.

Quick Start (1 Minute)

Option A: Install with pip and use import-based entrypoint

pip install tinyexp
from tinyexp import store_and_run_exp
from tinyexp.examples.mnist_exp import Exp

store_and_run_exp(Exp)
python your_exp.py
python your_exp.py dataloader_cfg.train_batch_size_per_device=16

Option B: Run the bundled example from source (for development)

git clone https://github.com/HKUST-SAIL/tinyexp.git
cd tinyexp
make install
uv run python tinyexp/examples/mnist_exp.py

Common Commands

Run MNIST with config override:

uv run python tinyexp/examples/mnist_exp.py dataloader_cfg.train_batch_size_per_device=16

Print all available configs:

uv run python tinyexp/examples/mnist_exp.py mode=help

Print all configs plus your overrides:

uv run python tinyexp/examples/mnist_exp.py mode=help dataloader_cfg.train_batch_size_per_device=16

Run a command with TinyExp launch helpers after installing the package:

tinyexp-run-with-redis -- python your_exp.py redis_cache_cfg.redis_cache_enabled=true
tinyexp-run-with-ray-cluster --node-count 2 --head-addr 10.0.0.1 -- python your_exp.py

Example Experiments

For ImageNet example:

export IMAGENET_HOME=/path/to/imagenet
uv run python tinyexp/examples/resnet_exp.py

How It Works

  1. Define an experiment class by inheriting TinyExp.
  2. Keep model/data/optimizer/scheduler config in nested dataclasses.
  3. Implement run() (and train/eval helpers) in the same experiment definition.
  4. Launch the script and override config from CLI when needed.

This gives you a single, explicit place to manage experiment behavior.

Development

Install environment and hooks:

make install

Run checks:

make check

Run tests:

make test

Build docs:

make docs-test

Build package:

make build

Release:

make release VERSION=0.0.4

Documentation

Contributing

PRs and issues are welcome. See CONTRIBUTING.md.

License

MIT License. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tinyexp-0.1.0.tar.gz (52.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tinyexp-0.1.0-py3-none-any.whl (44.7 kB view details)

Uploaded Python 3

File details

Details for the file tinyexp-0.1.0.tar.gz.

File metadata

  • Download URL: tinyexp-0.1.0.tar.gz
  • Upload date:
  • Size: 52.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for tinyexp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ccc413561bcd734726f3d54c33a8c78f573036b8f59cc71474dddfed76828ad5
MD5 79c91ca142ef367b390ab9f838ab64f8
BLAKE2b-256 28037d6a85309ae72a940c9901b6e660af86c6af543149c853ed596c8823443c

See more details on using hashes here.

File details

Details for the file tinyexp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tinyexp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 44.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for tinyexp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4a8923aeceb61888bef11778c6daabac892d7900716b69ddbdfa5f209fcc645
MD5 6a8b511c5154903f69a8c69651747e5a
BLAKE2b-256 1d126a1c0be73962587561495463b9a2b256b3446841da3ff6eb02c1c3820df7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page