Skip to content

A set of GPU-accelerated machine learning algorithms and functions written from scratch in Rust and CUDA C++

Notifications You must be signed in to change notification settings

arjunr00/ml-rust-cuda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPU-Accelerated Machine Learning with Rust and CUDA C++ [WIP]

I took a class on Machine Learning this past quarter at college, and figured the best way to supplement and strengthen my understanding of the underlying mathematics and algorithms of the field (or at least the subset thereof which we learned) would be to implement them myself. I've been enjoying using Rust (I made a raytracer), hence the language choice. I'm also considering this project to be my way of simultaneously learning CUDA programming (for GPU acceleration on my NVIDIA card) and foreign function interfaces in Rust (since CUDA code is written in C/C++).

My aim is to use as few dependencies as is reasonable, so that I can focus on implementing the mathematics and ML stuff by myself.

Current Functionality

  • Efficient matrix and vector operations using CUDA kernels. This includes:
    • Matrix addition; subtraction; scalar, matrix, and vector multiplication; and transpose.
    • Vector addition, subtraction, scalar multiplication, and dot product.

Known Bugs

(Bugs marked with [*] are considered high priority.)

  • [*] There appears to be race conditions which cause math::linear::vector::tests::test_dot_smaller_vecs and learning::instance::tests::test_normalize_instance to fail inconsistently.

Dependencies

Usage

Rustdocs for this library are available here.

If you want to build from source, first, of course, clone the repository.

$ git clone https://github.com/arjunr00/ml-rust-cuda.git
$ cd ml-rust-cuda

To build, simply type:

$ cargo build

To run the built-in unit and documentation tests, type:

$ cargo test -- --test-threads=1

Implementation Details

[TODO]

About

A set of GPU-accelerated machine learning algorithms and functions written from scratch in Rust and CUDA C++

Topics

Resources

Stars

Watchers

Forks