mhtirogla
Home
Systems
API
Pricing
About
Log in
← Back
Home
›
Systems
›
AI and ML infrastructure
nnue-training
NNUE training pipeline
Stockfish nnue-pytorch
System
Techniques · 4
Primitives · 27
nnue-training
Alpha-beta search
game-ai · medium: Minimax that skips branches which cannot change the result; with iterative deepening, PVS and aspiration windows it is the core of classical adversarial search.
›
Data loading pipelines
machine-learning · medium: Turn files on disk into shuffled, sharded, resumable GPU batches fast enough that the accelerator never waits.
›
Knowledge distillation
ml-training · medium: Train a small student to match a large teacher's softened outputs (plus the hard labels) so it keeps most of the teacher's accuracy at a fraction of the cost.
›
Sequential probability ratio test
statistics · medium: Add up the log-likelihood ratio per observation and stop when it crosses a fixed bound; the least data of any test with the same error rates (for two point hypotheses).
›
Loss functions
machine-learning · low: The scalar a model minimizes: cross-entropy for classes and tokens, MSE or Huber for values, each with a stable form and simple gradient.
›
Compact state encoding
data-structures · low: Pack a game position into a few fixed bytes (24 for chess: occupancy bitboard plus nibbles) for training data and dedupe
Bitboards
game-ai · low: One 64-bit word per set of up to 64 items, so set algebra becomes shifts, ANDs and table lookups; magic bitboards give ray queries in one multiply.
›
NNUE incremental evaluation
game-ai · low: Efficiently updatable neural network: a huge sparse first layer whose output (the accumulator) is patched per move, then tiny int8 layers; fast neural eval.
›
Elo rating
game-networking · low: One number per competitor, moved by K × (actual − expected score) after each pairwise result; expected score is logistic in the rating difference.
›
SIMD programming
hardware-os · low: Process 4-16 lanes per instruction with AVX2, AVX-512 or NEON via Rust std::arch, with runtime dispatch and a portable fallback.
›
AdamW
ml-training · low: Adam's per-parameter adaptive steps with weight decay applied directly to the weights; the default optimizer for transformers and LLM pretraining.
›
Learning-rate warmup and cosine dec…
ml-training · low: Ramp the learning rate up linearly for the first ~1% of steps, then decay it along a half cosine to ~10% of peak.
›
Quantization aware training
ml-training · low: Fake-quantize weights/activations in training with straight-through gradients so int8/int4 models keep accuracy
Weight quantization
ml-training · low: Store weights as 8/4-bit integers with per-group scales; decode is memory-bound, so 4-bit weights give about 3-4x tokens/s and fit 4x larger models.
›
Sparse matrices (CSR)
numerics · low: Compressed sparse row stores only nonzeros as row pointers, column indices and values; SpMV streams them once, so it is memory-bandwidth bound.
›
Candidate ordering and pruning
game-ai · low: The heuristics that make alpha-beta and branch-and-bound fast: try likely-best candidates first (TT, captures, killers, history) and skip or reduce the rest (null move, LMR, futility).
›
Search time management
game-ai · low: Allocate thinking time per move from clock, increment and search instability
Transposition table
game-ai · low: A fixed-size, lossy hash table of search results keyed by a state hash; gives ordering and cutoffs for repeated states, shared lock-free between threads.
›
Zobrist hashing
game-ai · low: A state's hash is the XOR of one random 64-bit key per (item, slot) fact that holds in it, updated in a few XORs per change.
›
Object storage
cloud · low: S3-compatible blob storage at cents per GB-month with 11 nines durability; pick by egress price, request price and latency, not by storage price alone.
›
+ 11 more primitives
System
Techniques · 4
Primitives · 27
nnue-training
Alpha-beta search
game-ai · medium: Minimax that skips branches which cannot change the result; with iterative deepening, PVS and aspiration windows it is the core of classical adversarial search.
›
Data loading pipelines
machine-learning · medium: Turn files on disk into shuffled, sharded, resumable GPU batches fast enough that the accelerator never waits.
›
Knowledge distillation
ml-training · medium: Train a small student to match a large teacher's softened outputs (plus the hard labels) so it keeps most of the teacher's accuracy at a fraction of the cost.
›
Sequential probability ratio test
statistics · medium: Add up the log-likelihood ratio per observation and stop when it crosses a fixed bound; the least data of any test with the same error rates (for two point hypotheses).
›
Loss functions
machine-learning · low: The scalar a model minimizes: cross-entropy for classes and tokens, MSE or Huber for values, each with a stable form and simple gradient.
›
Compact state encoding
data-structures · low: Pack a game position into a few fixed bytes (24 for chess: occupancy bitboard plus nibbles) for training data and dedupe
Bitboards
game-ai · low: One 64-bit word per set of up to 64 items, so set algebra becomes shifts, ANDs and table lookups; magic bitboards give ray queries in one multiply.
›
NNUE incremental evaluation
game-ai · low: Efficiently updatable neural network: a huge sparse first layer whose output (the accumulator) is patched per move, then tiny int8 layers; fast neural eval.
›
Elo rating
game-networking · low: One number per competitor, moved by K × (actual − expected score) after each pairwise result; expected score is logistic in the rating difference.
›
SIMD programming
hardware-os · low: Process 4-16 lanes per instruction with AVX2, AVX-512 or NEON via Rust std::arch, with runtime dispatch and a portable fallback.
›
AdamW
ml-training · low: Adam's per-parameter adaptive steps with weight decay applied directly to the weights; the default optimizer for transformers and LLM pretraining.
›
Learning-rate warmup and cosine dec…
ml-training · low: Ramp the learning rate up linearly for the first ~1% of steps, then decay it along a half cosine to ~10% of peak.
›
Quantization aware training
ml-training · low: Fake-quantize weights/activations in training with straight-through gradients so int8/int4 models keep accuracy
Weight quantization
ml-training · low: Store weights as 8/4-bit integers with per-group scales; decode is memory-bound, so 4-bit weights give about 3-4x tokens/s and fit 4x larger models.
›
Sparse matrices (CSR)
numerics · low: Compressed sparse row stores only nonzeros as row pointers, column indices and values; SpMV streams them once, so it is memory-bandwidth bound.
›
Candidate ordering and pruning
game-ai · low: The heuristics that make alpha-beta and branch-and-bound fast: try likely-best candidates first (TT, captures, killers, history) and skip or reduce the rest (null move, LMR, futility).
›
Search time management
game-ai · low: Allocate thinking time per move from clock, increment and search instability
Transposition table
game-ai · low: A fixed-size, lossy hash table of search results keyed by a state hash; gives ordering and cutoffs for repeated states, shared lock-free between threads.
›
Zobrist hashing
game-ai · low: A state's hash is the XOR of one random 64-bit key per (item, slot) fact that holds in it, updated in a few XORs per change.
›
Object storage
cloud · low: S3-compatible blob storage at cents per GB-month with 11 nines durability; pick by egress price, request price and latency, not by storage price alone.
›
mmap and the page cache
hardware-os · low: How read() and mmap reach file data through the kernel page cache, what readahead and madvise do, and why databases use their own buffer pool instead.
›
Sequence packing
ml-training · low: Packing variable-length sequences into fixed-size batches with attention masks to avoid padding waste
PRNGs (PCG, xoshiro)
numerics · low: Small, fast, statistically strong non-cryptographic generators: PCG32 and xoshiro256**, with seeding, parallel streams and unbiased ranges.
›
Data augmentation
machine-learning · low: Generate label-preserving variants of each training example on the fly to enlarge the effective dataset and bake in invariances.
›
Token sampling
ml-training · low: Turn a vector of scores into one chosen item with temperature, top-k, top-p, min-p, repetition penalties and a seed.
›
Loglikelihood scoring
machine-learning · low: Scoring choices by summed token log-probabilities, normalization by length, perplexity computation
Bayesian rate estimation
statistics · low: Estimate a conversion or event rate from few observations with a Beta-Binomial or Gamma-Poisson update: two counters, an honest interval, and P(B beats A) directly.
›
Memory ordering
concurrency · low: What Relaxed, Acquire, Release and SeqCst atomics actually guarantee, what they cost on x86 and ARM, and which one each pattern needs.
›
Virtual memory and the TLB
hardware-os · low: How page tables and TLBs translate every address, what TLB reach means, and when 2 MiB or 1 GiB huge pages pay off on Linux.
›
Low precision number formats
numerics · low: Bf16, fp16, fp8 (E4M3, E5M2), MX block formats and int4: ranges, rounding, scaling
LU and Cholesky factorization
numerics · low: Factor A = PLU (any square matrix, partial pivoting) or A = LLᵀ (SPD) once in O(n³), then solve each right-hand side in O(n²).
›
Copy for AI
Similar systems
Share the most building blocks with this one.
self-play-training
26 %
chess-engine
22 %
model-compression
18 %