Skip to content

Backend Language Mix

The project is moving toward a multi-language backend layout:

  • Rust and Python remain the dominant public API and reference implementation.
  • CUDA owns tensor-distance, reduction, and persistence-image GPU hot paths.
  • Assembly owns CPU feature probes and the smallest distance/reduction kernels.
  • Triton owns optional PyTorch-adjacent GPU kernels.
  • C++ owns a portable native ABI path.

Current Source Inventory

Language / backend Current files Status
Rust crates/topoml-core Active reference backend
Python python/topoml Active ML API, docs, benchmarks
CUDA backends/cuda/*.cu Active optional pairwise-L2 and threshold-edge runtime path
Assembly backends/asm/*.S Active optional CPUID-gated L2-squared dispatch
C++ backends/cpp/*.cpp Active C ABI H0 barcode and distance path
Triton backends/triton/*.py Active optional pairwise-L2 wrapper and CPU schedule-builder API

GitHub language bars are generated by GitHub Linguist. Triton kernels are Python DSL source files, so they may appear as Python in the language bar even when they contain real Triton JIT code.

Gate Before Runtime Selection

Low-level files do not become selected backends just because source exists. A backend becomes selectable only after:

  • correctness equivalence against the safe reference;
  • shape, dtype, and device validation;
  • CPU/GPU feature detection;
  • fallback behavior;
  • benchmark artifacts with raw output.