substrax 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.
Files changed (30) hide show
  1. substrax-0.1.0/.gitignore +267 -0
  2. substrax-0.1.0/LICENSE +21 -0
  3. substrax-0.1.0/PKG-INFO +322 -0
  4. substrax-0.1.0/README.md +80 -0
  5. substrax-0.1.0/pyproject.toml +351 -0
  6. substrax-0.1.0/src/substrax/__init__.py +13 -0
  7. substrax-0.1.0/src/substrax/callbacks/__init__.py +18 -0
  8. substrax-0.1.0/src/substrax/callbacks/base.py +158 -0
  9. substrax-0.1.0/src/substrax/callbacks/early_stopping.py +116 -0
  10. substrax-0.1.0/src/substrax/callbacks/plateau.py +121 -0
  11. substrax-0.1.0/src/substrax/checkpoint/__init__.py +6 -0
  12. substrax-0.1.0/src/substrax/checkpoint/checkpoint_store.py +437 -0
  13. substrax-0.1.0/src/substrax/devices/__init__.py +24 -0
  14. substrax-0.1.0/src/substrax/devices/info.py +96 -0
  15. substrax-0.1.0/src/substrax/devices/placement.py +466 -0
  16. substrax-0.1.0/src/substrax/mesh/__init__.py +38 -0
  17. substrax-0.1.0/src/substrax/mesh/device_mesh.py +161 -0
  18. substrax-0.1.0/src/substrax/mesh/rules.py +130 -0
  19. substrax-0.1.0/src/substrax/mesh/strategies.py +513 -0
  20. substrax-0.1.0/src/substrax/py.typed +0 -0
  21. substrax-0.1.0/src/substrax/spmd/__init__.py +38 -0
  22. substrax-0.1.0/src/substrax/spmd/collectives.py +251 -0
  23. substrax-0.1.0/src/substrax/spmd/data_parallel.py +142 -0
  24. substrax-0.1.0/src/substrax/tracking/__init__.py +19 -0
  25. substrax-0.1.0/src/substrax/tracking/_optional.py +27 -0
  26. substrax-0.1.0/src/substrax/tracking/_plots.py +72 -0
  27. substrax-0.1.0/src/substrax/tracking/logger.py +373 -0
  28. substrax-0.1.0/src/substrax/tracking/mlflow.py +215 -0
  29. substrax-0.1.0/src/substrax/tracking/wandb.py +170 -0
  30. substrax-0.1.0/src/substrax/typing.py +12 -0
