| """HYDRA autoresearch training entry point. | |
| Thin shim over the `hydra/` package (W1 modularization). The heavy lifting | |
| lives in: | |
| hydra/config.py β PostSemClawConfig dataclass + env var constants | |
| hydra/engram.py β GPUEngram (conditional memory, Hebbian writes) | |
| hydra/optimizer.py β MuonAdamW + fused Muon/AdamW step kernels | |
| hydra/model.py β PostSemClawModel assembly + forward | |
| hydra/eval.py β factual probes + factual English scoring | |
| hydra/training.py β training loop + main() | |
| Public API is re-exported below for back-compat with tests/ and scripts/ | |
| that still `from train import ...`. | |
| Usage: `uv run train.py` | |
| """ | |
| from __future__ import annotations | |
| # Re-exports for back-compat. Importing hydra.model is safe (no side effects). | |
| from hydra.config import PostSemClawConfig | |
| from hydra.engram import GPUEngram | |
| from hydra.model import PostSemClawModel, norm | |
| from hydra.optimizer import ( | |
| MuonAdamW, | |
| adamw_step_fused, | |
| muon_step_fused, | |
| polar_express_coeffs, | |
| ) | |
| # MAX_SEQ_LEN is often imported from train by tooling; forward from prepare. | |
| from prepare import MAX_SEQ_LEN # noqa: F401 | |
| __all__ = [ | |
| "PostSemClawConfig", | |
| "PostSemClawModel", | |
| "GPUEngram", | |
| "MuonAdamW", | |
| "adamw_step_fused", | |
| "muon_step_fused", | |
| "polar_express_coeffs", | |
| "norm", | |
| "MAX_SEQ_LEN", | |
| ] | |
| if __name__ == "__main__": | |
| from hydra.training import main | |
| main() | |