Skip to content

v1.3.12

Choose a tag to compare

@github-actions github-actions released this 01 Aug 01:32
· 490 commits to main since this release

Changelog

v1.3.12

Features

  • Mano optimizer: add mano_adamw — manifold normalized optimizer with axis-rotating tangent projection, replacing Newton-Schulz iteration with cheaper normalization
  • Nora optimizer: add nora_nadamw — normalized orthogonal row alignment for matrix weights paired with Nesterov AdamW
  • Gradient SNR metric: EMA-based gradient signal-to-noise ratio tracking (grad_snr) added to default metrics
  • Grouped CLI options: --help now renders options in 10 labeled sections (Paths & Setup, Training, Optimizer, LR Schedule, etc.)
  • AttentionBackend ABC: context-manager-based backend selection with TorchNativeBackend (SDPA) and CudaBackend (kernel dispatch)
  • Fused CUDA rotary kernel: single-kernel rotary embedding (cos/sin lookup + rotation) with auto-dispatch (CUDA if available, else torch complex-multiply)
  • Multi-dim mask support: attention kernels accept 2D/3D/4D masks with broadcasting
  • torch.compile: --compile CLI option for training (default/reduce-overhead/max-autotune)
  • YAML config: --config flag for train CLI, CLI flags override YAML values
  • GPU-accelerated SVD: --device flag for weight analysis eval, defaults to cuda
  • Rust DecodeStream: O(n) streaming decode replacing Python token-by-token loop
  • Hierarchical logger: setup_logging() with astrai logger namespace

Performance

  • Decode cp.async pipeline: split-KV MMA kernels use true multi-stage cp.async (wait_group<STAGES-1>), keeping STAGES-1 tile loads in flight (+31-40% decode throughput)
  • Split partials memset removal: torch::empty replaces per-call zeros/full memset (2 kernels/layer/step eliminated)
  • BC=16 decode tile: higher occupancy for D=256 (spill eliminated, 248 regs, 0 spill)
  • Paged MMA for page_size=1: decode path uses paged kernel with req_to_token as page table
  • Scheduler/executor overhead: precompute page_table/decode_mask per step (was per-layer), skip frequency penalty when all-zero, single get_active_tasks() call
  • Rotary kernel: 6-9x faster than torch complex-multiply across decode/prefill shapes
  • Eval batch sizes: increased default eval batch sizes + max_seq_len config

Fixes

  • ManoAdamW AdamW: use torch.optim.AdamW(fused) instead of custom NAdamW, matching MuonAdamW for fair comparison
  • Paged decode stability: fix race condition in paged decode attention kernels
  • Rotary grad guard: skip CUDA rotary kernel when torch.is_grad_enabled(), ensuring autograd compatibility for training
  • FSDP fixes: clip_grad_norm correctness, unwrap_model collective op + None guard, reshard_after_forward=False default
  • FSDP ref/old model: broadcast state_dict for FSDP-wrapped ref/old models
  • Resume epoch: correct epoch computation on resume to avoid redoing completed epochs
  • Metric logs: keep cumulative instead of segmental within each checkpoint
  • ChatTemplate pickling: __getstate__/__setstate__ drops unpicklable Jinja2 closure for spawn multiprocessing

Refactoring

  • Composite optimizer helpers: extract composite_step/zero_grad/state_dict/refresh_param_groups to astrai/optim/composite.py; OptimizerFactory moved here to enable @register decorator in each optimizer module
  • Naming unification: MuonMix → MuonAdamW, file muon_mix.py → muon_adamw.py
  • KV cache: three-layer separation architecture (PagePool / KVCache / PrefixCache) with single-index access
  • FSDP2 as default: replace FullyShardedDataParallel with per-module fully_shard, remove fsdp2 CLI choice
  • Config system: migrate to Pydantic dataclasses with field/model validators
  • Extension API: unify to blhd layout ([batch, seq_len, n_heads, head_dim]) and is_causal interface
  • Storage backend: remove H5 in favor of mmap bin (sole pre-tokenized storage)
  • Factory pattern: simplify BaseFactory, separate ModelFactory from AutoModel

Build

  • CUDA wheel matrix: parametrize CUDA version (cu128, cu130) for wheels and Docker
  • .so output path: compiled kernels land in astrai/extension/lib/ (was astrai/_ext/)

Docs

  • Restructure to docs/ with guides/ and developer/ subdirectories
  • Add get-started.md, evaluation.md, distributed.md, internals.md, cuda_kernels.md
  • Document mano_adamw and nora_nadamw optimizer parameters in params.md