@@ -0,0 +1,267 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ # generated by setup.sh
139
+ .substrax.env
140
+ .env
141
+ .envrc
142
+ .venv
143
+ env/
144
+ venv/
145
+ ENV/
146
+ env.bak/
147
+ venv.bak/
148
+
149
+ # Spyder project settings
150
+ .spyderproject
151
+ .spyproject
152
+
153
+ # Rope project settings
154
+ .ropeproject
155
+
156
+ # mkdocs documentation
157
+ /site
158
+
159
+ # mypy
160
+ .mypy_cache/
161
+ .dmypy.json
162
+ dmypy.json
163
+
164
+ # Pyre type checker
165
+ .pyre/
166
+
167
+ # pytype static type analyzer
168
+ .pytype/
169
+
170
+ # Cython debug symbols
171
+ cython_debug/
172
+
173
+ # PyCharm
174
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
175
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
176
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
177
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
178
+ #.idea/
179
+
180
+ # Abstra
181
+ # Abstra is an AI-powered process automation framework.
182
+ # Ignore directories containing user credentials, local state, and settings.
183
+ # Learn more at https://abstra.io/docs
184
+ .abstra/
185
+
186
+ # Visual Studio Code
187
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
188
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
189
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
190
+ # you could uncomment the following to ignore the entire vscode folder
191
+ # .vscode/
192
+
193
+ # Ruff stuff:
194
+ .ruff_cache/
195
+
196
+ # PyPI configuration file
197
+ .pypirc
198
+
199
+ # Editor ignore files
200
+ .cursorignore
201
+ .cursorindexingignore
202
+
203
+ # Marimo
204
+ marimo/_static/
205
+ marimo/_lsp/
206
+ __marimo__/
207
+
208
+
209
+ # Temp & Cache
210
+ temp/
211
+ tmp/
212
+ *.tmp
213
+ cache/
214
+
215
+ # JAX / XLA
216
+ .cache/jax/
217
+ .cache/xla/
218
+ .jax_cache/
219
+ jax_cache/
220
+
221
+ # ML Artifacts
222
+ *.npy
223
+ *.npz
224
+ *.hdf5
225
+ *.h5
226
+ checkpoints/
227
+ *.orbax-checkpoint-tmp-*/
228
+
229
+ # Experiment tracking
230
+ wandb/
231
+ .wandb*
232
+ mlruns/
233
+ .mlflow/
234
+ tensorboard_logs/
235
+
236
+ # Benchmark results & data
237
+ benchmark_results/
238
+ benchmark-data/
239
+ .benchmarks/
240
+
241
+ # Logs
242
+ logs/
243
+ *.log
244
+
245
+ # OS
246
+ .DS_Store
247
+ Thumbs.db
248
+
249
+ # IDE (additional)
250
+ .idea/
251
+ .vscode/
252
+
253
+ # Generated by setup.sh
254
+
255
+ # Internal / Private
256
+ internal_docs/
257
+ memory-bank/
258
+ documents/
259
+ sandbox/
260
+ CLAUDE.md
261
+ .claude/
262
+ .cursor/
263
+ .agent/
264
+ .taskmaster/
265
+
266
+ # Private working notes and per-editor assistant configuration. Local only.
267
+ AGENTS.md
substrax-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mahdi Shafiei
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,322 @@
1
+ Metadata-Version: 2.5
2
+ Name: substrax
3
+ Version: 0.1.0
4
+ Summary: Substrax: shared training and hardware infrastructure for the Avitai JAX stack
5
+ Project-URL: Changelog, https://github.com/avitai/substrax/blob/main/CHANGELOG.md
6
+ Project-URL: Documentation, https://substrax.readthedocs.io
7
+ Project-URL: Repository, https://github.com/avitai/substrax
8
+ Author-email: Mahdi Shafiei <mahdi@avitai.bio>
9
+ License: MIT License
10
+
11
+ Copyright (c) 2026 Mahdi Shafiei
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: checkpointing,distributed,flax,infrastructure,jax,sharding
32
+ Classifier: Development Status :: 3 - Alpha
33
+ Classifier: Intended Audience :: Developers
34
+ Classifier: Intended Audience :: Science/Research
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Natural Language :: English
37
+ Classifier: Operating System :: MacOS
38
+ Classifier: Operating System :: MacOS :: MacOS X
39
+ Classifier: Operating System :: POSIX :: Linux
40
+ Classifier: Programming Language :: Python :: 3 :: Only
41
+ Classifier: Programming Language :: Python :: 3.12
42
+ Classifier: Programming Language :: Python :: 3.13
43
+ Classifier: Topic :: Scientific/Engineering
44
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
45
+ Requires-Python: >=3.12
46
+ Requires-Dist: flax>=0.12.9
47
+ Requires-Dist: jax>=0.11.1
48
+ Requires-Dist: jaxlib>=0.11.1
49
+ Requires-Dist: numpy<2.5.0,>=1.24
50
+ Requires-Dist: orbax-checkpoint>=0.11.33
51
+ Provides-Extra: all
52
+ Requires-Dist: bandit[toml]>=1.8.6; extra == 'all'
53
+ Requires-Dist: build>=1.0.3; extra == 'all'
54
+ Requires-Dist: coverage>=7; extra == 'all'
55
+ Requires-Dist: deptry>=0.23; extra == 'all'
56
+ Requires-Dist: griffe>=1.7.3; extra == 'all'
57
+ Requires-Dist: hypothesis>=6.100; extra == 'all'
58
+ Requires-Dist: import-linter>=2.0; extra == 'all'
59
+ Requires-Dist: interrogate>=1.5; extra == 'all'
60
+ Requires-Dist: jax[cuda12]>=0.11.1; extra == 'all'
61
+ Requires-Dist: matplotlib>=3.8; extra == 'all'
62
+ Requires-Dist: mkdocs-material>=9.7.7; extra == 'all'
63
+ Requires-Dist: mkdocs<2.0,>=1.6.1; extra == 'all'
64
+ Requires-Dist: mkdocstrings-python>=1.1.2; extra == 'all'
65
+ Requires-Dist: mkdocstrings>=0.28.3; extra == 'all'
66
+ Requires-Dist: mlflow>=2; extra == 'all'
67
+ Requires-Dist: optax>=0.2.8; extra == 'all'
68
+ Requires-Dist: pip-audit>=2.7; extra == 'all'
69
+ Requires-Dist: pre-commit>=4.2; extra == 'all'
70
+ Requires-Dist: pydoclint>=0.5; extra == 'all'
71
+ Requires-Dist: pygments<3.0,>=2.20; extra == 'all'
72
+ Requires-Dist: pylint>=3.3; extra == 'all'
73
+ Requires-Dist: pymdown-extensions>=11.0.1; extra == 'all'
74
+ Requires-Dist: pyright>=1.1.403; extra == 'all'
75
+ Requires-Dist: pytest-cov>=6.1.1; extra == 'all'
76
+ Requires-Dist: pytest-env>=1.0.1; extra == 'all'
77
+ Requires-Dist: pytest-json-report>=1.5.0; extra == 'all'
78
+ Requires-Dist: pytest-randomly>=3.15; extra == 'all'
79
+ Requires-Dist: pytest-timeout>=2.1; extra == 'all'
80
+ Requires-Dist: pytest-xdist>=3.6; extra == 'all'
81
+ Requires-Dist: pytest>=9.0.3; extra == 'all'
82
+ Requires-Dist: pyyaml>=6.0; extra == 'all'
83
+ Requires-Dist: radon>=6.0; extra == 'all'
84
+ Requires-Dist: ruff>=0.15.2; extra == 'all'
85
+ Requires-Dist: toml-sort>=0.23.1; extra == 'all'
86
+ Requires-Dist: twine>=6.1; extra == 'all'
87
+ Requires-Dist: validate-pyproject>=0.23; extra == 'all'
88
+ Requires-Dist: vulture>=2.14; extra == 'all'
89
+ Requires-Dist: wandb>=0.18; extra == 'all'
90
+ Requires-Dist: xenon>=0.9; extra == 'all'
91
+ Provides-Extra: all-cpu
92
+ Requires-Dist: bandit[toml]>=1.8.6; extra == 'all-cpu'
93
+ Requires-Dist: build>=1.0.3; extra == 'all-cpu'
94
+ Requires-Dist: coverage>=7; extra == 'all-cpu'
95
+ Requires-Dist: deptry>=0.23; extra == 'all-cpu'
96
+ Requires-Dist: griffe>=1.7.3; extra == 'all-cpu'
97
+ Requires-Dist: hypothesis>=6.100; extra == 'all-cpu'
98
+ Requires-Dist: import-linter>=2.0; extra == 'all-cpu'
99
+ Requires-Dist: interrogate>=1.5; extra == 'all-cpu'
100
+ Requires-Dist: matplotlib>=3.8; extra == 'all-cpu'
101
+ Requires-Dist: mkdocs-material>=9.7.7; extra == 'all-cpu'
102
+ Requires-Dist: mkdocs<2.0,>=1.6.1; extra == 'all-cpu'
103
+ Requires-Dist: mkdocstrings-python>=1.1.2; extra == 'all-cpu'
104
+ Requires-Dist: mkdocstrings>=0.28.3; extra == 'all-cpu'
105
+ Requires-Dist: mlflow>=2; extra == 'all-cpu'
106
+ Requires-Dist: optax>=0.2.8; extra == 'all-cpu'
107
+ Requires-Dist: pip-audit>=2.7; extra == 'all-cpu'
108
+ Requires-Dist: pre-commit>=4.2; extra == 'all-cpu'
109
+ Requires-Dist: pydoclint>=0.5; extra == 'all-cpu'
110
+ Requires-Dist: pygments<3.0,>=2.20; extra == 'all-cpu'
111
+ Requires-Dist: pylint>=3.3; extra == 'all-cpu'
112
+ Requires-Dist: pymdown-extensions>=11.0.1; extra == 'all-cpu'
113
+ Requires-Dist: pyright>=1.1.403; extra == 'all-cpu'
114
+ Requires-Dist: pytest-cov>=6.1.1; extra == 'all-cpu'
115
+ Requires-Dist: pytest-env>=1.0.1; extra == 'all-cpu'
116
+ Requires-Dist: pytest-json-report>=1.5.0; extra == 'all-cpu'
117
+ Requires-Dist: pytest-randomly>=3.15; extra == 'all-cpu'
118
+ Requires-Dist: pytest-timeout>=2.1; extra == 'all-cpu'
119
+ Requires-Dist: pytest-xdist>=3.6; extra == 'all-cpu'
120
+ Requires-Dist: pytest>=9.0.3; extra == 'all-cpu'
121
+ Requires-Dist: pyyaml>=6.0; extra == 'all-cpu'
122
+ Requires-Dist: radon>=6.0; extra == 'all-cpu'
123
+ Requires-Dist: ruff>=0.15.2; extra == 'all-cpu'
124
+ Requires-Dist: toml-sort>=0.23.1; extra == 'all-cpu'
125
+ Requires-Dist: twine>=6.1; extra == 'all-cpu'
126
+ Requires-Dist: validate-pyproject>=0.23; extra == 'all-cpu'
127
+ Requires-Dist: vulture>=2.14; extra == 'all-cpu'
128
+ Requires-Dist: wandb>=0.18; extra == 'all-cpu'
129
+ Requires-Dist: xenon>=0.9; extra == 'all-cpu'
130
+ Provides-Extra: all-macos
131
+ Requires-Dist: bandit[toml]>=1.8.6; extra == 'all-macos'
132
+ Requires-Dist: build>=1.0.3; extra == 'all-macos'
133
+ Requires-Dist: coverage>=7; extra == 'all-macos'
134
+ Requires-Dist: deptry>=0.23; extra == 'all-macos'
135
+ Requires-Dist: griffe>=1.7.3; extra == 'all-macos'
136
+ Requires-Dist: hypothesis>=6.100; extra == 'all-macos'
137
+ Requires-Dist: import-linter>=2.0; extra == 'all-macos'
138
+ Requires-Dist: interrogate>=1.5; extra == 'all-macos'
139
+ Requires-Dist: jax-metal>=0.1.0; extra == 'all-macos'
140
+ Requires-Dist: matplotlib>=3.8; extra == 'all-macos'
141
+ Requires-Dist: mkdocs-material>=9.7.7; extra == 'all-macos'
142
+ Requires-Dist: mkdocs<2.0,>=1.6.1; extra == 'all-macos'
143
+ Requires-Dist: mkdocstrings-python>=1.1.2; extra == 'all-macos'
144
+ Requires-Dist: mkdocstrings>=0.28.3; extra == 'all-macos'
145
+ Requires-Dist: mlflow>=2; extra == 'all-macos'
146
+ Requires-Dist: optax>=0.2.8; extra == 'all-macos'
147
+ Requires-Dist: pip-audit>=2.7; extra == 'all-macos'
148
+ Requires-Dist: pre-commit>=4.2; extra == 'all-macos'
149
+ Requires-Dist: pydoclint>=0.5; extra == 'all-macos'
150
+ Requires-Dist: pygments<3.0,>=2.20; extra == 'all-macos'
151
+ Requires-Dist: pylint>=3.3; extra == 'all-macos'
152
+ Requires-Dist: pymdown-extensions>=11.0.1; extra == 'all-macos'
153
+ Requires-Dist: pyright>=1.1.403; extra == 'all-macos'
154
+ Requires-Dist: pytest-cov>=6.1.1; extra == 'all-macos'
155
+ Requires-Dist: pytest-env>=1.0.1; extra == 'all-macos'
156
+ Requires-Dist: pytest-json-report>=1.5.0; extra == 'all-macos'
157
+ Requires-Dist: pytest-randomly>=3.15; extra == 'all-macos'
158
+ Requires-Dist: pytest-timeout>=2.1; extra == 'all-macos'
159
+ Requires-Dist: pytest-xdist>=3.6; extra == 'all-macos'
160
+ Requires-Dist: pytest>=9.0.3; extra == 'all-macos'
161
+ Requires-Dist: pyyaml>=6.0; extra == 'all-macos'
162
+ Requires-Dist: radon>=6.0; extra == 'all-macos'
163
+ Requires-Dist: ruff>=0.15.2; extra == 'all-macos'
164
+ Requires-Dist: toml-sort>=0.23.1; extra == 'all-macos'
165
+ Requires-Dist: twine>=6.1; extra == 'all-macos'
166
+ Requires-Dist: validate-pyproject>=0.23; extra == 'all-macos'
167
+ Requires-Dist: vulture>=2.14; extra == 'all-macos'
168
+ Requires-Dist: wandb>=0.18; extra == 'all-macos'
169
+ Requires-Dist: xenon>=0.9; extra == 'all-macos'
170
+ Provides-Extra: cuda-dev
171
+ Requires-Dist: bandit[toml]>=1.8.6; extra == 'cuda-dev'
172
+ Requires-Dist: build>=1.0.3; extra == 'cuda-dev'
173
+ Requires-Dist: coverage>=7; extra == 'cuda-dev'
174
+ Requires-Dist: deptry>=0.23; extra == 'cuda-dev'
175
+ Requires-Dist: import-linter>=2.0; extra == 'cuda-dev'
176
+ Requires-Dist: interrogate>=1.5; extra == 'cuda-dev'
177
+ Requires-Dist: jax[cuda12]>=0.11.1; extra == 'cuda-dev'
178
+ Requires-Dist: pip-audit>=2.7; extra == 'cuda-dev'
179
+ Requires-Dist: pre-commit>=4.2; extra == 'cuda-dev'
180
+ Requires-Dist: pydoclint>=0.5; extra == 'cuda-dev'
181
+ Requires-Dist: pylint>=3.3; extra == 'cuda-dev'
182
+ Requires-Dist: pyright>=1.1.403; extra == 'cuda-dev'
183
+ Requires-Dist: pyyaml>=6.0; extra == 'cuda-dev'
184
+ Requires-Dist: radon>=6.0; extra == 'cuda-dev'
185
+ Requires-Dist: ruff>=0.15.2; extra == 'cuda-dev'
186
+ Requires-Dist: toml-sort>=0.23.1; extra == 'cuda-dev'
187
+ Requires-Dist: twine>=6.1; extra == 'cuda-dev'
188
+ Requires-Dist: validate-pyproject>=0.23; extra == 'cuda-dev'
189
+ Requires-Dist: vulture>=2.14; extra == 'cuda-dev'
190
+ Requires-Dist: xenon>=0.9; extra == 'cuda-dev'
191
+ Provides-Extra: cuda12
192
+ Requires-Dist: jax[cuda12]>=0.11.1; extra == 'cuda12'
193
+ Provides-Extra: dev
194
+ Requires-Dist: bandit[toml]>=1.8.6; extra == 'dev'
195
+ Requires-Dist: build>=1.0.3; extra == 'dev'
196
+ Requires-Dist: coverage>=7; extra == 'dev'
197
+ Requires-Dist: deptry>=0.23; extra == 'dev'
198
+ Requires-Dist: import-linter>=2.0; extra == 'dev'
199
+ Requires-Dist: interrogate>=1.5; extra == 'dev'
200
+ Requires-Dist: pip-audit>=2.7; extra == 'dev'
201
+ Requires-Dist: pre-commit>=4.2; extra == 'dev'
202
+ Requires-Dist: pydoclint>=0.5; extra == 'dev'
203
+ Requires-Dist: pylint>=3.3; extra == 'dev'
204
+ Requires-Dist: pyright>=1.1.403; extra == 'dev'
205
+ Requires-Dist: pyyaml>=6.0; extra == 'dev'
206
+ Requires-Dist: radon>=6.0; extra == 'dev'
207
+ Requires-Dist: ruff>=0.15.2; extra == 'dev'
208
+ Requires-Dist: toml-sort>=0.23.1; extra == 'dev'
209
+ Requires-Dist: twine>=6.1; extra == 'dev'
210
+ Requires-Dist: validate-pyproject>=0.23; extra == 'dev'
211
+ Requires-Dist: vulture>=2.14; extra == 'dev'
212
+ Requires-Dist: xenon>=0.9; extra == 'dev'
213
+ Provides-Extra: docs
214
+ Requires-Dist: griffe>=1.7.3; extra == 'docs'
215
+ Requires-Dist: mkdocs-material>=9.7.7; extra == 'docs'
216
+ Requires-Dist: mkdocs<2.0,>=1.6.1; extra == 'docs'
217
+ Requires-Dist: mkdocstrings-python>=1.1.2; extra == 'docs'
218
+ Requires-Dist: mkdocstrings>=0.28.3; extra == 'docs'
219
+ Requires-Dist: pygments<3.0,>=2.20; extra == 'docs'
220
+ Requires-Dist: pymdown-extensions>=11.0.1; extra == 'docs'
221
+ Provides-Extra: metal
222
+ Requires-Dist: jax-metal>=0.1.0; extra == 'metal'
223
+ Provides-Extra: mlflow
224
+ Requires-Dist: mlflow>=2; extra == 'mlflow'
225
+ Provides-Extra: plots
226
+ Requires-Dist: matplotlib>=3.8; extra == 'plots'
227
+ Provides-Extra: test
228
+ Requires-Dist: coverage>=7; extra == 'test'
229
+ Requires-Dist: hypothesis>=6.100; extra == 'test'
230
+ Requires-Dist: matplotlib>=3.8; extra == 'test'
231
+ Requires-Dist: optax>=0.2.8; extra == 'test'
232
+ Requires-Dist: pytest-cov>=6.1.1; extra == 'test'
233
+ Requires-Dist: pytest-env>=1.0.1; extra == 'test'
234
+ Requires-Dist: pytest-json-report>=1.5.0; extra == 'test'
235
+ Requires-Dist: pytest-randomly>=3.15; extra == 'test'
236
+ Requires-Dist: pytest-timeout>=2.1; extra == 'test'
237
+ Requires-Dist: pytest-xdist>=3.6; extra == 'test'
238
+ Requires-Dist: pytest>=9.0.3; extra == 'test'
239
+ Provides-Extra: wandb
240
+ Requires-Dist: wandb>=0.18; extra == 'wandb'
241
+ Description-Content-Type: text/markdown
242
+
243
+ # Substrax
244
+
245
+ **Shared training and hardware infrastructure for the Avitai JAX stack.**
246
+
247
+ > **Research preview.** Substrax is under rapid iteration and the API will change while
248
+ > the sibling packages migrate onto it. Pin a version.
249
+
250
+ Substrax is the bottom of the Avitai dependency chain:
251
+
252
+ ```text
253
+ substrax → calibrax → datarax → artifex → opifex
254
+ ```
255
+
256
+ It holds the code those packages used to carry separately, so that each concern has one
257
+ home and one test suite:
258
+
259
+ | Subpackage | What it owns |
260
+ | --- | --- |
261
+ | `substrax.devices` | Device information and device placement, including the batch-size recommendation table |
262
+ | `substrax.mesh` | Device meshes on `jax.make_mesh`, mesh rules and partition-spec helpers, sharding strategies on `flax.nnx.spmd` |
263
+ | `substrax.spmd` | Data-parallel placement, `spmd_train_step`, gradient reduction and collectives on the flat-state path |
264
+ | `substrax.checkpoint` | One `CheckpointStore` protocol and one Orbax implementation over `CheckpointManager` |
265
+ | `substrax.callbacks` | The training-callback protocol, `BestMetricTracker`, `EarlyStopping` |
266
+ | `substrax.tracking` | Step-wise experiment tracking with console, CSV, Weights & Biases and MLflow backends |
267
+
268
+ Not in Substrax: optimizers and schedules (optax), loss scaling and gradient accumulation
269
+ (`flax.training.dynamic_scale.DynamicScale`, `optax.MultiSteps`), profiling and hardware
270
+ spec tables (calibrax), data pipelines (datarax), models and trainers (artifex, opifex).
271
+
272
+ ## Installation
273
+
274
+ ```bash
275
+ uv add substrax # or: pip install substrax
276
+ ```
277
+
278
+ Substrax requires Python 3.12 or later, `jax>=0.11.1`, `flax>=0.12.9` and
279
+ `orbax-checkpoint>=0.11.33`.
280
+
281
+ ## Development setup
282
+
283
+ ```bash
284
+ git clone https://github.com/avitai/substrax.git
285
+ cd substrax
286
+ ./setup.sh
287
+ source ./activate.sh
288
+ ```
289
+
290
+ `setup.sh` creates the environment with `uv`, syncs the `dev` and `test` extras plus the
291
+ backend extra for this machine, and writes the managed environment file `.substrax.env`
292
+ that `activate.sh` loads. A user-owned `.env` is never modified.
293
+
294
+ | Flag | Effect |
295
+ | --- | --- |
296
+ | `--backend <auto\|cpu\|cuda12\|metal>` | Choose the backend policy; `auto` resolves to `cuda12` on Linux with a visible NVIDIA GPU, `metal` on Apple Silicon, otherwise `cpu` |
297
+ | `--python <version>` | Create the environment with a specific Python version |
298
+ | `--extra <name>` | Sync an additional extra (repeatable), e.g. `--extra docs` |
299
+ | `--recreate` | Remove the existing `.venv` before syncing |
300
+ | `--force-clean` | Remove `.venv`, `.substrax.env` and repo-local test artifacts |
301
+ | `--dry-run` | Print the resolved backend and the `uv` commands without changing files |
302
+
303
+ Run the checks the way CI does:
304
+
305
+ ```bash
306
+ uv run --locked pytest
307
+ uv run --locked pre-commit run --all-files
308
+ uv run --locked mkdocs build --strict --clean
309
+ ```
310
+
311
+ ## Documentation
312
+
313
+ <https://substrax.readthedocs.io>
314
+
315
+ ## Contributing
316
+
317
+ See [CONTRIBUTING.md](CONTRIBUTING.md). Security reports go to the address in
318
+ [SECURITY.md](SECURITY.md), not to a public issue.
319
+
320
+ ## License
321
+
322
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,80 @@
1
+ # Substrax
2
+
3
+ **Shared training and hardware infrastructure for the Avitai JAX stack.**
4
+
5
+ > **Research preview.** Substrax is under rapid iteration and the API will change while
6
+ > the sibling packages migrate onto it. Pin a version.
7
+
8
+ Substrax is the bottom of the Avitai dependency chain:
9
+
10
+ ```text
11
+ substrax → calibrax → datarax → artifex → opifex
12
+ ```
13
+
14
+ It holds the code those packages used to carry separately, so that each concern has one
15
+ home and one test suite:
16
+
17
+ | Subpackage | What it owns |
18
+ | --- | --- |
19
+ | `substrax.devices` | Device information and device placement, including the batch-size recommendation table |
20
+ | `substrax.mesh` | Device meshes on `jax.make_mesh`, mesh rules and partition-spec helpers, sharding strategies on `flax.nnx.spmd` |
21
+ | `substrax.spmd` | Data-parallel placement, `spmd_train_step`, gradient reduction and collectives on the flat-state path |
22
+ | `substrax.checkpoint` | One `CheckpointStore` protocol and one Orbax implementation over `CheckpointManager` |
23
+ | `substrax.callbacks` | The training-callback protocol, `BestMetricTracker`, `EarlyStopping` |
24
+ | `substrax.tracking` | Step-wise experiment tracking with console, CSV, Weights & Biases and MLflow backends |
25
+
26
+ Not in Substrax: optimizers and schedules (optax), loss scaling and gradient accumulation
27
+ (`flax.training.dynamic_scale.DynamicScale`, `optax.MultiSteps`), profiling and hardware
28
+ spec tables (calibrax), data pipelines (datarax), models and trainers (artifex, opifex).
29
+
30
+ ## Installation
31
+
32
+ ```bash
33
+ uv add substrax # or: pip install substrax
34
+ ```
35
+
36
+ Substrax requires Python 3.12 or later, `jax>=0.11.1`, `flax>=0.12.9` and
37
+ `orbax-checkpoint>=0.11.33`.
38
+
39
+ ## Development setup
40
+
41
+ ```bash
42
+ git clone https://github.com/avitai/substrax.git
43
+ cd substrax
44
+ ./setup.sh
45
+ source ./activate.sh
46
+ ```
47
+
48
+ `setup.sh` creates the environment with `uv`, syncs the `dev` and `test` extras plus the
49
+ backend extra for this machine, and writes the managed environment file `.substrax.env`
50
+ that `activate.sh` loads. A user-owned `.env` is never modified.
51
+
52
+ | Flag | Effect |
53
+ | --- | --- |
54
+ | `--backend <auto\|cpu\|cuda12\|metal>` | Choose the backend policy; `auto` resolves to `cuda12` on Linux with a visible NVIDIA GPU, `metal` on Apple Silicon, otherwise `cpu` |
55
+ | `--python <version>` | Create the environment with a specific Python version |
56
+ | `--extra <name>` | Sync an additional extra (repeatable), e.g. `--extra docs` |
57
+ | `--recreate` | Remove the existing `.venv` before syncing |
58
+ | `--force-clean` | Remove `.venv`, `.substrax.env` and repo-local test artifacts |
59
+ | `--dry-run` | Print the resolved backend and the `uv` commands without changing files |
60
+
61
+ Run the checks the way CI does:
62
+
63
+ ```bash
64
+ uv run --locked pytest
65
+ uv run --locked pre-commit run --all-files
66
+ uv run --locked mkdocs build --strict --clean
67
+ ```
68
+
69
+ ## Documentation
70
+
71
+ <https://substrax.readthedocs.io>
72
+
73
+ ## Contributing
74
+
75
+ See [CONTRIBUTING.md](CONTRIBUTING.md). Security reports go to the address in
76
+ [SECURITY.md](SECURITY.md), not to a public issue.
77
+
78
+ ## License
79
+
80
+ MIT — see [LICENSE](LICENSE).