Skip to content

v0.2.0-beta.1 — ML Beta

Pre-release
Pre-release

Choose a tag to compare

@ulises-jeremias ulises-jeremias released this 02 Jun 17:13
37cc06e

VTL v0.2.0-beta.1 — ML Beta: f32 training, autograd, and opt-in GPU paths

Paired release: VSL v0.2.0-beta.1required dependency.

Overview

First tagged release of VTL as the V machine learning library: n-dimensional tensors, reverse-mode autograd, Sequential neural networks, losses, optimizers, datasets, and f32 CPU training as the stable beta path. CUDA and Vulkan acceleration hooks are included for early adopters but remain experimental.

Depends on: vsl@0.2.0-beta.1

Highlights

Core ML stack (stable beta)

  • Tensor[T] — creation, slicing, reshape, transpose, broadcast, reductions, stacking.
  • vtl.autogradContext, Variable, gates, backprop(); f32 Sequential + MSE training.
  • vtl.nn.models.Sequential — layer composition, forward, loss attachment.
  • Layers — Linear, Conv2D, activations, pooling, normalization, LSTM, attention.
  • Losses — MSE, BCE, CrossEntropy, Huber, KL, NLL, and more.
  • Optimizers — Adam, AdamW, SGD, RMSProp, AdaGrad + schedulers; f32 CPU Adam for training smokes.
  • Datasets — MNIST, IMDB, CIFAR-10 + DataLoader[T].
  • Serialization — model checkpoint round-trip.
  • from_array shape clone — fixes tensor aliasing (#41).

f32 training path (beta flagship)

  • Examples: nn_cifar10_f32_tiny_synth, nn_cifar10_tiny_synth (f64).
  • CI smokes: f32 autograd, f32 training tests, scoped bin/test.
  • See docs/DEV_LIGHTWEIGHT.md for memory-safe local commands.

CUDA integration (experimental, opt-in)

Phase Feature Env / flag
1 Linear + Conv2D forward, DeviceSession -d cuda, VTL_USE_CUDA=1
2 GPU activation chain -d cuda
3 Linear/Conv2D backward VTL_CUDA_BACKWARD=1
4 Adam GPU moment updates + persistent slots VTL_CUDA_OPTIMIZER=1

Examples/tests: nn_cifar10_cuda, cuda_training_smoke_test.

Vulkan integration (experimental, opt-in)

  • Linear forward in Sequential (VTL_USE_VULKAN=1, -d vulkan)
  • Conv2D same-padding forward/backward (im2col + GEMM)
  • ReLU/Sigmoid f32 unary ops
  • Fused Adam f32 shader (VSL adam_step)
  • Examples: nn_cifar10_vulkan, nn_cifar10_f32_vulkan_tiny_synth

Stable vs experimental (beta contract)

Tier Surface
Stable vtl, vtl.autograd, vtl.nn.models, vtl.nn.layers, vtl.nn.loss, vtl.nn.optimizers (CPU f32), vtl.datasets, vtl.storage (CPU)
Experimental *_cuda*, *_vulkan*, autograd_cuda/**, GPU optimizer hooks
Internal vtl.nn.internal/**

Primary path: f32 CPU training with Sequential + Adam + MSE.

Platform support (validated)

Platform Status Notes
Linux (ubuntu 20.04/22.04) Supported Primary CI
Windows Smoke validated Tensor creation smoke + setup-v@v1.6
macOS Known issue Inherited VSL LAPACKE issue (#91)
CUDA / Vulkan Opt-in Local hardware + env flags

Installation

v install vsl@0.2.0-beta.1
v install vtl@0.2.0-beta.1

vtl/v.mod for this release:

Module {
    name: 'vtl'
    version: '0.2.0-beta.1'
    dependencies: ['vsl@0.2.0-beta.1']
}

Quick start (CPU f32)

v run vtl/examples/nn_cifar10_f32_tiny_synth/main.v
cd vtl && ./bin/test

Opt-in GPU (local)

VTL_USE_CUDA=1 VTL_TEST_CUDA=1 VJOBS=1 v -d cuda test vtl/nn/cuda_training_smoke_test.v
VTL_USE_VULKAN=1 VTL_TEST_VULKAN=1 VJOBS=1 v -prod -d vulkan test vtl/nn/f32_vulkan_training_smoke_d_vulkan_test.v

Examples (beta-relevant)

Example Purpose
nn_cifar10_f32_tiny_synth Beta smoke — f32 tiny training
nn_cifar10_tiny_synth f64 tiny training smoke
nn_cifar10_cuda CUDA training smoke
nn_cifar10_vulkan Full Vulkan f32 stack
nn_mnist, nn_xor Learning path

Known issues (beta)

  1. macOS — VSL LAPACKE path may break LA-heavy tests
  2. Windows — smoke validated; full matrix not on Windows
  3. f64 training — post-beta primary path; use f32
  4. Vulkan — no persistent GPU activation chain yet (post-beta)

Upstream: VSL

Requires VSL v0.2.0-beta.1. Do not mix beta tags across repos.

Links