You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CI test suites are encoded as shell scripts in `tests/ci/`:
62
62
63
-
-`L0_Tests_CPU.sh` — distributed CPU + a couple of CPU-only tests.
63
+
-`L0_Tests_CPU.sh` — all `tests/test_distributed_*_cpu.py` at 8 and 4 ranks (rekls also at 1 rank) + a couple of CPU-only tests.
64
64
-`L0_Tests_GPU.sh` — every `tests/test_*.py` (excluding `*_cpu.py`) on `--device=cuda`, run twice (random seed, then `--seed=42`), plus the `tests/convergence/*_test.py` set.
65
65
-`L1_Tests_GPU.sh` — convergence tests at `--seed=77` plus the `moe_c4_convergence.py` runs against muon/soap with a loss target.
66
66
@@ -87,11 +87,12 @@ Run a single test class/method using absl conventions, e.g. `python tests/test_o
87
87
88
88
-`registry.py` — global `_OPTIMIZERS` dict with a `@register_optimizer("name")` decorator; `get_optimizer_cls` / `get_configured_optimizer_cls` provide lookup. **Important: a class is only in the registry once its module has been imported.** External callers must import the optimizer module (e.g. `from emerging_optimizers.orthogonalized_optimizers import muon`) before `get_optimizer_cls("muon")` will find it.
89
89
-`mixin.py` — `WeightDecayMixin` with four `weight_decay_method` modes: `decoupled`, `independent`, `l2`, `palm`. Optimizers that include this mixin set `self.weight_decay_method` and call `_apply_weight_decay_inplace(p, grad, lr, wd)` inside `step`.
90
-
-`orthogonalized_optimizers/` — Muon and friends (`muon`, `adaptive_muon`, `muon_hyperball`, `mop`, `polargrad`, `scion`, `sinkhorn_muon`). All extend `OrthogonalizedOptimizer` (`orthogonalized_optimizer.py`), which implements the EMA-momentum + (optional Nesterov) + `scaled_orthogonalize_fn` pipeline. Subclasses customize behavior by overriding `orthogonalize(p, grad, **group_kwargs)` (e.g. for split-QKV preconditioning) or the `pre_weight_update_fn_inplace` / `post_weight_update_fn_inplace` hooks (used by hyperball-style updates that preserve weight norms). `muon_utils` holds the Newton–Schulz iteration coefficients and helpers; `spectral_clipping_utils` implements spectral norm clipping.
91
-
-`soap/` — SOAP optimizer (`soap.py`) and REKLS variant (`rekls.py`), with shared `soap_utils.py`. Uses Kronecker-factored preconditioning and tracks eigenbases per-parameter.
92
-
-`psgd/` — PSGD-Kron (`psgd.py`) plus `psgd_kron_contractions.py` (Einsum contractions for triangular factors), `procrustes_step.py`, and `psgd_utils.py`.
-`orthogonalized_optimizers/` — Muon and friends (`muon`, `adaptive_muon`, `muon_hyperball`, `mop`, `polargrad`, `scion`, `sinkhorn_muon`, `spel`). All extend `OrthogonalizedOptimizer` (`orthogonalized_optimizer.py`), which implements the EMA-momentum + (optional Nesterov) + `scaled_orthogonalize_fn` pipeline. Subclasses customize behavior by overriding `orthogonalize(p, grad, **group_kwargs)` (e.g. for split-QKV preconditioning) or the `pre_weight_update_fn_inplace` / `post_weight_update_fn_inplace` hooks (used by hyperball-style updates that preserve weight norms). `muon_utils` holds the Newton–Schulz iteration coefficients and helpers, including the tensor-parallel `newton_schulz_tp`; `spectral_clipping_utils` implements spectral norm clipping.
91
+
-`soap/` — the SOAP family, sharing `soap_utils.py`: `soap.py` (`SOAP`, plus `StackedSoap` which optimizes batched/3D params through transient 2D stacking), `rekls.py` (REKLS), `tp_rekls.py` (experimental tensor-parallel REKLS), and `moso.py` (MOSO, momentum one-sided SOAP). Uses Kronecker-factored preconditioning and tracks eigenbases per-parameter.
92
+
-`psgd/` — `PSGDPro` (`psgd.py`, registered as `psgd_pro`) plus `psgd_kron_contractions.py` (Einsum contractions for triangular factors), `procrustes_step.py`, and `psgd_utils.py`.
93
+
-`scalar_optimizers/` — element-wise optimizers (`lion`, `signum`, `laprop`, `sim_ademamix`), defined in `__init__.py` on top of the `base.py` hierarchy (`SingleMomentumOptimizer` / `TwoMomentsOptimizer`); `update_functions/` holds the reusable per-algorithm update primitives (adam, lion, laprop, ademamix, madam, signum).
-`contrib/` — contributed/experimental optimizers kept out of the registry (`muown.py`: `Muown`, a Muon variant).
95
96
-`triton_kernels/syrk.py` — Triton SYRK kernel used to accelerate Gram-matrix computations in preconditioner updates. Triton is an optional/test-only dep; gate imports.
96
97
-`utils/` — `eig.py` (eigendecomposition helpers), `sinkhorn_mapper.py` (`SinkhornMapper`), `modules.py`, and the `fp32_matmul_precision` context manager (sets `torch.set_float32_matmul_precision` for the duration of orthogonalization). `FP32MatmulPrecT = Literal["highest", "high", "medium"]` is the canonical type alias.
97
98
@@ -124,4 +125,9 @@ Don't override `step` — override `orthogonalize` (and the pre/post hooks if yo
124
125
125
126
## CI specifics
126
127
127
-
CI runs in containers built via `docker/Dockerfile.ci`. Key env flags set by the test scripts: `TORCH_COMPILE_DISABLE=1` (CPU script) and `TORCH_ALLOW_TF32_CUBLAS_OVERRIDE=0` (GPU scripts) — preserve these when reproducing CI failures locally.
128
+
CI runs in containers built via `docker/Dockerfile.ci`. Key env flags set by the test scripts: `TORCH_COMPILE_DISABLE=1` (CPU and L0 GPU scripts) and `TORCH_ALLOW_TF32_CUBLAS_OVERRIDE=0` (GPU scripts) — preserve these when reproducing CI failures locally.
129
+
130
+
## Rules for agent
131
+
132
+
* Never write or modify comment including docstring unless explicitly asked.
0 commit comments