VTL Examples

June 1, 2026 ยท View on GitHub

Run examples from ~/.vmodules unless a README says otherwise:

v run vtl/examples/nn_xor/main.v

Some examples download datasets or require GPU build flags. Use the synthetic CIFAR examples for CI-safe checks.

Tensor and autograd basics

ExampleWhat it showsCommand
vtl_basic_usageTensor creation and basic operationsv run vtl/examples/vtl_basic_usage/main.v
vtl_vandermontMatrix construction and LA utilitiesv run vtl/examples/vtl_vandermont/main.v
autograd_backpropManual autograd/backprop flowv run vtl/examples/autograd_backprop/main.v

Neural networks

ExampleWhat it showsNotes
nn_xorSmall XOR classifierFast CPU smoke
nn_simple_two_layerBasic MLPFast CPU smoke
nn_regression_sineRegression with synthetic dataCPU
nn_multiclass_irisMulticlass classifierCPU
nn_autoencoder_simpleSimple autoencoderCPU
nn_mnistMNIST training pathDataset download/cache

CIFAR-10 release examples

ExamplePurposeRecommended use
nn_cifar10_tiny_synthSynthetic f64 CIFAR-shaped smokeCI/default
nn_cifar10_f32_tiny_synthSynthetic f32 training smokeCI/default
nn_cifar10_safeSafer real-data configLocal
nn_cifar10_tinyTiny real CIFAR subsetLocal
nn_cifar10Full CIFAR path with checkpointsLocal/high RAM

GPU examples

ExampleBackendCommand
nn_cifar10_cudaCUDA/cuBLAS/cuDNN via VSLVTL_USE_CUDA=1 v -d cuda run vtl/examples/nn_cifar10_cuda/main.v
nn_cifar10_vulkanVulkan f32 Linear/Conv2D/ReLU/Adam via VSLVTL_USE_VULKAN=1 v -prod -d vulkan run vtl/examples/nn_cifar10_vulkan/main.v
nn_cifar10_f32_vulkan_tiny_synthf32 Vulkan-shaped tiny smokeVTL_USE_VULKAN=1 v -prod -d vulkan run vtl/examples/nn_cifar10_f32_vulkan_tiny_synth/main.v
vtl_opencl_vcl_supportOpenCL/VCL support notesSee example README

Datasets and plotting

ExampleWhat it shows
datasets_mnistMNIST loader shape smoke
datasets_imdbIMDB loader shape smoke
vtl_plot_scatter_colorscaleVTL tensor data feeding VSL plot

Safe validation

Prefer scoped commands:

VJOBS=1 v test vtl/nn/f32_training_smoke_test.v
VTL_USE_VULKAN=1 VJOBS=1 v -prod -d vulkan test vtl/nn/f32_vulkan_training_smoke_d_vulkan_test.v

See DEV_LIGHTWEIGHT.md for the full safe command matrix.