Skip to content

v0.11.0: TrainerSetWeight API

Choose a tag to compare

@mrothroc mrothroc released this 26 Apr 17:31
· 599 commits to main since this release

New API

`gpu.TrainerSetWeight` and `trainer.SetWeightGPU(name, data)` allow replacing
a single weight tensor on a live trainer without destroying optimizer state
(Adam moments, etc.).

```go
data := make([]float32, 1024*512)
// ... fill with new basis values ...
err := trainer.SetWeightGPU("projection", data)
```

The implementation flushes any pending pipelined ops before mutation, validates
shape, and only swaps the weight array — leaving optimizer state intact.

Use Cases

  • Rolling-PCA basis updates (refresh frozen projection mid-training)
  • Weight averaging / EMA updates
  • Hot-swapping LoRA adapters
  • Activation-aware quantization sweeps that requantize a subset of weights

Install

```bash
brew tap mrothroc/mixlab https://github.com/mrothroc/mixlab
brew upgrade mixlab
```