scao 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.
- scao-0.1.0/CHANGELOG.md +49 -0
- scao-0.1.0/LICENSE +179 -0
- scao-0.1.0/MANIFEST.in +12 -0
- scao-0.1.0/PKG-INFO +688 -0
- scao-0.1.0/README.md +643 -0
- scao-0.1.0/configs/base.yaml +30 -0
- scao-0.1.0/configs/gpt2_medium.yaml +49 -0
- scao-0.1.0/configs/gpt2_small.yaml +48 -0
- scao-0.1.0/configs/gpt_small.yaml +43 -0
- scao-0.1.0/configs/llama_1b.yaml +52 -0
- scao-0.1.0/configs/vit_small.yaml +38 -0
- scao-0.1.0/pyproject.toml +106 -0
- scao-0.1.0/scao/__init__.py +49 -0
- scao-0.1.0/scao/cuda/__init__.py +130 -0
- scao-0.1.0/scao/cuda/setup.py +33 -0
- scao-0.1.0/scao/distributed.py +114 -0
- scao-0.1.0/scao/integrations/__init__.py +0 -0
- scao-0.1.0/scao/integrations/huggingface.py +246 -0
- scao-0.1.0/scao/logging.py +163 -0
- scao-0.1.0/scao/optimizer.py +516 -0
- scao-0.1.0/scao/preconditioner.py +399 -0
- scao-0.1.0/scao/py.typed +0 -0
- scao-0.1.0/scao/utils.py +206 -0
- scao-0.1.0/scao.egg-info/PKG-INFO +688 -0
- scao-0.1.0/scao.egg-info/SOURCES.txt +27 -0
- scao-0.1.0/scao.egg-info/dependency_links.txt +1 -0
- scao-0.1.0/scao.egg-info/requires.txt +22 -0
- scao-0.1.0/scao.egg-info/top_level.txt +1 -0
- scao-0.1.0/setup.cfg +4 -0
scao-0.1.0/CHANGELOG.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to SCAO are documented here.
|
|
4
|
+
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## [0.1.0] — 2026-04-20
|
|
9
|
+
|
|
10
|
+
### Initial open-source release
|
|
11
|
+
|
|
12
|
+
#### Core optimizer (`scao.SCAO`)
|
|
13
|
+
- Two-phase training: Adam warmup → Kronecker-factored SCAO phase
|
|
14
|
+
- Adaptive rank selection via spectral mass threshold (`epsilon_sparse=0.05`)
|
|
15
|
+
- Sparse block-diagonal fallback for large layers (`max_precond_dim=4096`)
|
|
16
|
+
- Drop-in replacement for `torch.optim.AdamW` — identical training loop
|
|
17
|
+
|
|
18
|
+
#### Phase-transition stability (three critical fixes)
|
|
19
|
+
- **EMA bias correction**: `L/R` factors initialized as `ε·I` (not zero) to prevent
|
|
20
|
+
rank-deficient first preconditioner application
|
|
21
|
+
- **50-step cosine blend ramp**: gradual transition from Adam gradient to preconditioned
|
|
22
|
+
gradient prevents momentum disruption at the phase boundary
|
|
23
|
+
- **Adaptive Tikhonov regularization**: `eps = max(ε₀, 1e-4 · tr(L)/m)` scales
|
|
24
|
+
regularization to actual curvature magnitude
|
|
25
|
+
|
|
26
|
+
#### Empirical results (WikiText-2, 838K-param GPT, 500 steps)
|
|
27
|
+
- SCAO: **12.03 PPL**, **827 tok/s** vs AdamW: 11.85 PPL, 537 tok/s
|
|
28
|
+
- **+54% throughput** over AdamW via amortized curvature updates
|
|
29
|
+
- PPL gap narrows from 4% (200 steps) to **1.5% (500 steps)**
|
|
30
|
+
- Lower AUC (2.854 vs 2.873) — SCAO has lower mean training loss across the full run
|
|
31
|
+
|
|
32
|
+
#### Infrastructure
|
|
33
|
+
- Full mixed-precision support (bfloat16, float16, float32)
|
|
34
|
+
- `torch.compile` compatible (hot-path fully traceable)
|
|
35
|
+
- FSDP / DDP compatible via `scao.distributed`
|
|
36
|
+
- HuggingFace `Trainer` integration via `scao.integrations.huggingface`
|
|
37
|
+
- Callback system for WandB, TensorBoard, console logging
|
|
38
|
+
- 32 optimizer tests + 27 profiling tests
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## [Unreleased]
|
|
43
|
+
|
|
44
|
+
### Planned
|
|
45
|
+
- GPU benchmarks at 125M and 350M parameters (Colab notebook ready)
|
|
46
|
+
- CUDA fused kernels for low-rank operations (`k > 128`)
|
|
47
|
+
- Quantized curvature factors (int8 EMA accumulators)
|
|
48
|
+
- Theoretical convergence analysis extending Shampoo regret bounds
|
|
49
|
+
- Evaluation at 1B+ parameter scale
|
scao-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship made available under
|
|
36
|
+
the License, as indicated by a copyright notice that is included in
|
|
37
|
+
or attached to the work (an example is provided in the Appendix below).
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other transformations
|
|
42
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
43
|
+
of this License, Derivative Works shall not include works that remain
|
|
44
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
45
|
+
the Work and Derivative Works thereof.
|
|
46
|
+
|
|
47
|
+
"Contribution" shall mean, as submitted to the Licensor for inclusion
|
|
48
|
+
in the Work by the copyright owner or by an individual or Legal Entity
|
|
49
|
+
authorized to submit on behalf of the copyright owner. For the purposes
|
|
50
|
+
of this definition, "submitted" means any form of electronic, verbal,
|
|
51
|
+
or written communication sent to the Licensor or its representatives,
|
|
52
|
+
including but not limited to communication on electronic mailing lists,
|
|
53
|
+
source code control systems, and issue tracking systems that are managed
|
|
54
|
+
by, or on behalf of, the Licensor for the purpose of discussing and
|
|
55
|
+
improving the Work, but excluding communication that is conspicuously
|
|
56
|
+
marked or designated in writing by the copyright owner as "Not a
|
|
57
|
+
Contribution."
|
|
58
|
+
|
|
59
|
+
"Contributor" shall mean Licensor and any Legal Entity on behalf of
|
|
60
|
+
whom a Contribution has been received by the Licensor and included
|
|
61
|
+
within the Work.
|
|
62
|
+
|
|
63
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
64
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
65
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
66
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
67
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
68
|
+
Work and such Derivative Works in Source or Object form.
|
|
69
|
+
|
|
70
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
71
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
72
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
73
|
+
(except as stated in this section) patent license to make, have made,
|
|
74
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
75
|
+
where such license applies only to those patent contributions
|
|
76
|
+
Licensable by such Contributor that are necessarily infringed by their
|
|
77
|
+
Contribution(s) alone or by the combination of their Contribution(s)
|
|
78
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
79
|
+
institute patent litigation against any entity (including a cross-claim
|
|
80
|
+
or counterclaim in a lawsuit) alleging that the Work or any
|
|
81
|
+
Contribution embodied within the Work constitutes direct or contributory
|
|
82
|
+
patent infringement, then any patent and copyright licenses granted to
|
|
83
|
+
You under this License for that Work shall terminate as of the date
|
|
84
|
+
such litigation is filed.
|
|
85
|
+
|
|
86
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
87
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
88
|
+
modifications, and in Source or Object form, provided that You
|
|
89
|
+
meet the following conditions:
|
|
90
|
+
|
|
91
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
92
|
+
Works a copy of this License; and
|
|
93
|
+
|
|
94
|
+
(b) You must cause any modified files to carry prominent notices
|
|
95
|
+
stating that You changed the files; and
|
|
96
|
+
|
|
97
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
98
|
+
that You distribute, all copyright, patent, trademark, and
|
|
99
|
+
attribution notices from the Source form of the Work,
|
|
100
|
+
excluding those notices that do not pertain to any part of
|
|
101
|
+
the Derivative Works; and
|
|
102
|
+
|
|
103
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
104
|
+
distribution, You must include a readable copy of the
|
|
105
|
+
attribution notices contained within such NOTICE file, in
|
|
106
|
+
at least one of the following places: within a NOTICE text
|
|
107
|
+
file distributed as part of the Derivative Works; within
|
|
108
|
+
the Source form or documentation, if provided along with the
|
|
109
|
+
Derivative Works; or, within a display generated by the
|
|
110
|
+
Derivative Works, if and wherever such third-party notices
|
|
111
|
+
normally appear. The contents of the NOTICE file are for
|
|
112
|
+
informational purposes only and do not modify the License.
|
|
113
|
+
You may add Your own attribution notices within Derivative
|
|
114
|
+
Works that You distribute, alongside or as an addendum to
|
|
115
|
+
the NOTICE text from the Work, provided that such additional
|
|
116
|
+
attribution notices cannot be construed as modifying the License.
|
|
117
|
+
|
|
118
|
+
You may add Your own license statement for Your modifications and
|
|
119
|
+
may provide additional grant of rights to use, copy, modify, merge,
|
|
120
|
+
publish, distribute, sublicense, and/or sell copies of the Software,
|
|
121
|
+
and to permit persons to whom the Software is furnished to do so,
|
|
122
|
+
subject to the following conditions.
|
|
123
|
+
|
|
124
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
125
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
126
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
127
|
+
this License, without any additional terms or conditions.
|
|
128
|
+
|
|
129
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
130
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
131
|
+
except as required for reasonable and customary use in describing the
|
|
132
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
133
|
+
|
|
134
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed
|
|
135
|
+
to in writing, Licensor provides the Work (and each Contributor
|
|
136
|
+
provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES
|
|
137
|
+
OR CONDITIONS OF ANY KIND, either express or implied, including,
|
|
138
|
+
without limitation, any warranties or conditions of TITLE,
|
|
139
|
+
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR
|
|
140
|
+
PURPOSE. You are solely responsible for determining the
|
|
141
|
+
appropriateness of using or reproducing the Work and assume any
|
|
142
|
+
risks associated with Your exercise of permissions under this License.
|
|
143
|
+
|
|
144
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
145
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
146
|
+
unless required by applicable law (such as deliberate and grossly
|
|
147
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
148
|
+
liable to You for damages, including any direct, indirect, special,
|
|
149
|
+
incidental, or exemplary damages of any character arising as a
|
|
150
|
+
result of this License or out of the use or inability to use the
|
|
151
|
+
Work (even if such Contributor has been advised of the possibility
|
|
152
|
+
of such damages).
|
|
153
|
+
|
|
154
|
+
9. Accepting Warranty or Liability. While redistributing the Work or
|
|
155
|
+
Derivative Works thereof, You may choose to offer, and charge a fee
|
|
156
|
+
for, acceptance of support, warranty, indemnity, or other liability
|
|
157
|
+
obligations and/or rights consistent with this License. However, in
|
|
158
|
+
accepting such obligations, You may offer such conditions only on
|
|
159
|
+
Your own behalf and on Your sole responsibility, not on behalf of
|
|
160
|
+
any other Contributor, and only if You agree to indemnify, defend,
|
|
161
|
+
and hold each Contributor harmless for any liability incurred by, or
|
|
162
|
+
claims asserted against, such Contributor by reason of your accepting
|
|
163
|
+
any such warranty or additional liability.
|
|
164
|
+
|
|
165
|
+
END OF TERMS AND CONDITIONS
|
|
166
|
+
|
|
167
|
+
Copyright 2026 SCAO Authors
|
|
168
|
+
|
|
169
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
170
|
+
you may not use this file except in compliance with the License.
|
|
171
|
+
You may obtain a copy of the License at
|
|
172
|
+
|
|
173
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
174
|
+
|
|
175
|
+
Unless required by applicable law or agreed to in writing, software
|
|
176
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
177
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
178
|
+
See the License for the specific language governing permissions and
|
|
179
|
+
limitations under the License.
|
scao-0.1.0/MANIFEST.in
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
include LICENSE
|
|
2
|
+
include README.md
|
|
3
|
+
include CHANGELOG.md
|
|
4
|
+
include pyproject.toml
|
|
5
|
+
|
|
6
|
+
recursive-include scao *.py
|
|
7
|
+
recursive-include configs *.yaml
|
|
8
|
+
exclude scao/benchmarks/*.py
|
|
9
|
+
exclude scao/tests/*.py
|
|
10
|
+
exclude scripts/*
|
|
11
|
+
exclude paper/*
|
|
12
|
+
exclude results_*.csv
|