Skip to content

Commit

Permalink
feat/nn: add all cudnn available operations to collenchyma-nn
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHirn authored and hobofan committed Dec 21, 2015
1 parent 19a313b commit 0338476
Show file tree
Hide file tree
Showing 18 changed files with 2,374 additions and 583 deletions.
9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "collenchyma-nn"
description = "Collenchyma plugin for full Neural Network algorithm support"
version = "0.0.1"
authors = ["MichaelHirn <michael.hirn@storeness.de>",
authors = ["Michael Hirn <mj@autumnai.com>",
"Maximilian Goisser <max@autumnai.com>"]

repository = "https://github.com/autumnai/collenchyma-nn"
Expand All @@ -14,9 +14,10 @@ keywords = ["neural-network", "collenchyma", "computation", "hpc", "plugi
license = "MIT"

[dependencies]
collenchyma = { git = "https://github.com/autumnai/collenchyma.git", rev = "fdd030d", default-features = false }
# cudnn = "0.1.3"
cudnn = { git = "https://github.com/autumnai/rust-cudnn.git", rev = "6436d44", optional = true }
# collenchyma = { git = "https://github.com/autumnai/collenchyma.git", rev = "fdd030d", default-features = false }
collenchyma = { path = "/home/hobofan/collenchyma", default-features = false }
# cudnn = { version = "1.0.0", optional = true }
cudnn = { path = "/home/hobofan/rust-cudnn/cudnn", optional = true }
libc = "0.2"
lazy_static = "0.1"

Expand Down
56 changes: 54 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,72 @@ For more information,
[leaf]: https://github.com/autumnai/leaf
[twitter-autumn]: https://twitter.com/autumn_eng

## Provided Operations

This Plugins provides the following operations to the Collenchyma Backend.
Every Operation includes forward + backward. A `-` means not yet implemented.
More information can be found in the [Documentation][docs-ops].

| Operation | CUDA | OpenCL | Native |
|--- |--- |--- |--- |
| Sigmoid | cuDNN v3 | - | - |
| ReLU | cuDNN v3 | - | - |
| Tanh | cudNN v3 | - | - |
| | | | |
| Normalization (LRN) | cudNN v3 | - | - |
| | | | |
| Convolution | cudNN v3 | - | - |
| | | | |
| Softmax | cudNN v3 | - | - |
| | | | |
| Pooling Max | cudNN v3 | - | - |
| Pooling Avg | cudNN v3 | - | - |

[docs-ops]: http://autumnai.github.io/collenchyma-nn/collenchyma_nn/trait.NN.html

## Getting Started

If you're using Cargo, just add collenchyma-NN to your Cargo.toml:

[dependencies]
collenchyma = "0.0.5"
collenchyma-nn = "0.0.1"
collenchyma = "0.0.6"
collenchyma-nn = "0.1.0"

If you're using [Cargo Edit][cargo-edit], you can call:

$ cargo add collenchyma-nn

[cargo-edit]: https://github.com/killercup/cargo-edit

## Usage

Bring the Plugin trait and the other important Collenchyma traits/structs in scope and
you will be able to execute the here provided operations on your Collenchyma Backend.

```rust
extern crate collenchyma as co;
extern crate collenchyma_nn as nn;
use co::backend::{Backend, BackendConfig};
use co::framework::IFramework;
use co::frameworks::Cuda;
use co::tensor::SharedTensor;
use nn::*;
fn main() {
// Initialize a CUDA Backend.
// Usually you would not use CUDA but let it pick what is available on the machine.
let framework = Cuda::new();
let hardwares = framework.hardwares();
let backend_config = BackendConfig::new(framework, hardwares);
let backend = Backend::new(backend_config).unwrap();
// Initialize two SharedTensors.
// Usually you would want also fill them with data.
let mut x = SharedTensor::<f32>::new(backend.device(), &(1, 1, 3)).unwrap();
let mut result = SharedTensor::<f32>::new(backend.device(), &(1, 1, 3)).unwrap();
// Use the operation provided by this Plugin.
backend.sigmoid(&mut x, &mut result);
}
```

## Contributing

Want to contribute? Awesome! We have
Expand Down
13 changes: 0 additions & 13 deletions src/binary.rs

This file was deleted.

126 changes: 0 additions & 126 deletions src/frameworks/cuda.rs

This file was deleted.

Loading

0 comments on commit 0338476

Please sign in to comment.