tensor_compute

Crates.iotensor_compute
lib.rstensor_compute
version0.1.0
sourcesrc
created_at2020-08-19 02:27:59.446818
updated_at2020-08-19 02:27:59.446818
descriptionA Tensor computing library for Rust
homepage
repositoryhttps://github.com/tiberiusferreira/gpu_compute
max_upload_size
id278093
size8,495,144
Tiberio (tiberiusferreira)

documentation

README

Rust Tensor Compute

This is a personal project to teach myself WebGPU computing, focused
on Machine Learning application.

Features for now:

  • Select which GPU to use (if more than 1 in system)
  • Clone
  • (Batch) Matmul
  • Relu
  • Transpose
  • Fill
  • Compare
  • Make Contiguous
  • [-] Slice (Needs more design/work)
  • [-] Index (Needs more design/work)
  • Create Views Tensor

In progress:

Element Wise Tensor - Tensor Ops:

  • Add
  • Sub
  • Mul

Scalar - Tensor Ops:

  • Add
  • Sub
  • Mul

Working Example:

fn main() {
    println!("Running in {:?}", GpuStore::get_default().info());
    let ma = Tensor::from_data_and_shape(vec![1., 2., 3., 4., 5., 6., 7., 8.], vec![2, 2, 2]);
    let mb = Tensor::from_data_and_shape(vec![2., 3., 4., 5.], vec![2, 2]);
    let result = ma.matmul(&mb);
    println!("{:?}", result);
    /*
    Running in AdapterInfo { name: "AMD Radeon Pro 560", vendor: 0, device: 0, device_type: DiscreteGpu, backend: Metal }
    Shape: [2, 2, 2]
    [[[ 10  13 ]
      [ 22  29 ]]

     [[ 34  45 ]
      [ 46  61 ]]]
    */
}

Short-term goals

  • How should indexing and assignment work?
  • Finish public API docs
  • More Tests
Commit count: 48

cargo fmt