TinyExp 0.2.0__tar.gz → 0.2.1__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.
- {tinyexp-0.2.0 → tinyexp-0.2.1}/.gitignore +7 -0
- tinyexp-0.2.1/CHANGELOG.md +130 -0
- {tinyexp-0.2.0 → tinyexp-0.2.1}/CONTRIBUTING.md +44 -4
- tinyexp-0.2.1/Makefile +102 -0
- tinyexp-0.2.1/PKG-INFO +163 -0
- tinyexp-0.2.1/README.md +71 -0
- {tinyexp-0.2.0 → tinyexp-0.2.1}/pyproject.toml +61 -14
- {tinyexp-0.2.0 → tinyexp-0.2.1}/tests/conftest.py +11 -2
- tinyexp-0.2.1/tests/dataset/test_sampler.py +123 -0
- tinyexp-0.2.1/tests/examples/test_examples_help_smoke.py +225 -0
- tinyexp-0.2.1/tests/examples/test_examples_run.py +165 -0
- tinyexp-0.2.1/tests/examples/test_minimind_dpo_exp.py +21 -0
- tinyexp-0.2.1/tests/examples/test_minimind_grpo_exp.py +16 -0
- tinyexp-0.2.1/tests/examples/test_minimind_lora_exp.py +41 -0
- tinyexp-0.2.1/tests/examples/test_minimind_ppo_exp.py +120 -0
- tinyexp-0.2.1/tests/examples/test_minimind_sft_exp.py +27 -0
- tinyexp-0.2.1/tests/examples/test_mnist_exp.py +173 -0
- tinyexp-0.2.1/tests/examples/test_pi_exp.py +31 -0
- tinyexp-0.2.1/tests/examples/test_resnet_exp.py +358 -0
- tinyexp-0.2.1/tests/examples/test_vit_tp_exp.py +285 -0
- tinyexp-0.2.1/tests/examples/test_wan21_lora_exp.py +96 -0
- tinyexp-0.2.1/tests/scripts/test_run_with_ray_cluster.py +140 -0
- tinyexp-0.2.1/tests/scripts/test_run_with_redis.py +618 -0
- tinyexp-0.2.1/tests/test_ray_multinode_integration.py +177 -0
- tinyexp-0.2.1/tests/test_tinyexp.py +166 -0
- tinyexp-0.2.1/tests/test_tinyexp_artifacts.py +314 -0
- tinyexp-0.2.1/tests/tiny_engine/test_cpu_accelerator_unit.py +188 -0
- tinyexp-0.2.1/tests/tiny_engine/test_ddp_accelerator.py +72 -0
- tinyexp-0.2.1/tests/tiny_engine/test_ddp_fsdp_accelerator_unit.py +206 -0
- tinyexp-0.2.1/tests/tiny_engine/test_hf_accelerator_unit.py +29 -0
- {tinyexp-0.2.0 → tinyexp-0.2.1}/tests/utils/test_log_utils.py +18 -0
- tinyexp-0.2.1/tests/utils/test_ray_utils_unit.py +652 -0
- tinyexp-0.2.1/tests/utils/test_redis_utils.py +675 -0
- tinyexp-0.2.1/tinyexp/__init__.py +357 -0
- {tinyexp-0.2.0 → tinyexp-0.2.1}/tinyexp/cli/run_with_ray_cluster.py +81 -28
- {tinyexp-0.2.0 → tinyexp-0.2.1}/tinyexp/cli/run_with_redis.py +287 -345
- tinyexp-0.2.1/tinyexp/dataset/__init__.py +13 -0
- {tinyexp-0.2.0 → tinyexp-0.2.1}/tinyexp/dataset/fake_dataloader.py +7 -1
- tinyexp-0.2.1/tinyexp/dataset/sampler.py +157 -0
- tinyexp-0.2.1/tinyexp/examples/README.md +40 -0
- tinyexp-0.2.1/tinyexp/examples/assets/imagenet_smoke/train/circle/circle.jpg +0 -0
- tinyexp-0.2.1/tinyexp/examples/assets/imagenet_smoke/train/cross/cross.jpg +0 -0
- tinyexp-0.2.1/tinyexp/examples/assets/imagenet_smoke/train/diamond/diamond.jpg +0 -0
- tinyexp-0.2.1/tinyexp/examples/assets/imagenet_smoke/train/square/square.jpg +0 -0
- tinyexp-0.2.1/tinyexp/examples/assets/imagenet_smoke/train/triangle/triangle.jpg +0 -0
- tinyexp-0.2.1/tinyexp/examples/assets/imagenet_smoke/val/circle/circle.jpg +0 -0
- tinyexp-0.2.1/tinyexp/examples/assets/imagenet_smoke/val/cross/cross.jpg +0 -0
- tinyexp-0.2.1/tinyexp/examples/assets/imagenet_smoke/val/diamond/diamond.jpg +0 -0
- tinyexp-0.2.1/tinyexp/examples/assets/imagenet_smoke/val/square/square.jpg +0 -0
- tinyexp-0.2.1/tinyexp/examples/assets/imagenet_smoke/val/triangle/triangle.jpg +0 -0
- tinyexp-0.2.1/tinyexp/examples/assets/minimind/dpo_smoke.jsonl +4 -0
- tinyexp-0.2.1/tinyexp/examples/assets/minimind/rlaif_smoke.jsonl +4 -0
- tinyexp-0.2.1/tinyexp/examples/assets/minimind/sft_smoke.jsonl +4 -0
- tinyexp-0.2.1/tinyexp/examples/assets/minimind/tokenizer.json +31191 -0
- tinyexp-0.2.1/tinyexp/examples/assets/minimind/tokenizer_config.json +335 -0
- tinyexp-0.2.1/tinyexp/examples/minimind/LICENSE +201 -0
- tinyexp-0.2.1/tinyexp/examples/minimind/__init__.py +5 -0
- tinyexp-0.2.1/tinyexp/examples/minimind/dataset.py +162 -0
- tinyexp-0.2.1/tinyexp/examples/minimind/minimind_dpo_exp.py +154 -0
- tinyexp-0.2.1/tinyexp/examples/minimind/minimind_grpo_exp.py +312 -0
- tinyexp-0.2.1/tinyexp/examples/minimind/minimind_lora_exp.py +151 -0
- tinyexp-0.2.1/tinyexp/examples/minimind/minimind_ppo_exp.py +348 -0
- tinyexp-0.2.1/tinyexp/examples/minimind/minimind_sft_exp.py +202 -0
- tinyexp-0.2.1/tinyexp/examples/minimind/model.py +413 -0
- {tinyexp-0.2.0 → tinyexp-0.2.1}/tinyexp/examples/mnist_exp.py +141 -64
- {tinyexp-0.2.0 → tinyexp-0.2.1}/tinyexp/examples/pi_exp.py +37 -19
- {tinyexp-0.2.0 → tinyexp-0.2.1}/tinyexp/examples/resnet_exp.py +187 -76
- tinyexp-0.2.1/tinyexp/examples/vit_tp_exp.py +1363 -0
- tinyexp-0.2.1/tinyexp/examples/wan21_lora_exp.py +356 -0
- {tinyexp-0.2.0 → tinyexp-0.2.1}/tinyexp/exceptions.py +31 -3
- tinyexp-0.2.1/tinyexp/exp_mixins/__init__.py +27 -0
- tinyexp-0.2.1/tinyexp/exp_mixins/basic_mixins.py +739 -0
- tinyexp-0.2.1/tinyexp/tiny_engine/__init__.py +6 -0
- tinyexp-0.2.1/tinyexp/tiny_engine/accelerator/__init__.py +31 -0
- tinyexp-0.2.1/tinyexp/tiny_engine/accelerator/base_accelerator.py +309 -0
- tinyexp-0.2.1/tinyexp/tiny_engine/accelerator/cpu_accelerator.py +111 -0
- tinyexp-0.2.1/tinyexp/tiny_engine/accelerator/ddp_accelerator.py +140 -0
- tinyexp-0.2.1/tinyexp/tiny_engine/accelerator/fsdp_accelerator.py +233 -0
- tinyexp-0.2.1/tinyexp/tiny_engine/accelerator/hf_accelerator.py +63 -0
- tinyexp-0.2.1/tinyexp/tiny_engine/accelerator/tp_accelerator.py +148 -0
- tinyexp-0.2.1/tinyexp/utils/__init__.py +7 -0
- {tinyexp-0.2.0 → tinyexp-0.2.1}/tinyexp/utils/log_utils.py +12 -2
- {tinyexp-0.2.0 → tinyexp-0.2.1}/tinyexp/utils/model_utils.py +5 -0
- tinyexp-0.2.1/tinyexp/utils/ray_utils.py +305 -0
- {tinyexp-0.2.0 → tinyexp-0.2.1}/tinyexp/utils/redis_utils.py +209 -40
- tinyexp-0.2.0/CHANGELOG.md +0 -114
- tinyexp-0.2.0/Makefile +0 -58
- tinyexp-0.2.0/PKG-INFO +0 -250
- tinyexp-0.2.0/README.md +0 -193
- tinyexp-0.2.0/tests/dataset/test_sampler.py +0 -41
- tinyexp-0.2.0/tests/examples/test_cli_overrides.py +0 -40
- tinyexp-0.2.0/tests/examples/test_mnist_exp_run.py +0 -57
- tinyexp-0.2.0/tests/examples/test_mnist_exp_unit.py +0 -50
- tinyexp-0.2.0/tests/examples/test_resnet_exp_run.py +0 -450
- tinyexp-0.2.0/tests/scripts/test_run_with_ray_cluster.py +0 -66
- tinyexp-0.2.0/tests/scripts/test_run_with_redis.py +0 -332
- tinyexp-0.2.0/tests/test_tinyexp.py +0 -169
- tinyexp-0.2.0/tests/test_tinyexp_artifacts.py +0 -175
- tinyexp-0.2.0/tests/tine_engine/test_cpu_accelerator.py +0 -47
- tinyexp-0.2.0/tests/tine_engine/test_cpu_accelerator_unit.py +0 -33
- tinyexp-0.2.0/tests/tine_engine/test_ddp_accelerator.py +0 -77
- tinyexp-0.2.0/tests/tine_engine/test_ddp_accelerator_unit.py +0 -15
- tinyexp-0.2.0/tests/utils/test_ray_utils_unit.py +0 -277
- tinyexp-0.2.0/tests/utils/test_redis_utils.py +0 -29
- tinyexp-0.2.0/tests/utils/test_redis_utils_unit.py +0 -324
- tinyexp-0.2.0/tinyexp/__init__.py +0 -212
- tinyexp-0.2.0/tinyexp/dataset/__init__.py +0 -7
- tinyexp-0.2.0/tinyexp/dataset/sampler.py +0 -63
- tinyexp-0.2.0/tinyexp/exp_mixins/__init__.py +0 -3
- tinyexp-0.2.0/tinyexp/exp_mixins/basic_mixins.py +0 -291
- tinyexp-0.2.0/tinyexp/tiny_engine/accelerator/__init__.py +0 -12
- tinyexp-0.2.0/tinyexp/tiny_engine/accelerator/base_accelerator.py +0 -71
- tinyexp-0.2.0/tinyexp/tiny_engine/accelerator/cpu_accelerator.py +0 -93
- tinyexp-0.2.0/tinyexp/tiny_engine/accelerator/ddp_accelerator.py +0 -154
- tinyexp-0.2.0/tinyexp/tiny_engine/accelerator/hf_accelerator.py +0 -21
- tinyexp-0.2.0/tinyexp/utils/__init__.py +0 -0
- tinyexp-0.2.0/tinyexp/utils/ray_utils.py +0 -136
- {tinyexp-0.2.0 → tinyexp-0.2.1}/LICENSE +0 -0
- {tinyexp-0.2.0 → tinyexp-0.2.1}/tests/utils/test_model_utils.py +0 -0
- {tinyexp-0.2.0 → tinyexp-0.2.1}/tinyexp/cli/__init__.py +0 -0
- {tinyexp-0.2.0 → tinyexp-0.2.1}/tinyexp/examples/__init__.py +0 -0
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
docs/source
|
|
2
2
|
|
|
3
|
+
# macOS metadata
|
|
4
|
+
.DS_Store
|
|
5
|
+
**/.DS_Store
|
|
6
|
+
|
|
3
7
|
# From https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore
|
|
4
8
|
|
|
5
9
|
# Byte-compiled / optimized / DLL files
|
|
@@ -152,3 +156,6 @@ wandb/
|
|
|
152
156
|
|
|
153
157
|
# Local/private launch adapters and machine-specific scripts.
|
|
154
158
|
local/
|
|
159
|
+
|
|
160
|
+
# Generated from the local virtual environment.
|
|
161
|
+
pyrightconfig.json
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.2.1] - 2026-12-05
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Added mixed-precision training across accelerators, FSDP support for the ResNet recipe, and a tensor-parallel DeiT-S recipe (#30).
|
|
8
|
+
- Added MiniMind recipes for SFT, LoRA, DPO, PPO, and GRPO, plus a Wan 2.1 LoRA video training recipe (#36).
|
|
9
|
+
- Added Trackio and SwanLab experiment tracking and SOCKS proxy support for the SwanLab extra (#33).
|
|
10
|
+
- Bundled a synthetic ImageNet dataset for CPU smoke runs.
|
|
11
|
+
- Added Redis authentication and bound the Ray dashboard to the loopback interface by default (#34).
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Reorganized the README around training tasks and expanded the experiment, launcher, and accelerator documentation (#35).
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- Bound NCCL collectives to rank devices and applied autocast in `prepare_model` for mixed-precision runs.
|
|
20
|
+
- Hardened config, checkpoint, and launcher handling and restored Python 3.9 configuration support for the tensor-parallel ViT example.
|
|
21
|
+
- Logged tracker metrics at `global_step`, named tracker runs after `exp_name`, and flattened nested SwanLab settings for the local dashboard.
|
|
22
|
+
|
|
23
|
+
## [0.1.4] - 2026-09-05
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- harden distributed execution and add Python 3.14 support (#29)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- ✏️ update usage docs and demo assets
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- 🐛 avoid Python 3.14 Ray shutdown tracker errors
|
|
39
|
+
|
|
40
|
+
- 🐛 preserve final Ray run output
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## [0.1.3] - 2026-08-25
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Fixed
|
|
47
|
+
|
|
48
|
+
- harden distributed execution and expand run-mode coverage (#27)
|
|
49
|
+
|
|
50
|
+
- 🐛 fix Ray topology before actor creation (#28)
|
|
51
|
+
|
|
52
|
+
- 🐛 avoid duplicated help configuration output
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## [0.1.2] - 2026-08-08
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### Fixed
|
|
59
|
+
|
|
60
|
+
- run_with_redis: single-node local Redis no longer fails with "--node-rank must be < --node-count" when a multi-machine launcher exports NODE_RANK>=1; the rank guard now only applies to multi-node cluster mode
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
## [0.1.1] - 2026-08-08
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Changed
|
|
67
|
+
|
|
68
|
+
- simplify experiment configs and expose Ray orchestration (#26)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## [0.1.0] - 2026-07-15
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
### Added
|
|
75
|
+
|
|
76
|
+
- 🎸 update readme
|
|
77
|
+
|
|
78
|
+
- add Ray and Redis distributed launch support (#25)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### Changed
|
|
82
|
+
|
|
83
|
+
- Support continue train, support ckpt saving and loading (#24)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## [0.0.5] - 2026-03-06
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Added
|
|
90
|
+
|
|
91
|
+
- 🎸 update readme, add more introduction and gif
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
### Changed
|
|
95
|
+
|
|
96
|
+
- 🤖 update readme
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
### Fixed
|
|
100
|
+
|
|
101
|
+
- 🐛 warning of ray resource_tracker and gloo_socket_ifname
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
## [0.0.4] - 2026-02-26
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
### Added
|
|
108
|
+
|
|
109
|
+
- 🎸 integrate git-cliff changelog automation
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
## [0.0.3] - 2026-02-26
|
|
113
|
+
|
|
114
|
+
### Added
|
|
115
|
+
- Automatically derive experiment name from the entrypoint script. (#23)
|
|
116
|
+
|
|
117
|
+
## [0.0.2] - 2026-01-19
|
|
118
|
+
|
|
119
|
+
### Added
|
|
120
|
+
- Automatically acquire `exp_class`. (#21)
|
|
121
|
+
- Add template for experiment launch. (#20)
|
|
122
|
+
|
|
123
|
+
### Fixed
|
|
124
|
+
- Minor fixes. (#22)
|
|
125
|
+
- Fix redis utils and improve coverage. (#19)
|
|
126
|
+
|
|
127
|
+
## [0.0.1] - 2025-12-24
|
|
128
|
+
|
|
129
|
+
### Added
|
|
130
|
+
- Initial release.
|
|
@@ -62,13 +62,30 @@ git clone git@github.com:YOUR_NAME/TinyExp.git
|
|
|
62
62
|
cd TinyExp
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
Install the core environment and pre-commit hooks:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
|
|
68
|
+
make install
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
`make install` preserves any optional accelerator packages already selected for the machine. For a fresh test
|
|
72
|
+
environment, install the `vit` and `video` extras with automatic PyTorch backend selection.
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
make install-pytorch EXTRAS=vit,video
|
|
76
|
+
source .venv/bin/activate
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
For a preselected CUDA, ROCm, or vendor build, use `make install` (or `make install-without-pytorch`) and install
|
|
80
|
+
`torch`, `torchvision`, and `accelerate` together for that backend. Ordinary `uv run` keeps these optional packages;
|
|
81
|
+
you do not need to repeat `--no-sync`. Avoid `uv sync` without `--inexact` in that environment. For Ray, launch with
|
|
82
|
+
the active environment’s `python`; see [backend setup](docs/running-modes.md#common-requirements) and
|
|
83
|
+
[Ray’s interaction with `uv run`](docs/running-modes.md#local-ray-workers).
|
|
84
|
+
|
|
85
|
+
If the project environment already has a compatible PyTorch stack, add the example extras for the test suite with
|
|
86
|
+
`uv pip install --python .venv -e '.[vit,video]'`. This keeps compatible installed builds.
|
|
87
|
+
|
|
88
|
+
4. If you set up the environment without `make install`, install the pre-commit hooks separately:
|
|
72
89
|
|
|
73
90
|
```bash
|
|
74
91
|
uv run pre-commit install
|
|
@@ -90,7 +107,15 @@ Now you can make your changes locally.
|
|
|
90
107
|
make check
|
|
91
108
|
```
|
|
92
109
|
|
|
93
|
-
|
|
110
|
+
8. Run the full suite without coverage during development:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
make test-fast
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
This runs example help and documentation checks, Ray integration tests, and the remaining tests in three parallel
|
|
117
|
+
pytest sessions. The GPU DDP test skips when fewer than two CUDA GPUs are available. For coverage, run the same
|
|
118
|
+
groups and combine their results into `coverage.xml` with:
|
|
94
119
|
|
|
95
120
|
```bash
|
|
96
121
|
make test
|
|
@@ -116,6 +141,21 @@ git push origin name-of-your-bugfix-or-feature
|
|
|
116
141
|
|
|
117
142
|
11. Submit a pull request through the GitHub website.
|
|
118
143
|
|
|
144
|
+
## Build and release
|
|
145
|
+
|
|
146
|
+
Build the documentation strictly and build the package:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
make docs-test
|
|
150
|
+
make build
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Maintainers can cut a release by setting `VERSION` to the version being released, for example:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
make release VERSION=0.0.4
|
|
157
|
+
```
|
|
158
|
+
|
|
119
159
|
# Pull Request Guidelines
|
|
120
160
|
|
|
121
161
|
Before you submit a pull request, check that it meets these guidelines:
|
tinyexp-0.2.1/Makefile
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
EXTRAS ?= pytorch
|
|
2
|
+
|
|
3
|
+
.PHONY: install
|
|
4
|
+
install: ## Install core dependencies while preserving machine-selected optional packages
|
|
5
|
+
@echo "🚀 Creating virtual environment using uv"
|
|
6
|
+
@uv sync --locked --inexact
|
|
7
|
+
@uv run pre-commit install
|
|
8
|
+
|
|
9
|
+
.PHONY: install-pytorch
|
|
10
|
+
install-pytorch: install-without-pytorch ## Install PyTorch for this machine, with optional EXTRAS=video,vit
|
|
11
|
+
@uv pip install --python "$${UV_PROJECT_ENVIRONMENT:-.venv}" --torch-backend auto -e '.[$(EXTRAS)]'
|
|
12
|
+
|
|
13
|
+
.PHONY: install-without-pytorch
|
|
14
|
+
install-without-pytorch: ## Install core dependencies while preserving machine-selected accelerator packages
|
|
15
|
+
@uv sync --locked --no-extra pytorch --inexact
|
|
16
|
+
|
|
17
|
+
.PHONY: generate-pyrightconfig
|
|
18
|
+
generate-pyrightconfig: ## Generate pyrightconfig.json from .venv Python
|
|
19
|
+
@uv run python scripts/generate_pyrightconfig.py
|
|
20
|
+
|
|
21
|
+
.PHONY: check
|
|
22
|
+
check: ## Run code quality tools.
|
|
23
|
+
@echo "🚀 Checking lock file consistency with 'pyproject.toml'"
|
|
24
|
+
@uv lock --locked
|
|
25
|
+
@echo "🚀 Linting code: Running pre-commit"
|
|
26
|
+
@uv run pre-commit run -a
|
|
27
|
+
# @echo "🚀 Static type checking: Running mypy"
|
|
28
|
+
# @uv run mypy
|
|
29
|
+
|
|
30
|
+
test_shards := test-fast-help test-fast-ray test-fast-rest
|
|
31
|
+
test_help_file := tests/examples/test_examples_help_smoke.py
|
|
32
|
+
test_ray_files := tests/test_ray_multinode_integration.py tests/tiny_engine/test_ddp_accelerator.py
|
|
33
|
+
test_ray_redis := tests/utils/test_redis_utils.py::test_redis_cluster_manager_with_real_redis_on_ray
|
|
34
|
+
|
|
35
|
+
test_coverage_args := --no-cov
|
|
36
|
+
ifneq ($(test_coverage_dir),)
|
|
37
|
+
test_coverage_env = COVERAGE_FILE="$(test_coverage_dir)/.coverage.$@"
|
|
38
|
+
test_coverage_args := --cov --cov-config=pyproject.toml --cov-report=
|
|
39
|
+
endif
|
|
40
|
+
test_pytest = $(test_coverage_env) RAY_ENABLE_UV_RUN_RUNTIME_ENV=0 uv run python -m pytest -p no:cacheprovider $(test_coverage_args)
|
|
41
|
+
|
|
42
|
+
.PHONY: test-fast $(test_shards)
|
|
43
|
+
test-fast: ## Run the full test suite in parallel without coverage
|
|
44
|
+
@$(MAKE) -j3 $(test_shards)
|
|
45
|
+
|
|
46
|
+
test-fast-help:
|
|
47
|
+
@$(test_pytest) $(test_help_file)
|
|
48
|
+
|
|
49
|
+
# Keep the Ray integration tests in one pytest session so DDP and Redis share their fixture.
|
|
50
|
+
test-fast-ray:
|
|
51
|
+
@$(test_pytest) $(test_ray_files) $(test_ray_redis)
|
|
52
|
+
|
|
53
|
+
test-fast-rest:
|
|
54
|
+
@$(test_pytest) $(addprefix --ignore=,$(test_help_file) $(test_ray_files)) \
|
|
55
|
+
--deselect=$(test_ray_redis)
|
|
56
|
+
|
|
57
|
+
.PHONY: test
|
|
58
|
+
test: ## Run the full test suite in parallel and write coverage.xml
|
|
59
|
+
@coverage_dir=$$(mktemp -d) && \
|
|
60
|
+
trap 'rm -rf "$$coverage_dir"' EXIT && \
|
|
61
|
+
$(MAKE_COMMAND) -j3 $(test_shards) test_coverage_dir="$$coverage_dir" && \
|
|
62
|
+
uv run coverage combine --rcfile=pyproject.toml $(foreach shard,$(test_shards),"$$coverage_dir/.coverage.$(shard)") && \
|
|
63
|
+
uv run coverage xml --rcfile=pyproject.toml
|
|
64
|
+
|
|
65
|
+
.PHONY: build
|
|
66
|
+
build: clean-build ## Build wheel file
|
|
67
|
+
@echo "🚀 Creating wheel file"
|
|
68
|
+
@uvx --from build pyproject-build --installer uv
|
|
69
|
+
|
|
70
|
+
.PHONY: clean-build
|
|
71
|
+
clean-build: ## Clean build artifacts
|
|
72
|
+
@echo "🚀 Removing build artifacts"
|
|
73
|
+
@uv run python -c "import shutil; import os; shutil.rmtree('dist') if os.path.exists('dist') else None"
|
|
74
|
+
|
|
75
|
+
.PHONY: publish
|
|
76
|
+
publish: ## Publish a release to PyPI.
|
|
77
|
+
@echo "🚀 Publishing."
|
|
78
|
+
@uvx twine upload --repository pypi dist/*
|
|
79
|
+
# @uvx twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
|
|
80
|
+
|
|
81
|
+
.PHONY: build-and-publish
|
|
82
|
+
build-and-publish: build publish ## Build and publish.
|
|
83
|
+
|
|
84
|
+
.PHONY: release
|
|
85
|
+
release: ## Release with checks, tests, build, publish, commit, tag, and push. Usage: make release VERSION=0.0.4
|
|
86
|
+
@if [ -z "$(VERSION)" ]; then echo "VERSION is required, e.g. make release VERSION=0.0.4"; exit 1; fi
|
|
87
|
+
@./scripts/release.sh $(VERSION)
|
|
88
|
+
|
|
89
|
+
.PHONY: docs-test
|
|
90
|
+
docs-test: ## Test if documentation can be built without warnings or errors
|
|
91
|
+
@uv run mkdocs build -s
|
|
92
|
+
|
|
93
|
+
.PHONY: docs
|
|
94
|
+
docs: ## Build and serve the documentation
|
|
95
|
+
@uv run mkdocs serve
|
|
96
|
+
|
|
97
|
+
.PHONY: help
|
|
98
|
+
help:
|
|
99
|
+
@uv run python -c "import re; \
|
|
100
|
+
[[print(f'\033[36m{m[0]:<20}\033[0m {m[1]}') for m in re.findall(r'^([a-zA-Z_-]+):.*?## (.*)$$', open(makefile).read(), re.M)] for makefile in ('$(MAKEFILE_LIST)').strip().split()]"
|
|
101
|
+
|
|
102
|
+
.DEFAULT_GOAL := help
|
tinyexp-0.2.1/PKG-INFO
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: TinyExp
|
|
3
|
+
Version: v0.2.1
|
|
4
|
+
Summary: 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.
|
|
5
|
+
Project-URL: Homepage, https://zengarden.github.io/TinyExp/
|
|
6
|
+
Project-URL: Repository, https://github.com/zengarden/TinyExp
|
|
7
|
+
Project-URL: Documentation, https://zengarden.github.io/TinyExp/
|
|
8
|
+
Author-email: Zeming LI <zane.li@connect.ust.hk>
|
|
9
|
+
License: MIT License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2025 Zeming LI
|
|
12
|
+
|
|
13
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
in the Software without restriction, including without limitation the rights
|
|
16
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
furnished to do so, subject to the following conditions:
|
|
19
|
+
|
|
20
|
+
The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
copies or substantial portions of the Software.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
SOFTWARE.
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Keywords: python
|
|
32
|
+
Classifier: Intended Audience :: Developers
|
|
33
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
34
|
+
Classifier: Programming Language :: Python
|
|
35
|
+
Classifier: Programming Language :: Python :: 3
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
42
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
43
|
+
Requires-Python: <4.0,>=3.9
|
|
44
|
+
Requires-Dist: hydra-core
|
|
45
|
+
Requires-Dist: loguru
|
|
46
|
+
Requires-Dist: loguru>=0.7.3
|
|
47
|
+
Requires-Dist: numpy; python_version < '3.14'
|
|
48
|
+
Requires-Dist: numpy>=2.3.2; python_version >= '3.14'
|
|
49
|
+
Requires-Dist: omegaconf
|
|
50
|
+
Requires-Dist: psutil
|
|
51
|
+
Requires-Dist: ray; python_version >= '3.10'
|
|
52
|
+
Requires-Dist: ray<2.52; python_version < '3.10'
|
|
53
|
+
Requires-Dist: redis
|
|
54
|
+
Requires-Dist: rpds-py>=0.26; python_version >= '3.14'
|
|
55
|
+
Requires-Dist: tabulate
|
|
56
|
+
Requires-Dist: tqdm
|
|
57
|
+
Requires-Dist: trackio; python_version >= '3.10'
|
|
58
|
+
Requires-Dist: wandb
|
|
59
|
+
Provides-Extra: pytorch
|
|
60
|
+
Requires-Dist: accelerate; extra == 'pytorch'
|
|
61
|
+
Requires-Dist: pillow>=11.3; (python_version >= '3.14') and extra == 'pytorch'
|
|
62
|
+
Requires-Dist: torch; (python_version < '3.14') and extra == 'pytorch'
|
|
63
|
+
Requires-Dist: torch>=2.13; (python_version >= '3.14') and extra == 'pytorch'
|
|
64
|
+
Requires-Dist: torchvision; (python_version < '3.14') and extra == 'pytorch'
|
|
65
|
+
Requires-Dist: torchvision>=0.28; (python_version >= '3.14') and extra == 'pytorch'
|
|
66
|
+
Provides-Extra: swanlab
|
|
67
|
+
Requires-Dist: pysocks; extra == 'swanlab'
|
|
68
|
+
Requires-Dist: swanlab>=0.10.6; extra == 'swanlab'
|
|
69
|
+
Provides-Extra: video
|
|
70
|
+
Requires-Dist: accelerate; extra == 'video'
|
|
71
|
+
Requires-Dist: diffusers>=0.34; extra == 'video'
|
|
72
|
+
Requires-Dist: ftfy; extra == 'video'
|
|
73
|
+
Requires-Dist: imageio[ffmpeg]; extra == 'video'
|
|
74
|
+
Requires-Dist: peft>=0.15; extra == 'video'
|
|
75
|
+
Requires-Dist: pillow>=11.3; (python_version >= '3.14') and extra == 'video'
|
|
76
|
+
Requires-Dist: sentencepiece; extra == 'video'
|
|
77
|
+
Requires-Dist: torch; (python_version < '3.14') and extra == 'video'
|
|
78
|
+
Requires-Dist: torch>=2.1; extra == 'video'
|
|
79
|
+
Requires-Dist: torch>=2.13; (python_version >= '3.14') and extra == 'video'
|
|
80
|
+
Requires-Dist: torchvision; (python_version < '3.14') and extra == 'video'
|
|
81
|
+
Requires-Dist: torchvision>=0.28; (python_version >= '3.14') and extra == 'video'
|
|
82
|
+
Requires-Dist: transformers>=4.44.2; extra == 'video'
|
|
83
|
+
Provides-Extra: vit
|
|
84
|
+
Requires-Dist: accelerate; extra == 'vit'
|
|
85
|
+
Requires-Dist: pillow>=11.3; (python_version >= '3.14') and extra == 'vit'
|
|
86
|
+
Requires-Dist: timm>=1.0; extra == 'vit'
|
|
87
|
+
Requires-Dist: torch; (python_version < '3.14') and extra == 'vit'
|
|
88
|
+
Requires-Dist: torch>=2.13; (python_version >= '3.14') and extra == 'vit'
|
|
89
|
+
Requires-Dist: torchvision; (python_version < '3.14') and extra == 'vit'
|
|
90
|
+
Requires-Dist: torchvision>=0.28; (python_version >= '3.14') and extra == 'vit'
|
|
91
|
+
Description-Content-Type: text/markdown
|
|
92
|
+
|
|
93
|
+
<a name="tinyexp"></a>
|
|
94
|
+
|
|
95
|
+
# TinyExp — Self-contained examples you can learn from and run with one command.
|
|
96
|
+
|
|
97
|
+
Each `*_exp.py` file keeps the run commands, configuration, and training loop together, as in the [MNIST example](tinyexp/examples/mnist_exp.py).
|
|
98
|
+
Start on a CPU or a single GPU, then scale your research experiments to [multi-node training](docs/running-modes.md#static-ray-cluster).
|
|
99
|
+
For example, [DeiT-S](docs/vit_tp.md#cross-check-record) reached 79.84% top-1 accuracy on ImageNet after training from scratch for 17h 56m on a single node with eight H200 GPUs.
|
|
100
|
+
|
|
101
|
+

|
|
102
|
+
|
|
103
|
+
<details>
|
|
104
|
+
|
|
105
|
+
<summary>Preview a bundled Wan training clip</summary>
|
|
106
|
+
|
|
107
|
+

|
|
108
|
+
|
|
109
|
+
</details>
|
|
110
|
+
|
|
111
|
+
<a name="pick-a-task"></a><a name="example-experiments"></a>
|
|
112
|
+
|
|
113
|
+
## Run a recipe
|
|
114
|
+
|
|
115
|
+
| Task | Runnable examples | Hardware to start with |
|
|
116
|
+
| :--- | :--- | :--- |
|
|
117
|
+
| Image classification | [MNIST](#try-mnist-on-cpu) · [ResNet-50 (shapes)](docs/getting-started.md#try-resnet-50-without-imagenet) · [ResNet-50 (ImageNet)](tinyexp/examples/resnet_exp.py) · [DeiT-S](docs/vit_tp.md#usage) | CPU for MNIST and shapes; GPUs for the full ImageNet recipes |
|
|
118
|
+
| Language model fine-tuning & alignment | MiniMind-3 Dense (64M): [SFT](docs/getting-started.md#fine-tune-minimind-on-one-gpu) · [LoRA](tinyexp/examples/minimind/minimind_lora_exp.py) · [DPO](tinyexp/examples/minimind/minimind_dpo_exp.py) · [GRPO](tinyexp/examples/minimind/minimind_grpo_exp.py) · [PPO](tinyexp/examples/minimind/minimind_ppo_exp.py) | One BF16-capable CUDA GPU |
|
|
119
|
+
| Video generation | [Wan 2.1 T2V 1.3B (LoRA)](tinyexp/examples/wan21_lora_exp.py) | One BF16-capable CUDA GPU |
|
|
120
|
+
|
|
121
|
+
**Read a minimal trainer:** [MNIST](tinyexp/examples/mnist_exp.py) shows training, evaluation, and checkpoint resume in one file; [MiniMind SFT](tinyexp/examples/minimind/minimind_sft_exp.py) shows the loop for supervised fine-tuning on chat data.
|
|
122
|
+
|
|
123
|
+
[All recipes and hardware requirements](tinyexp/examples/README.md) · [Distributed Monte Carlo π on CPU](tinyexp/examples/pi_exp.py)
|
|
124
|
+
|
|
125
|
+
## Which recipe should I try?
|
|
126
|
+
|
|
127
|
+
<a name="image-classification"></a>**Image classification.** Use the ten bundled shapes to check a full training run without a dataset download. Choose MNIST to measure accuracy on held-out digits, or DeiT-S to compare tensor and data parallelism on ImageNet.
|
|
128
|
+
|
|
129
|
+
<a name="language-model-fine-tuning-and-alignment"></a>**Language models.** Start with SFT to fine-tune on four example chats and save a checkpoint. Choose LoRA to train and merge a small adapter, DPO if you have preferred and rejected replies, or GRPO/PPO to train with a reward model.
|
|
130
|
+
|
|
131
|
+
<a name="video-generation"></a>**Video generation.** Fine-tune Wan 2.1 with LoRA on four synthetic clips, or supply your own clips and captions in a `video,prompt` CSV. Sample the base model and the adapter with the same prompt and seed to compare their MP4 outputs.
|
|
132
|
+
|
|
133
|
+
**Planned recipes:** image generation and image editing, with small runs for consumer GPUs.
|
|
134
|
+
|
|
135
|
+
<a name="quick-start-1-minute"></a><a name="option-a-install-with-pip-and-run-the-bundled-example"></a>
|
|
136
|
+
|
|
137
|
+
## Try MNIST on CPU
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
pip install "tinyexp[pytorch]"
|
|
141
|
+
python -m tinyexp.examples.mnist_exp
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
MNIST downloads on the first run. After three epochs, `./output/mnist_exp/log.txt` shows the test accuracy and
|
|
145
|
+
`best.ckpt` in the same directory holds the best model. See the guide to
|
|
146
|
+
<a name="option-b-run-the-bundled-example-from-source-for-development"></a>[install from source](docs/getting-started.md#from-source),
|
|
147
|
+
<a name="common-commands"></a><a name="run-and-inspect-an-experiment"></a>[inspect or override settings and evaluate a checkpoint](docs/getting-started.md#run-and-inspect-an-experiment).
|
|
148
|
+
|
|
149
|
+
## Documentation
|
|
150
|
+
|
|
151
|
+
- <a name="why-tinyexp"></a>**Why TinyExp:** [project overview](docs/index.md),
|
|
152
|
+
<a name="design-philosophy"></a>[design philosophy](docs/philosophy.md), and
|
|
153
|
+
<a name="how-it-works"></a>[how an experiment works](docs/getting-started.md#how-it-works).
|
|
154
|
+
- <a name="choose-how-workers-are-created"></a>**Run experiments:** [launcher choices and environment requirements](docs/running-modes.md#mode-matrix), [Redis and experiment tracking](docs/running-modes.md#optional-services), and [Redis ownership in multi-node jobs](docs/running-modes.md#redis-helper-lifecycle-in-multi-node-jobs).
|
|
155
|
+
- **Write your own:** [example catalog and run instructions](tinyexp/examples/README.md), [API reference](docs/modules.md), and
|
|
156
|
+
<a name="codex-skill"></a>[TinyExp agent skill](SKILL.md) ([setup](docs/index.md#use-the-tinyexp-agent-skill)).
|
|
157
|
+
- <a name="development"></a>**Develop TinyExp:** [environment setup, checks, and tests](CONTRIBUTING.md#get-started) and [building the docs, package, and releases](CONTRIBUTING.md#build-and-release).
|
|
158
|
+
|
|
159
|
+
[Documentation site](https://zengarden.github.io/TinyExp/) ·
|
|
160
|
+
<a name="contributing"></a>[Contributing: issues and PRs welcome](CONTRIBUTING.md) · <a name="license"></a>[MIT License](LICENSE)
|
|
161
|
+
|
|
162
|
+
[](https://github.com/zengarden/tinyexp/actions/workflows/main.yml)
|
|
163
|
+
[](https://codecov.io/gh/zengarden/tinyexp)
|
tinyexp-0.2.1/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<a name="tinyexp"></a>
|
|
2
|
+
|
|
3
|
+
# TinyExp — Self-contained examples you can learn from and run with one command.
|
|
4
|
+
|
|
5
|
+
Each `*_exp.py` file keeps the run commands, configuration, and training loop together, as in the [MNIST example](tinyexp/examples/mnist_exp.py).
|
|
6
|
+
Start on a CPU or a single GPU, then scale your research experiments to [multi-node training](docs/running-modes.md#static-ray-cluster).
|
|
7
|
+
For example, [DeiT-S](docs/vit_tp.md#cross-check-record) reached 79.84% top-1 accuracy on ImageNet after training from scratch for 17h 56m on a single node with eight H200 GPUs.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
<details>
|
|
12
|
+
|
|
13
|
+
<summary>Preview a bundled Wan training clip</summary>
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
</details>
|
|
18
|
+
|
|
19
|
+
<a name="pick-a-task"></a><a name="example-experiments"></a>
|
|
20
|
+
|
|
21
|
+
## Run a recipe
|
|
22
|
+
|
|
23
|
+
| Task | Runnable examples | Hardware to start with |
|
|
24
|
+
| :--- | :--- | :--- |
|
|
25
|
+
| Image classification | [MNIST](#try-mnist-on-cpu) · [ResNet-50 (shapes)](docs/getting-started.md#try-resnet-50-without-imagenet) · [ResNet-50 (ImageNet)](tinyexp/examples/resnet_exp.py) · [DeiT-S](docs/vit_tp.md#usage) | CPU for MNIST and shapes; GPUs for the full ImageNet recipes |
|
|
26
|
+
| Language model fine-tuning & alignment | MiniMind-3 Dense (64M): [SFT](docs/getting-started.md#fine-tune-minimind-on-one-gpu) · [LoRA](tinyexp/examples/minimind/minimind_lora_exp.py) · [DPO](tinyexp/examples/minimind/minimind_dpo_exp.py) · [GRPO](tinyexp/examples/minimind/minimind_grpo_exp.py) · [PPO](tinyexp/examples/minimind/minimind_ppo_exp.py) | One BF16-capable CUDA GPU |
|
|
27
|
+
| Video generation | [Wan 2.1 T2V 1.3B (LoRA)](tinyexp/examples/wan21_lora_exp.py) | One BF16-capable CUDA GPU |
|
|
28
|
+
|
|
29
|
+
**Read a minimal trainer:** [MNIST](tinyexp/examples/mnist_exp.py) shows training, evaluation, and checkpoint resume in one file; [MiniMind SFT](tinyexp/examples/minimind/minimind_sft_exp.py) shows the loop for supervised fine-tuning on chat data.
|
|
30
|
+
|
|
31
|
+
[All recipes and hardware requirements](tinyexp/examples/README.md) · [Distributed Monte Carlo π on CPU](tinyexp/examples/pi_exp.py)
|
|
32
|
+
|
|
33
|
+
## Which recipe should I try?
|
|
34
|
+
|
|
35
|
+
<a name="image-classification"></a>**Image classification.** Use the ten bundled shapes to check a full training run without a dataset download. Choose MNIST to measure accuracy on held-out digits, or DeiT-S to compare tensor and data parallelism on ImageNet.
|
|
36
|
+
|
|
37
|
+
<a name="language-model-fine-tuning-and-alignment"></a>**Language models.** Start with SFT to fine-tune on four example chats and save a checkpoint. Choose LoRA to train and merge a small adapter, DPO if you have preferred and rejected replies, or GRPO/PPO to train with a reward model.
|
|
38
|
+
|
|
39
|
+
<a name="video-generation"></a>**Video generation.** Fine-tune Wan 2.1 with LoRA on four synthetic clips, or supply your own clips and captions in a `video,prompt` CSV. Sample the base model and the adapter with the same prompt and seed to compare their MP4 outputs.
|
|
40
|
+
|
|
41
|
+
**Planned recipes:** image generation and image editing, with small runs for consumer GPUs.
|
|
42
|
+
|
|
43
|
+
<a name="quick-start-1-minute"></a><a name="option-a-install-with-pip-and-run-the-bundled-example"></a>
|
|
44
|
+
|
|
45
|
+
## Try MNIST on CPU
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install "tinyexp[pytorch]"
|
|
49
|
+
python -m tinyexp.examples.mnist_exp
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
MNIST downloads on the first run. After three epochs, `./output/mnist_exp/log.txt` shows the test accuracy and
|
|
53
|
+
`best.ckpt` in the same directory holds the best model. See the guide to
|
|
54
|
+
<a name="option-b-run-the-bundled-example-from-source-for-development"></a>[install from source](docs/getting-started.md#from-source),
|
|
55
|
+
<a name="common-commands"></a><a name="run-and-inspect-an-experiment"></a>[inspect or override settings and evaluate a checkpoint](docs/getting-started.md#run-and-inspect-an-experiment).
|
|
56
|
+
|
|
57
|
+
## Documentation
|
|
58
|
+
|
|
59
|
+
- <a name="why-tinyexp"></a>**Why TinyExp:** [project overview](docs/index.md),
|
|
60
|
+
<a name="design-philosophy"></a>[design philosophy](docs/philosophy.md), and
|
|
61
|
+
<a name="how-it-works"></a>[how an experiment works](docs/getting-started.md#how-it-works).
|
|
62
|
+
- <a name="choose-how-workers-are-created"></a>**Run experiments:** [launcher choices and environment requirements](docs/running-modes.md#mode-matrix), [Redis and experiment tracking](docs/running-modes.md#optional-services), and [Redis ownership in multi-node jobs](docs/running-modes.md#redis-helper-lifecycle-in-multi-node-jobs).
|
|
63
|
+
- **Write your own:** [example catalog and run instructions](tinyexp/examples/README.md), [API reference](docs/modules.md), and
|
|
64
|
+
<a name="codex-skill"></a>[TinyExp agent skill](SKILL.md) ([setup](docs/index.md#use-the-tinyexp-agent-skill)).
|
|
65
|
+
- <a name="development"></a>**Develop TinyExp:** [environment setup, checks, and tests](CONTRIBUTING.md#get-started) and [building the docs, package, and releases](CONTRIBUTING.md#build-and-release).
|
|
66
|
+
|
|
67
|
+
[Documentation site](https://zengarden.github.io/TinyExp/) ·
|
|
68
|
+
<a name="contributing"></a>[Contributing: issues and PRs welcome](CONTRIBUTING.md) · <a name="license"></a>[MIT License](LICENSE)
|
|
69
|
+
|
|
70
|
+
[](https://github.com/zengarden/tinyexp/actions/workflows/main.yml)
|
|
71
|
+
[](https://codecov.io/gh/zengarden/tinyexp)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "TinyExp"
|
|
3
|
-
version = "
|
|
3
|
+
version = "v0.2.1"
|
|
4
4
|
description = "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."
|
|
5
5
|
authors = [{ name = "Zeming LI", email = "zane.li@connect.ust.hk" }]
|
|
6
6
|
readme = "README.md"
|
|
@@ -17,22 +17,67 @@ classifiers = [
|
|
|
17
17
|
"Programming Language :: Python :: 3.11",
|
|
18
18
|
"Programming Language :: Python :: 3.12",
|
|
19
19
|
"Programming Language :: Python :: 3.13",
|
|
20
|
+
"Programming Language :: Python :: 3.14",
|
|
20
21
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
21
22
|
]
|
|
22
23
|
dependencies = [
|
|
23
24
|
"loguru>=0.7.3",
|
|
24
|
-
|
|
25
|
+
# NumPy releases before 2.3.2 do not publish CPython 3.14 wheels.
|
|
26
|
+
"numpy; python_version < '3.14'",
|
|
27
|
+
"numpy>=2.3.2; python_version >= '3.14'",
|
|
28
|
+
"psutil",
|
|
25
29
|
"tabulate",
|
|
26
30
|
"hydra-core",
|
|
27
31
|
"omegaconf",
|
|
28
|
-
|
|
32
|
+
# Ray 2.53+ does not publish a CPython 3.9 wheel. Keep the older
|
|
33
|
+
# interpreter resolution installable while using the current line for
|
|
34
|
+
# Python versions that have compatible wheels, including 3.14.
|
|
35
|
+
"ray<2.52; python_version < '3.10'",
|
|
36
|
+
"ray; python_version >= '3.10'",
|
|
37
|
+
# Ray pulls rpds-py through jsonschema; use a release with CPython 3.14 wheels.
|
|
38
|
+
"rpds-py>=0.26; python_version >= '3.14'",
|
|
29
39
|
"tqdm",
|
|
30
|
-
"torch",
|
|
31
|
-
"torchvision",
|
|
32
40
|
"redis",
|
|
33
41
|
"wandb",
|
|
42
|
+
# Trackio requires Python 3.10+.
|
|
43
|
+
"trackio; python_version >= '3.10'",
|
|
34
44
|
"loguru",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[project.optional-dependencies]
|
|
48
|
+
# pysocks: SOCKS proxy support for swanlab's requests, e.g. socks5h:// through an ssh tunnel on machines
|
|
49
|
+
# without direct internet.
|
|
50
|
+
swanlab = ["swanlab>=0.10.6", "pysocks"]
|
|
51
|
+
pytorch = [
|
|
35
52
|
"accelerate",
|
|
53
|
+
# Python 3.14 requires releases that publish cp314 wheels. The CPU/CUDA/
|
|
54
|
+
# ROCm/vendor runtime is selected separately for each target machine.
|
|
55
|
+
"torch; python_version < '3.14'",
|
|
56
|
+
"torch>=2.13; python_version >= '3.14'",
|
|
57
|
+
"torchvision; python_version < '3.14'",
|
|
58
|
+
"torchvision>=0.28; python_version >= '3.14'",
|
|
59
|
+
# TorchVision pulls Pillow; use a release with CPython 3.14 wheels.
|
|
60
|
+
"pillow>=11.3; python_version >= '3.14'",
|
|
61
|
+
]
|
|
62
|
+
vit = [
|
|
63
|
+
# vit_tp_exp example: data pipeline (Mixup/RandAugment), losses, scheduler, and
|
|
64
|
+
# DropPath/trunc_normal_ used by the ported DeiT model. The model itself is
|
|
65
|
+
# ported verbatim from timm 0.3.2 into tinyexp/examples/vit_tp_exp.py.
|
|
66
|
+
# timm does not pull torch, and the example imports torch/torchvision directly,
|
|
67
|
+
# so pull the pytorch extra via a self-referential extra instead of duplicating
|
|
68
|
+
# its per-interpreter version pins.
|
|
69
|
+
"TinyExp[pytorch]",
|
|
70
|
+
"timm>=1.0",
|
|
71
|
+
]
|
|
72
|
+
video = [
|
|
73
|
+
"TinyExp[pytorch]",
|
|
74
|
+
"torch>=2.1",
|
|
75
|
+
"diffusers>=0.34",
|
|
76
|
+
"peft>=0.15",
|
|
77
|
+
"transformers>=4.44.2",
|
|
78
|
+
"imageio[ffmpeg]",
|
|
79
|
+
"ftfy",
|
|
80
|
+
"sentencepiece",
|
|
36
81
|
]
|
|
37
82
|
|
|
38
83
|
[project.urls]
|
|
@@ -79,15 +124,16 @@ include = [
|
|
|
79
124
|
|
|
80
125
|
|
|
81
126
|
|
|
82
|
-
[tool.mypy]
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
127
|
+
# [tool.mypy]
|
|
128
|
+
# Temporarily disabled. Uncomment this section when mypy is enabled again.
|
|
129
|
+
# files = ["tinyexp"]
|
|
130
|
+
# disallow_untyped_defs = true
|
|
131
|
+
# disallow_any_unimported = true
|
|
132
|
+
# no_implicit_optional = true
|
|
133
|
+
# check_untyped_defs = true
|
|
134
|
+
# warn_return_any = true
|
|
135
|
+
# warn_unused_ignores = true
|
|
136
|
+
# show_error_codes = true
|
|
91
137
|
|
|
92
138
|
[tool.pytest.ini_options]
|
|
93
139
|
testpaths = ["tests"]
|
|
@@ -140,6 +186,7 @@ ignore = [
|
|
|
140
186
|
[tool.ruff.lint.per-file-ignores]
|
|
141
187
|
"tests/*" = ["S101"]
|
|
142
188
|
"tinyexp/utils/redis_utils.py" = ["S603"]
|
|
189
|
+
"tinyexp/examples/vit_tp_exp.py" = ["S101", "TRY003"]
|
|
143
190
|
|
|
144
191
|
[tool.ruff.format]
|
|
145
192
|
preview = true
|