sigmoid-hunch 0.1.0__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.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,168 @@
1
+ Metadata-Version: 2.4
2
+ Name: sigmoid-hunch
3
+ Version: 0.1.0
4
+ Summary: A zero-config experiment journal for ML research: every run keeps its code, config, environment and the reason you ran it, as plain files.
5
+ Keywords: machine-learning,experiment-tracking,reproducibility,research,mlops
6
+ Author: Usmon N
7
+ Author-email: Usmon N <rainxch.dev@gmail.com>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
+ Requires-Python: >=3.11
17
+ Project-URL: Repository, https://github.com/sigmoid-ide/hunch
18
+ Project-URL: Issues, https://github.com/sigmoid-ide/hunch/issues
19
+ Project-URL: Format, https://github.com/sigmoid-ide/hunch/blob/main/docs/format.md
20
+ Description-Content-Type: text/markdown
21
+
22
+ # Hunch
23
+
24
+ A zero-config experiment journal for ML research. Every run keeps its code,
25
+ config, environment, metrics and the reason you ran it, as plain files in your
26
+ project. Each run also knows which run it came from, so your experiments form a
27
+ history you can read back, like `git log` for results.
28
+
29
+ ```
30
+ $ hunch log
31
+ * a7f3 Nov 14 warmup + cosine decay val_loss 2.303 █▅▃▂▁▁▁▁ keep "cosine helps a bit"
32
+ | x c21e Nov 13 warmup 2k, lr 6e-4 crashed, exit 1; val_loss 7.42 ▃▂▂▁▁▄▆█ drop
33
+ |/
34
+ * 9b40 Nov 12 warmup 1k steps val_loss 2.323 █▅▃▂▁▁▁▁ keep
35
+ * 3d1c Nov 10 baseline val_loss 2.462 █▅▃▂▁▁▁▁ (no conclusion yet)
36
+ ```
37
+
38
+ No server, no account, no network calls, no telemetry, no dependencies.
39
+ Hunch is the first standalone piece of Sigmoid IDE, an open-source ML research IDE.
40
+
41
+ ## Install
42
+
43
+ ```
44
+ pip install sigmoid-hunch
45
+ ```
46
+
47
+ Python 3.11 or newer. The command is `hunch` and the import is `import hunch`.
48
+
49
+ ## Record a run
50
+
51
+ Put `hunch run` in front of the command you already use:
52
+
53
+ ```
54
+ hunch run -m "warmup to fix loss spikes" -- python train.py --lr 3e-4
55
+ ```
56
+
57
+ Leave out `-m` in an interactive terminal and Hunch asks why (Enter skips). It
58
+ never asks when input is not a terminal, as in cluster jobs, background jobs and
59
+ piped scripts. Pass `-m` in shell scripts that launch many runs.
60
+
61
+ Or record from inside your code. One line records every run, however it is
62
+ launched:
63
+
64
+ ```python
65
+ import hunch
66
+
67
+ run = hunch.init(config={"lr": 3e-4}, why="warmup to fix loss spikes")
68
+ for step in range(steps):
69
+ ...
70
+ hunch.log({"train_loss": loss, "val_loss": val_loss}, step=step)
71
+ ```
72
+
73
+ Use both: inside `hunch run`, `hunch.init()` joins the wrapper's run instead of
74
+ starting a second one. The names follow W&B, so `import hunch as wandb` works
75
+ for `init`, `log`, `config`, `summary` and `finish`. `config` can be a dict or
76
+ an `argparse.Namespace`. Tensors are turned into numbers. In distributed
77
+ training only rank 0 records: Hunch reads `RANK`, `OMPI_COMM_WORLD_RANK` and
78
+ `PMI_RANK`, and inside `hunch run` also `SLURM_PROCID`.
79
+
80
+ ## Read it back
81
+
82
+ ```
83
+ hunch ls recent runs, newest first
84
+ hunch log the tree of runs
85
+ hunch show a7f3 everything about one run
86
+ hunch diff 9b40 a7f3 what changed: code, config, environment and metrics
87
+ hunch diff 9b40 a7f3 --code the full code diff
88
+ ```
89
+
90
+ ```
91
+ $ hunch diff 9b40 a7f3
92
+ 9b40 Nov 12 14:12 warmup 1k steps
93
+ a7f3 Nov 14 09:30 warmup + cosine decay
94
+
95
+ code train.py +6 -1 (--code for the full diff)
96
+ config schedule: const -> cosine
97
+ env no changes
98
+ metrics val_loss 2.323 -> 2.303 (-0.02)
99
+ ```
100
+
101
+ Runs are named by the end of their id, usually 4 characters. Runs that ended in
102
+ under 30 seconds (typos, quick crashes) are hidden; `--all` shows them.
103
+
104
+ ## Close the loop
105
+
106
+ ```
107
+ hunch note a7f3 "cosine helps a bit" --keep a conclusion and a verdict
108
+ hunch note c21e --drop a dead end
109
+ hunch note a7f3 --why "warmup + cosine decay" a better why
110
+ hunch link a7f3 --from 9b40 fix the run it came from
111
+ hunch set main-metric val/acc the metric shown for each run
112
+ ```
113
+
114
+ Notes are added, never overwritten, so a run's history stays visible in
115
+ `hunch show`.
116
+
117
+ ## What a run records
118
+
119
+ - The command, arguments and working directory
120
+ - The git commit and branch, the uncommitted changes to tracked files, and
121
+ copies of small untracked text files, so the exact code can be rebuilt
122
+ - The config passed to `hunch.init()`
123
+ - Python version and path, installed packages, torch and CUDA versions, GPU
124
+ model and driver, host, and the SLURM job id
125
+ - Metrics, final values, output (with `hunch run`), exit status and duration
126
+ - The why, your conclusion and your verdict
127
+
128
+ ## Lineage
129
+
130
+ Each run's parent is picked for you: the run on the same git branch that ended
131
+ most recently, skipping runs still in progress, runs under 30 seconds and runs
132
+ you dropped. Branch per idea and you get a tree; stay on one branch and you get
133
+ a straight history. Use `hunch run --from <run>` to choose the parent yourself,
134
+ and `hunch link` to fix it later.
135
+
136
+ ## Where it lives
137
+
138
+ Everything is in `.hunch/` at the root of your git repository (outside git, in
139
+ the current folder), one folder per run. The
140
+ folder ignores itself in git, so your repository is never touched. Runs never
141
+ change after they end and have unique ids, so copying them between machines is
142
+ a plain `rsync` of folders. The format is documented in
143
+ [docs/format.md](docs/format.md), for anyone who wants to read it without Hunch.
144
+
145
+ ## Privacy
146
+
147
+ Nothing leaves your machine. Only these environment variables are recorded:
148
+ `CUDA_VISIBLE_DEVICES`, `CONDA_DEFAULT_ENV`, `VIRTUAL_ENV` and `SLURM_*`.
149
+ Credentials are removed from git remote URLs. Command arguments are recorded as
150
+ typed, so do not pass secrets as arguments.
151
+
152
+ ## Known limits in this first version
153
+
154
+ - `hunch run` pipes the command's output to save it, so programs that check for
155
+ a terminal may turn off colors. It sets `PYTHONUNBUFFERED=1` to keep output
156
+ live.
157
+ - `hunch run` passes SIGTERM on to the command. It survives SIGHUP, SIGUSR1
158
+ and SIGUSR2 without passing them on, because SLURM and terminals send those
159
+ to the whole process group, so the command already gets them.
160
+ - Without `hunch run`, a script that ends with `sys.exit(n)` is recorded as
161
+ finished, and one killed outright shows as lost after 5 minutes. Use
162
+ `hunch run` for exact exit codes.
163
+ - No plots beyond sparklines, no sweeps, no checkpoint storage, no importers
164
+ from other trackers yet.
165
+
166
+ ## License
167
+
168
+ Apache-2.0. See [CONTRIBUTING.md](CONTRIBUTING.md) to contribute.
@@ -0,0 +1,147 @@
1
+ # Hunch
2
+
3
+ A zero-config experiment journal for ML research. Every run keeps its code,
4
+ config, environment, metrics and the reason you ran it, as plain files in your
5
+ project. Each run also knows which run it came from, so your experiments form a
6
+ history you can read back, like `git log` for results.
7
+
8
+ ```
9
+ $ hunch log
10
+ * a7f3 Nov 14 warmup + cosine decay val_loss 2.303 █▅▃▂▁▁▁▁ keep "cosine helps a bit"
11
+ | x c21e Nov 13 warmup 2k, lr 6e-4 crashed, exit 1; val_loss 7.42 ▃▂▂▁▁▄▆█ drop
12
+ |/
13
+ * 9b40 Nov 12 warmup 1k steps val_loss 2.323 █▅▃▂▁▁▁▁ keep
14
+ * 3d1c Nov 10 baseline val_loss 2.462 █▅▃▂▁▁▁▁ (no conclusion yet)
15
+ ```
16
+
17
+ No server, no account, no network calls, no telemetry, no dependencies.
18
+ Hunch is the first standalone piece of Sigmoid IDE, an open-source ML research IDE.
19
+
20
+ ## Install
21
+
22
+ ```
23
+ pip install sigmoid-hunch
24
+ ```
25
+
26
+ Python 3.11 or newer. The command is `hunch` and the import is `import hunch`.
27
+
28
+ ## Record a run
29
+
30
+ Put `hunch run` in front of the command you already use:
31
+
32
+ ```
33
+ hunch run -m "warmup to fix loss spikes" -- python train.py --lr 3e-4
34
+ ```
35
+
36
+ Leave out `-m` in an interactive terminal and Hunch asks why (Enter skips). It
37
+ never asks when input is not a terminal, as in cluster jobs, background jobs and
38
+ piped scripts. Pass `-m` in shell scripts that launch many runs.
39
+
40
+ Or record from inside your code. One line records every run, however it is
41
+ launched:
42
+
43
+ ```python
44
+ import hunch
45
+
46
+ run = hunch.init(config={"lr": 3e-4}, why="warmup to fix loss spikes")
47
+ for step in range(steps):
48
+ ...
49
+ hunch.log({"train_loss": loss, "val_loss": val_loss}, step=step)
50
+ ```
51
+
52
+ Use both: inside `hunch run`, `hunch.init()` joins the wrapper's run instead of
53
+ starting a second one. The names follow W&B, so `import hunch as wandb` works
54
+ for `init`, `log`, `config`, `summary` and `finish`. `config` can be a dict or
55
+ an `argparse.Namespace`. Tensors are turned into numbers. In distributed
56
+ training only rank 0 records: Hunch reads `RANK`, `OMPI_COMM_WORLD_RANK` and
57
+ `PMI_RANK`, and inside `hunch run` also `SLURM_PROCID`.
58
+
59
+ ## Read it back
60
+
61
+ ```
62
+ hunch ls recent runs, newest first
63
+ hunch log the tree of runs
64
+ hunch show a7f3 everything about one run
65
+ hunch diff 9b40 a7f3 what changed: code, config, environment and metrics
66
+ hunch diff 9b40 a7f3 --code the full code diff
67
+ ```
68
+
69
+ ```
70
+ $ hunch diff 9b40 a7f3
71
+ 9b40 Nov 12 14:12 warmup 1k steps
72
+ a7f3 Nov 14 09:30 warmup + cosine decay
73
+
74
+ code train.py +6 -1 (--code for the full diff)
75
+ config schedule: const -> cosine
76
+ env no changes
77
+ metrics val_loss 2.323 -> 2.303 (-0.02)
78
+ ```
79
+
80
+ Runs are named by the end of their id, usually 4 characters. Runs that ended in
81
+ under 30 seconds (typos, quick crashes) are hidden; `--all` shows them.
82
+
83
+ ## Close the loop
84
+
85
+ ```
86
+ hunch note a7f3 "cosine helps a bit" --keep a conclusion and a verdict
87
+ hunch note c21e --drop a dead end
88
+ hunch note a7f3 --why "warmup + cosine decay" a better why
89
+ hunch link a7f3 --from 9b40 fix the run it came from
90
+ hunch set main-metric val/acc the metric shown for each run
91
+ ```
92
+
93
+ Notes are added, never overwritten, so a run's history stays visible in
94
+ `hunch show`.
95
+
96
+ ## What a run records
97
+
98
+ - The command, arguments and working directory
99
+ - The git commit and branch, the uncommitted changes to tracked files, and
100
+ copies of small untracked text files, so the exact code can be rebuilt
101
+ - The config passed to `hunch.init()`
102
+ - Python version and path, installed packages, torch and CUDA versions, GPU
103
+ model and driver, host, and the SLURM job id
104
+ - Metrics, final values, output (with `hunch run`), exit status and duration
105
+ - The why, your conclusion and your verdict
106
+
107
+ ## Lineage
108
+
109
+ Each run's parent is picked for you: the run on the same git branch that ended
110
+ most recently, skipping runs still in progress, runs under 30 seconds and runs
111
+ you dropped. Branch per idea and you get a tree; stay on one branch and you get
112
+ a straight history. Use `hunch run --from <run>` to choose the parent yourself,
113
+ and `hunch link` to fix it later.
114
+
115
+ ## Where it lives
116
+
117
+ Everything is in `.hunch/` at the root of your git repository (outside git, in
118
+ the current folder), one folder per run. The
119
+ folder ignores itself in git, so your repository is never touched. Runs never
120
+ change after they end and have unique ids, so copying them between machines is
121
+ a plain `rsync` of folders. The format is documented in
122
+ [docs/format.md](docs/format.md), for anyone who wants to read it without Hunch.
123
+
124
+ ## Privacy
125
+
126
+ Nothing leaves your machine. Only these environment variables are recorded:
127
+ `CUDA_VISIBLE_DEVICES`, `CONDA_DEFAULT_ENV`, `VIRTUAL_ENV` and `SLURM_*`.
128
+ Credentials are removed from git remote URLs. Command arguments are recorded as
129
+ typed, so do not pass secrets as arguments.
130
+
131
+ ## Known limits in this first version
132
+
133
+ - `hunch run` pipes the command's output to save it, so programs that check for
134
+ a terminal may turn off colors. It sets `PYTHONUNBUFFERED=1` to keep output
135
+ live.
136
+ - `hunch run` passes SIGTERM on to the command. It survives SIGHUP, SIGUSR1
137
+ and SIGUSR2 without passing them on, because SLURM and terminals send those
138
+ to the whole process group, so the command already gets them.
139
+ - Without `hunch run`, a script that ends with `sys.exit(n)` is recorded as
140
+ finished, and one killed outright shows as lost after 5 minutes. Use
141
+ `hunch run` for exact exit codes.
142
+ - No plots beyond sparklines, no sweeps, no checkpoint storage, no importers
143
+ from other trackers yet.
144
+
145
+ ## License
146
+
147
+ Apache-2.0. See [CONTRIBUTING.md](CONTRIBUTING.md) to contribute.
@@ -0,0 +1,46 @@
1
+ [project]
2
+ name = "sigmoid-hunch"
3
+ version = "0.1.0"
4
+ description = "A zero-config experiment journal for ML research: every run keeps its code, config, environment and the reason you ran it, as plain files."
5
+ readme = "README.md"
6
+ license = "Apache-2.0"
7
+ license-files = ["LICENSE"]
8
+ requires-python = ">=3.11"
9
+ dependencies = []
10
+ keywords = [
11
+ "machine-learning",
12
+ "experiment-tracking",
13
+ "reproducibility",
14
+ "research",
15
+ "mlops",
16
+ ]
17
+ classifiers = [
18
+ "Development Status :: 3 - Alpha",
19
+ "Intended Audience :: Science/Research",
20
+ "Intended Audience :: Developers",
21
+ "Operating System :: OS Independent",
22
+ "Programming Language :: Python :: 3",
23
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
24
+ ]
25
+
26
+ [[project.authors]]
27
+ name = "Usmon N"
28
+ email = "rainxch.dev@gmail.com"
29
+
30
+ [project.scripts]
31
+ hunch = "hunch.cli:main"
32
+
33
+ [project.urls]
34
+ Repository = "https://github.com/sigmoid-ide/hunch"
35
+ Issues = "https://github.com/sigmoid-ide/hunch/issues"
36
+ Format = "https://github.com/sigmoid-ide/hunch/blob/main/docs/format.md"
37
+
38
+ [build-system]
39
+ requires = ["uv_build>=0.11.16,<0.12.0"]
40
+ build-backend = "uv_build"
41
+
42
+ [tool.uv.build-backend]
43
+ module-name = "hunch"
44
+
45
+ [dependency-groups]
46
+ dev = ["pytest>=9.2.0"]
@@ -0,0 +1,41 @@
1
+ [project]
2
+ name = "sigmoid-hunch"
3
+ version = "0.1.0"
4
+ description = "A zero-config experiment journal for ML research: every run keeps its code, config, environment and the reason you ran it, as plain files."
5
+ readme = "README.md"
6
+ license = "Apache-2.0"
7
+ license-files = ["LICENSE"]
8
+ authors = [
9
+ { name = "Usmon N", email = "rainxch.dev@gmail.com" }
10
+ ]
11
+ requires-python = ">=3.11"
12
+ dependencies = []
13
+ keywords = ["machine-learning", "experiment-tracking", "reproducibility", "research", "mlops"]
14
+ classifiers = [
15
+ "Development Status :: 3 - Alpha",
16
+ "Intended Audience :: Science/Research",
17
+ "Intended Audience :: Developers",
18
+ "Operating System :: OS Independent",
19
+ "Programming Language :: Python :: 3",
20
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
21
+ ]
22
+
23
+ [project.scripts]
24
+ hunch = "hunch.cli:main"
25
+
26
+ [project.urls]
27
+ Repository = "https://github.com/sigmoid-ide/hunch"
28
+ Issues = "https://github.com/sigmoid-ide/hunch/issues"
29
+ Format = "https://github.com/sigmoid-ide/hunch/blob/main/docs/format.md"
30
+
31
+ [build-system]
32
+ requires = ["uv_build>=0.11.16,<0.12.0"]
33
+ build-backend = "uv_build"
34
+
35
+ [tool.uv.build-backend]
36
+ module-name = "hunch"
37
+
38
+ [dependency-groups]
39
+ dev = [
40
+ "pytest>=9.2.0",
41
+ ]
@@ -0,0 +1,33 @@
1
+ """Hunch: a zero-config experiment journal for ML research.
2
+
3
+ Every run keeps its code, config, environment, metrics and the reason you ran
4
+ it, as plain files in the project's .hunch folder.
5
+
6
+ import hunch
7
+ run = hunch.init(config={"lr": 3e-4}, why="warmup to fix loss spikes")
8
+ hunch.log({"val_loss": 2.31}, step=1000)
9
+ """
10
+
11
+ from importlib import metadata as _metadata
12
+
13
+ from .api import Run, finish, init, log
14
+
15
+ try:
16
+ __version__ = _metadata.version("sigmoid-hunch")
17
+ except _metadata.PackageNotFoundError:
18
+ __version__ = "0+unknown"
19
+
20
+ __all__ = ["Run", "init", "log", "finish", "config", "summary", "run"]
21
+
22
+
23
+ def __getattr__(name):
24
+ # hunch.config, hunch.summary and hunch.run follow the active run, as in W&B.
25
+ if name in ("config", "summary", "run"):
26
+ from . import api
27
+
28
+ if name == "run":
29
+ return api._active
30
+ if api._active is None:
31
+ raise AttributeError(f"hunch.{name} is available after hunch.init()")
32
+ return getattr(api._active, name)
33
+ raise AttributeError(f"module 'hunch' has no attribute '{name}'")
@@ -0,0 +1,5 @@
1
+ import sys
2
+
3
+ from .cli import main
4
+
5
+ sys.exit(main())