ffsvm helps you with training a SVM using libSVM, now you want the highest possible performance during (real-time)...

libSVM, now you want the highest possible performance during (real-time) classification, like games or VR

In One Sentence

You trained a SVM using libSVM, now you want the highest possible performance during (real-time) classification, like games or VR.

Highlights

  • loads almost all libSVM types (C-SVC, ν-SVC, ε-SVR, ν-SVR) and kernels (linear, poly, RBF and sigmoid)
  • produces practically same classification results as libSVM
  • optimized for SIMD and can be mixed seamlessly with Rayon
  • written in 100% Rust
  • allocation-free during classification for dense SVMs
  • 2.5x - 14x faster than libSVM for dense SVMs
  • extremely low classification times for small models (e.g., 128 SV, 16 dense attributes, linear ~ 500ns)
  • successfully used in Unity and VR projects (Windows & Android)

Note: Currently requires Rust nightly (March 2019 and later), because we depend on RFC 2366 (portable SIMD). Once that stabilizes we'll also go stable.

Usage

Train with libSVM (e.g., using the tool svm-train), then classify with ffsvm-rust.

From Rust:

Status

  • June 7, 2019: Gave up on 'no unsafe', but gained runtime SIMD selection.
  • March 10, 2019: As soon as we can move away from nightly we'll go beta.
  • Aug 5, 2018: Still in alpha, but finally on crates.io.
  • May 27, 2018: We're in alpha. Successfully used internally on Windows, Mac, Android and Linux on various machines and devices. Once SIMD stabilizes and we can cross-compile to WASM we'll move to beta.
  • December 16, 2017: We're in pre-alpha. It will probably not even work on your machine.

Performance

Classification time vs. libSVM for dense models.

Performance milestones during development.

All performance numbers reported for the DenseSVM. We also have support for SparseSVMs, which are slower for "mostly dense" models, and faster for "mostly sparse" models (and generally on the performance level of libSVM).

See here for details.

Tips

  • For an x-fold performance increase, create a number of Problem structures, and process them with Rayon's par_iter.

FAQ

See here for details.

Issues

Collection of the latest Issues

ralfbiedert

ralfbiedert

0

Various notes to self:

  • the crate is not really dead, the cross-platform SIMD situation has just been a bit ... frustrating
  • once something like packed SIMD ever stabilizes I want to move to that
  • I consider classification / regression mostly feature complete
  • IIRC there are one or two rarer kernels not implemented yet, PRs welcome
  • Training is missing too, probably won't implement it myself as I don't really need it, PRs also welcome #2
  • runtime SIMD selection should probably be removed again (came to generally prefer unsafe free over a few percent more performance)
  • once safe transmutes are a thing simd_aligned dependency should be removed
  • if meanwhile anyone feels repelled by fact last commit is 2+ years old and / or project would not compile in specific constellation I'm also happy to accept PRs and / or add co-maintainers
ralfbiedert

ralfbiedert

2

Blocked by

  • Need high-performance matrix library that abstracts away sparse and dense (SIMD) matrices.
  • In turn blocked by num-traits abstraction to handle scalar and packed types / math transparently.

Information - Updated May 25, 2022

Stars: 48
Forks: 6
Issues: 2

Linfa unlocks verified machine learning algorithms in Rust

Supports ML & data processing algorithms such as logistic regression, linear regression, vector machines, normalization & vectorization

Linfa unlocks verified machine learning algorithms in Rust

HAL : Hyper Adaptive Learning

Rust based Cross-GPU Machine Learning

HAL : Hyper Adaptive Learning

Rustml is a library for doing machine learning in Rust

The documentation of the project with a descprition of the modules can be found

Rustml is a library for doing machine learning in Rust

A machine learning library for Rust

To use autograph in your crate, add it as a dependency in Cargo

A machine learning library for Rust

A CHIP-8 virtual machine written in Rust

Install Rust using the How to write an emulator (CHIP-8 interpreter)

A CHIP-8 virtual machine written in Rust

The Rust Machine Learning Book

This repository contains the source of ""

The Rust Machine Learning Book

My first attempt at machine learning in rust

This library currently only offers very basic KNN

My first attempt at machine learning in rust

rust-machine-learning-api-example

Example of Rust API for Machine Learning

rust-machine-learning-api-example

MachineID for Rust - Like

This Rust package is inspired by

MachineID for Rust - Like

R2VM is the Rust for RISC-V Virtual Machine

R2VM is a full-system, multi-core, cycle-level simulator, with binary translation to provide high performance

R2VM is the Rust for RISC-V Virtual Machine
Facebook Instagram Twitter GitHub Dribbble
Privacy