Skip to content

Version 1.0.0

Latest

Choose a tag to compare

@hfp hfp released this 25 Jun 14:06
2132ebb

Library of specialized algebra and performance primitives

LIBXS provides building blocks for memory operations, numerics, synchronization, and prediction - with a focus on performance and minimal dependencies; requires only a C89 compiler. Originally developed as part of LIBXSMM but refocused. LIBXS is also leveraged by LIBXSTREAM. This is the first formal release.

Documentation

Core Modules

  • GEMM - batched dense GEMM (strided, pointer-array, grouped) with JIT dispatch, warmup control, and configurable backends including LIBXSMM kernels.

  • SYRK - symmetric rank-k/2k update with blocked double-dispatch, JIT+BLAS backend selection, and task parallelism.

  • Predict - fingerprint-guided parameter prediction with model persistence (binary format). Supports temporal extrapolation, differential prediction, hkNN partitioning, smoothing, confidence scoring, and in-place LOO compression.

  • Malloc - pool-based allocator achieving steady-state operation without system calls. Eviction policies, histogram diagnostics, and per-pool metadata tracking.

  • Registry - thread-safe key-value store with per-thread caching for low-contention dispatch lookups.

  • Memory - byte comparison, matrix copy/transpose, alignment queries with ISA-optimized paths.

  • String - edit distance, substring search, word similarity (strisimilar), and formatting utilities.

  • Timer - high-resolution timing via calibrated TSC with cross-platform fallback.

  • CPUID - CPU feature detection from SSE through AVX-512, AArch64, and RISC-V.

  • Sync - portable atomics, spin locks, TLS, and file locking.

  • Hashing - CRC32-based hashing, Adler-32, and string hash functions.

  • Histogram - thread-safe histogram with running statistics.

  • Permutation - co-prime shuffling, smooth row permutations, and stratification.

  • Math - matrix comparison, GCD/LCM, coprime generation, BF16 conversion.

  • RNG - thread-safe pseudo-random number generation (SplitMix64).

  • MHD - read/write MetaImage (MHD/MHA) files.

Samples

  • ozaki - Ozaki-scheme low-precision GEMM with intercepted BLAS (mantissa slicing, CRT, complex support, trim control).
  • gemm - batched DGEMM benchmarks (strided, pointer-array, grouped) with OpenMP.
  • syrk - symmetric rank-k/2k update with validation.
  • predict - train a prediction model from CSV, or incrementally, save/load models, and predict.
  • setdiff - deterministic set-difference tolerance experiments.
  • shuffle - shuffling strategies comparison (co-prime vs. Fisher-Yates).
  • fprint - fingerprint experiments for structure and geometry.
  • stratify - space-filling 3D-to-2D stratification for dense volumes.
  • rosetta - hierarchical type discovery on opaque binary data.
  • scratch - pool allocator vs. system malloc benchmarks.
  • memory - benchmarks for comparison, matrix copy, and transpose.
  • registry - registry dispatch microbenchmark.
  • sync - lock implementation microbenchmarks.

Build and Packaging

  • GNU Make and CMake - both build systems fully supported; header-only mode (-DLIBXS_SOURCE or include libxs_source.h), static/shared library, out-of-tree builds.
  • Fortran interface - module with bindings for memory, prediction, GEMM, and more; compatible with fpm (Fortran Package Manager).
  • pkg-config - generated .pc file for downstream discovery.
  • RPM/Debian packaging - SPEC file and Copr integration; installs cleanly into standard prefixes.
  • Runtime ISA dispatch - compiled for SSE4.2 portability by default, dispatches to AVX2/AVX-512 at runtime. Use SSE=0 for native compilation.

Requirements

  • No external dependencies at link-time
  • C89 compiler (GCC, Clang, ICX)