VTL v0.2.0-beta.1

Tensors, autograd and neural networks, natively in V.

VTL is a pure-V tensor library for numerical computing and machine learning — N-dimensional arrays, reverse-mode autograd, and a full neural-network module, powered by VSL kernels on CPU, CUDA and Vulkan.

epoch 0epoch 40 loss
fig. 1 — training loss, tiny CIFAR-10 synthetic runCPU · f64

First tensor in under a minute

Install V, add VTL, and run real tensor code. VTL uses VSL as its numerical backend for linear algebra and scientific kernels.

# install both modules
v install vtl

// main.v — create, reshape, differentiate
import vtl

fn main() {
    t := vtl.from_array([1.0, 2, 3, 4], [2, 2])!
    println(t.get([1, 1])) // 4.0
}

Follow the full getting-started guide →


Choose a path

Start where you are: array programming, model training, or the raw numbers behind both.

Array programming

Generic N-dimensional tensors with slicing, broadcasting, reshape, transpose and view-preserving axis moves — the NumPy mental model, typed in V.

First steps tutorial →

Autograd & training

Reverse-mode autograd, neural-network layers and losses, optimizers, datasets and CPU training today, with selected CUDA and Vulkan paths.

Autograd tutorial →

Kernels via VSL

Linear algebra, statistics and scientific routines come from VSL, with SIMD-vectorized BLAS-style kernels and optional OpenBLAS/LAPACKE backends.

VSL website →

Where VTL stands against NumPy and PyTorch

An honest ledger, not a marketing claim. Every row links to the tracked parity documents, which list what is implemented, partial, and still missing.

DomainStatusNotes
Array creation & manipulationImplementedCreation, reshape/transpose views, stacking, padding, sorting; copy-vs-view audit ongoing.
Indexing & set operationsImplementedAdvanced/mixed indexing, unique, searchsorted, take/put families, boolean masks.
Math, reductions & statisticsImplementedElementwise math, axis reductions, quantiles and histogram family via VSL.
FFT & linear algebraImplementedFFT modules plus VSL-backed decompositions and solvers.
AutogradImplementedReverse-mode graphs with fused gate backward kernels; gradient-checked.
Neural networksPartialLayers, losses, optimizers and sequential models; some CUDA backward paths still land.
GPU backendsPartialCUDA and Vulkan paths for selected ops; OpenCL compute dispatch incomplete.
Serialization & dataImplementedNPY/NPZ, CSV, model checkpoints and DataLoader utilities.

Full detail: NumPy parity tracker · PyTorch parity tracker. Gaps are tracked as GitHub issues and close only with API, tests and examples in place.


Performance, measured

Matrix multiplication through the VSL backend on a Ryzen 9 5900X, 2 threads, against the NumPy 2.5.3 wheel. Builds differ; treat this as a GEMM sample, not a blanket speed claim.

1.43 ms
VSL + OpenBLAS 0.3.34 — 512×512 GEMM (NumPy: 2.11 ms)
8.47 ms
VSL + OpenBLAS 0.3.34 — 1024×1024 GEMM (NumPy: 17.38 ms)
1.9×
SIMD vs scalar f64 unit-stride dot, 1M elements, -prod build

Method: compile benchmarks with -prod first, then execute the binary — never v run for timings. Reproduce from the benchmarks directory.