Skip to content

v0.9.24 — Fable 5.1 GPU Training Fixes

Latest

Choose a tag to compare

@kolkov kolkov released this 25 Sep 16:09
· 4 commits to main since this release
cc3d257

Critical GPU training bug fixes from independent Fable 5.1 audit. 9 findings fixed, 3 regressions caught and resolved during revalidation.

Fixed

  • Autodiff backward root — tape.Backward now roots at the loss tensor, not the last recorded op. Operations after loss (metrics, logging) no longer corrupt gradients
  • AutodiffBackend cache invalidation — forwards ClearInputBufferCache() to inner backend through autodiff wrapper
  • GPU buffer deferred release — clearInputBufferCache uses DeferReleaseGPUBuffer instead of immediate Release(), preventing panic with pending GPU commands
  • SetTensor ownership — takes ownership without Clone/AddRef, preventing GPU memory leak every training step
  • materializeForCPU — reads GPU buffer via ReadGPUBuffer without Realize() side-effect, preventing stack overflow on chained backward ops
  • Clone+AddRef lifecycle — RawTensor.Clone() calls AddRef() through BackendDataRefCounter interface; ReclaimMemory uses ForceRelease() for all non-persistent entries
  • ReleaseGradients public API — accepts optional backend parameter, actually releases GPU gradient buffers
  • MSELoss gradient flow — uses backend.Sum + backend.DivScalar instead of CPU .AsFloat32() loop
  • RoPE gradient flow — applyRotation rewritten with Chunk/Mul/Sub/Add/Cat tensor ops, all on autodiff tape
  • Conv2D/MaxPool2D backward GPU — CPU fallback instead of panic("not implemented")

Added

  • Sum, Expand, Cast autodiff ops — recorded on tape with proper backward; loss = y.Sum() now produces correct gradients
  • One-hot identity cache — sync.Map cache per (numClasses, dtype), caches the C×C identity per process (C×C-free one-hot via Gather still open)
  • Fable regression tests — TestRV_TrainingLoopMemory, TestRV_DiamondGraph, TestRV_Conv2DBackwardGPU

Changed

  • gogpu deps — wgpu v0.30.35→v0.34.4, gputypes v0.5.1→v0.8.0, naga v0.18.0→v0.19.0, gpucontext v0.24.0→v0.31.3

Full Changelog: v0.9.23...v0.9.24

💚 Sponsor Born ML: https://opencollective.com/born-ml