Giter VIP home page Giter VIP logo

juice's Introduction

Juice

This is the workspace project for

Please consult the individual README.md files for more information.

Juice Examples

CLI for running juice examples. More examples and benchmark tests can be found at the juice examples directory.

Install CLI

DISCLAIMER: Currently both CUDA and cuDNN are required for the examples to build.

Compile and call the build.

# install rust, if you need to
curl -sSf https://static.rust-lang.org/rustup.sh | sh
# download the code
git clone [email protected]:spearow/juice.git && cd juice/juice-examples
# build the binary
cargo build --release
# and you should see the CLI help page
../target/release/juice-examples --help
# which means, you can run the examples from the juice-examples README

Dependencies

Cap'n'Proto

capnproto is a data interchange format that is used to store and load networks with weights for Juice.

capnproto and capnproto-libs plus their development packages are the ones needed from your package manager.

Cuda

Getting the cuda libraries up poses to be the first road-block many users face.

To get things working one needs to set the following environment variables:

# examplary paths, unlikely to work for your local setup!
export CUDNN_INCLUDE_DIR=/opt/cuda/include
export CUDNN_LIB_DIR=/opt/cuda/targets/x86_64-linux/lib/
export CUBLAS_INCLUDE_DIR=/opt/cuda/include
export CUBLAS_LIB_DIR=/opt/cuda/targets/x86_64-linux/lib/

depending on your local installation setup.

The currently supported cuda version is cuda-11 (details in #114 and #115 )

Note that you need a capable nvidia device in order to run the cuda backend.

OpenCL

You need the apropriate loader and device libraries. Since the OpenCL backend is still WIP, this will be detailed at a later point of time.

BLAS

Blas is a linear algebra used by the native backend.

openblas or blas is required to be present. Choose explicitly via BLAS_VARIANT.

By default an attempt is made to resolve the library via pkg-config.

Overriding via

# examplary paths, unlikely to work for your local setup!
export BLAS_LIB_DIR=/opt/blas/lib64/
export BLAS_INCLUDE_DIR=/opt/blas/include/

is also supported.

Linkage for the blas library variant is determined by setting BLAS_STATIC to 1 or unsetting BLAS_STATIC.

ArchLinux users

ArchLinux openblas package doesn't include LAPACK symbols (see FS#66092), so if you try to use it, you'll get multiple cblas_* unresolved symbols.

Replace openblas with AUR's openblas-lapack package to fix.

juice's People

Contributors

alexandermorozov avatar andreytkachenko avatar bluss avatar bovee avatar dependabot[bot] avatar diamondlovesyou avatar drahnr avatar ehiggs avatar hobofan avatar homu avatar hweom avatar johnnyman727 avatar keshan avatar killercup avatar kschmit90 avatar lissahyacinth avatar martin1887 avatar michaelhirn avatar mikkyang avatar neutron3529 avatar opfromthestart avatar paulkass avatar pheki avatar raineszm avatar reem avatar skade avatar subversive-owl avatar vm avatar wehlutyk avatar y-ich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

juice's Issues

When compiling on a computer without OpenCL or CUDA

Compiling voos v0.1.0 (/media/xycadmin/diskabc/Project/voos) warning: unused imports: layer::, layers::, solvers::, util:: --> src/main.rs:4:13 | 4 | use juice::{layer::, layers::, solvers::, util::}; | ^^ | = note: #[warn(unused_imports)] on by default

warning: unused variable: model --> src/main.rs:9:9 | 9 | let model = model::build_model();
| ^^^^^ help: consider prefixing with an underscore: _model | = note: #[warn(unused_variables)] on by default

error: linking with cc failed: exit code: 1 | = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/xycadmin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/voos-f4e90e209df7583f.voos.92vn4zaj-cgu.0.rcgu.o" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/voos-f4e90e209df7583f.voos.92vn4zaj-cgu.1.rcgu.o" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/voos-f4e90e209df7583f.voos.92vn4zaj-cgu.10.rcgu.o" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/voos-f4e90e209df7583f.voos.92vn4zaj-cgu.11.rcgu.o" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/voos-f4e90e209df7583f.voos.92vn4zaj-cgu.12.rcgu.o" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/voos-f4e90e209df7583f.voos.92vn4zaj-cgu.2.rcgu.o" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/voos-f4e90e209df7583f.voos.92vn4zaj-cgu.3.rcgu.o" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/voos-f4e90e209df7583f.voos.92vn4zaj-cgu.4.rcgu.o" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/voos-f4e90e209df7583f.voos.92vn4zaj-cgu.5.rcgu.o" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/voos-f4e90e209df7583f.voos.92vn4zaj-cgu.6.rcgu.o" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/voos-f4e90e209df7583f.voos.92vn4zaj-cgu.7.rcgu.o" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/voos-f4e90e209df7583f.voos.92vn4zaj-cgu.8.rcgu.o" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/voos-f4e90e209df7583f.voos.92vn4zaj-cgu.9.rcgu.o" "-o" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/voos-f4e90e209df7583f" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/voos-f4e90e209df7583f.dj4ozcy384fdfgt.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps" "-L" "/home/xycadmin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libjuice-64afd03e70b930bf.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libcoaster_nn-1d06ce52b164c63c.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libcoaster_blas-a41b66bed2c14dfb.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/librblas-bfeac5ba49c7d067.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libcapnp-e12e77674c336dd8.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libbyteorder-645a09eaac5177bf.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/librand-b972e44e99b24a95.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/liblog-b8a6569b2cb32929.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/liblog-f32e466f3531efd8.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libcfg_if-30234d727e1c9926.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libtimeit-8de062920c89d62b.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libtime-ec0c43e8424ded3b.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libcoaster-1a73677275b811a3.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libbyteorder-0ab8f8a09a4c9083.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libnum-d6d5f9d7ddbf0e8c.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libnum_rational-75775293f092d37d.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libnum_bigint-4b6c996d9c0b3958.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/librand-ab2ac63812f0d654.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libnum_complex-3d95dc83c79c0334.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/librustc_serialize-1617da7fad4a0249.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libnum_iter-7545f819f15e5985.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libnum_integer-7a697fc09ea8623c.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/liblazy_static-4327a7497a688cb5.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libenum_primitive-b361dc3c2ffc70dc.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libnum_traits-b1c44d769a6207cf.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libnum_traits-3ec98931948bd7b4.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/libbitflags-d4c6e9f9395ab6b7.rlib" "/media/xycadmin/\xe6\x9c\xac\xe5\x9c\xb0\xe7\xa3\x81\xe7\x9b\x98/Project/voos/target/release/deps/liblibc-edc018c43ab1a7ff.rlib" "-Wl,--start-group" "/home/xycadmin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-9895e8982b0a79e7.rlib" "/home/xycadmin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-57306b8ed3378a0e.rlib" "/home/xycadmin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-54463ae5adae3649.rlib" "/home/xycadmin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-d99667b199a9875a.rlib" "/home/xycadmin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-51f4300e102199f5.rlib" "/home/xycadmin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-b3ccf1f7737a6a91.rlib" "/home/xycadmin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-157c37a3ceb78853.rlib" "/home/xycadmin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-505bcee45aafb736.rlib" "/home/xycadmin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-c29abd529ba4452b.rlib" "/home/xycadmin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-895383a3232f6572.rlib" "/home/xycadmin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-5594cb4f559bc761.rlib" "-Wl,--end-group" "/home/xycadmin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-38e90baf978bc428.rlib" "-Wl,-Bdynamic" "-lblas" "-lOpenCL" "-lOpenCL" "-lcuda" "-lutil" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil" = note: /usr/bin/ld: couldn't find -lblas /usr/bin/ld: couldn't find -lOpenCL /usr/bin/ld: couldn't find -lOpenCL /usr/bin/ld: couldn't find -lcuda collect2: error: ld returned 1 exit status

error: aborting due to previous error

error: Could not compile voos.

To learn more, run the command again with --verbose.

Juice v0.2.2 doesn't work on Windows

Error Description

v0.2.2 from crates.io doesn't work on Windows, due to a colon in a file path:

error logs, as verbose as possible
describe which command you ran
cargo run --verbose
Updating registry https://github.com/rust-lang/crates.io-index
error: unable to get packages from source

Caused by:
failed to unpack package juice v0.2.2

Caused by:
failed to create C:\Users\person\.cargo\registry\src\github.com-1ecc6299db9ec823\juice-0.2.2\doc\book\http:\autumnai.github.io\leaf\leaf

Caused by:
The filename, directory name, or volume label syntax is incorrect. (os error 123)

What should have happend

The colon after the http above is what causes the problem. And I can't use the github master version because it fails when compiling coaster, so there is no way to use juice on Windows.

Implement LSTM layer

This is a 4 step task:

  • expand the cudnn bindings in rcudnn
  • use the rcudnn bindings in coaster-nn
  • create a apropriate interface in coaster
  • use that interface to define a layer in juice
  • implement tests

[CI] cache artifacts better / increase efficiency

currently everything is recompiled + fetched from remote which is not necessary

Proposed layers

Will it work to provide layers such as TSNE and SVM's? Like attaching TSNE in the beginning of a model and a SVM on softmax?
It will will probably first require training the TSNE first then the network and then only the SVM...

cuda blas tests fail

# nvidia-smi -L
GPU 0: GeForce GTX 1050 Ti (UUID: GPU-2df526e1-845f-4e39-77d7-fc2f8ce4e459)

yields a few other test errors

# RUST_BACKTRACE=full cargo t -- --test-threads=1
test cuda_f32::it_computes_correct_dot ... FAILED
test cuda_f32::it_computes_correct_gemm ... FAILED
test cuda_f32::it_computes_correct_nrm2 ... error: test failed, to rerun pass '-p coaster-blas --test blas_specs'

Caused by:
  process didn't exit successfully: `/tmp/juice/target/debug/deps/blas_specs-6f352c52b7827de8 --test-threads=1` (signal: 11, SIGSEGV: invalid memory reference)

implement custom "Prototype" layer type

i.e., something that should allow a user to pass a closure taking a Vec<_> as input, returning something like a LayerType::Custom that satisfies the LayerConfig requirements.

Clean up warnings

The crate issues quite a few warnings. Some of the unneeded identifiers could be intentional for later implementation, but at the moment it creates a lot of compiler output to sift through. Removing the warnings would also ensure the codebase is readable for humans and compilers the same way.

Juice fails to build with Native on Mac

Error Description

describe which command you ran

Using compiled version of Juice (Commit 4dbf539 (21-Aug-17)) with

cargo build --features=native --no-default-features
Built successfully.

Attempted to build a default test Rust program using Juice as a dependency in the TOML, with
juice = {path = "../../BitBucket/juice/"}
Which directs to the BitBucket version of Juice.

This seems related to openblas vs blas, as mentioned in Environment/Native Related Issues.

Program is:

extern crate juice;

fn main() {
	println!("hello world");
}

TOML is:

(...)
[dependencies]
nn = "0.1.6"
coaster = "0.1.0"
coaster-nn = "0.4.0"
juice = {path =  "../../BitBucket/juice/"}

[features]
default = ["native"]
native  = ["juice/native"]

What should have happened

Successful build, with warning of unused crate.

What happened

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-m64" "-L" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/deep_learning-2179b3ff6a25a3b2.0.o" "-o" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/deep_learning-2179b3ff6a25a3b2" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps" "-L" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libjuice-76a0d0d4778ee247.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libcoaster_blas-e48d12b535504280.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libcapnp-cea9b1e207536b0f.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libbyteorder-4b33a51270316e1c.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libcoaster_nn-34b634248642aaf2.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libtimeit-88ca41b63903fa24.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libtime-b42059b58d782f84.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/liblog-653d9a3a0b7e9d0b.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libcoaster-84e7e6b8b2bcc1c3.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libbyteorder-7ac464879d42bb20.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libenum_primitive-8a3da1a6ee21c137.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libbitflags-e23c19204c484d23.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/liblazy_static-35b44458f059304c.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/librblas-b3994b8d1991b435.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libnum-9324c52ca75791ea.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libnum_rational-139c9a80f9301bf4.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libnum_bigint-8814a701f9d040e1.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/librand-0668ab5ce5d1cfb3.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libnum_complex-97d44be024c0a5d9.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/librustc_serialize-a7771718d4ee73a5.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libnum_iter-3ba3b370d4563109.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libnum_integer-82c2fec7ed3ae431.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libnum_traits-b6a66e4d76196aca.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/liblibc-750342d372c7156a.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-438eba4cd7d88a45.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-00160610bfa2c7b4.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-88eece318c5ccb15.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librand-646fe8114e6965a2.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcollections-7d6da376f6405c93.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-ab03bba0be78edaa.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3d46a711e5badb84.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-31c7158cd96c571c.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_unicode-a732f07ce6fa7392.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-ee2a935baf6741f5.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-53f5ee584666574a.rlib" "-l" "openblas" "-l" "System" "-l" "resolv" "-l" "pthread" "-l" "c" "-l" "m"
  = note: ld: library not found for -lopenblas
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

Also tried using the default version of Juice with juice = { version = "0.2.2", default-features = false } in the TOML, which results in a separate failure to build with a warning about the CUDA library, as follows:

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-m64" "-L" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/deep_learning-2179b3ff6a25a3b2.0.o" "-o" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/deep_learning-2179b3ff6a25a3b2" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps" "-L" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libjuice-1bc8b54a3308a0b6.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libcoaster_blas-f0128de324e54c02.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libcapnp-cea9b1e207536b0f.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libbyteorder-4b33a51270316e1c.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libcoaster_nn-03d5f8a863bd35c1.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libtimeit-88ca41b63903fa24.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libtime-b42059b58d782f84.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/liblog-653d9a3a0b7e9d0b.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libcoaster-fbdf93f1b7e0c6c1.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libbyteorder-7ac464879d42bb20.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libenum_primitive-8a3da1a6ee21c137.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libbitflags-e23c19204c484d23.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/liblazy_static-35b44458f059304c.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/librblas-55b5430647968442.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libnum-9324c52ca75791ea.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libnum_rational-139c9a80f9301bf4.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libnum_bigint-8814a701f9d040e1.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/librand-0668ab5ce5d1cfb3.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libnum_complex-97d44be024c0a5d9.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/librustc_serialize-a7771718d4ee73a5.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libnum_iter-3ba3b370d4563109.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libnum_integer-82c2fec7ed3ae431.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/libnum_traits-b6a66e4d76196aca.rlib" "/Users/lissa.hyacinth/Rust/DeepLearning/target/debug/deps/liblibc-750342d372c7156a.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-438eba4cd7d88a45.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-00160610bfa2c7b4.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-88eece318c5ccb15.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librand-646fe8114e6965a2.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcollections-7d6da376f6405c93.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-ab03bba0be78edaa.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3d46a711e5badb84.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-31c7158cd96c571c.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_unicode-a732f07ce6fa7392.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-ee2a935baf6741f5.rlib" "/Users/lissa.hyacinth/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-53f5ee584666574a.rlib" "-framework" "OpenCL" "-l" "cuda" "-l" "blas" "-l" "System" "-l" "resolv" "-l" "pthread" "-l" "c" "-l" "m"
  = note: ld: library not found for -lcuda
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

CUDA is not installed, as local machine only supports native and openCL, so the error is expected, but Native should force use of native packages and not use the cuda library.

Describe in which context it happened

custom app, demo compilation, test run

Test run.

Environment

OS:

uname -a
Darwin C02T5172GVC8.local 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64

Mac OS Sierra 10.12.5

Native related issues:

pkg-config --libs --cflags blas

Package blas was not found in the pkg-config search path.
Perhaps you should add the directory containing `blas.pc'
to the PKG_CONFIG_PATH environment variable
No package 'blas' found

This seems related to the issue - I've already run
export PKG_CONFIG_PATH=/usr/local/opt/openblas/lib/pkgconfig
But openblas only has openblas.pc at that location, and won't have blas.pc.

And using openblas in the command returns:
pkg-config --libs --cflags openblas
-I/usr/local/Cellar/openblas/0.2.20/include -L/usr/local/Cellar/openblas/0.2.20/lib -lopenblas

OpenCL related issues:

clinfo
clinfo.txt

change name

to something that does not collide with the existing crates

Improve CI

Currently execution is only done on native, but this shall not limit test compilation for cudnn.

cargo b --tests

for all feature sets

should suffice to catch most if not all issues with compilation.

Runtime errors are hard to catch, since native execution with running GPUs is hard to achieve with concourse, and there is nothing else out there that one can host yourself with the same feature set.

create a concat layer

concatenation is a essential step in many architectures today, and juice is missing out on those

projet

you guys wrote projet instead of project

:D

RNN LSTM support

Hello,

I am wondering if juice supports LSTM RNN. If not I could try to contribute and make that layer available.

Native feature parity items

I'm curious what the current list of items needed to catch native up to the current feature set is, across all the repositories. (My ulterior motive here is not having CUDA-compatible hardware right now.)

This would help provide a reference implementation on vanilla machines that can be used to check against the OpenCL or CUDA implementations in case hardware or framework bugs show up there.

error management

Move to thiserror to simplify a few things around errors in the long run. Also deals with the deprecation of description in favour of fmt::Display and such.

Juice-Examples fail to build past f33408d0

Since f33408d I'm seeing the examples in Juice-Examples start to fail for mnist mlp and mnist conv (buildable version at 95a18b9), and while the linear reshape (https://github.com/spearow/juice/blob/master/juice/src/layers/common/linear.rs#L105-L113) explicitly checks for whether bias exists, the output method does not (https://github.com/spearow/juice/blob/master/juice/src/layers/common/linear.rs#L136-L143)

Possible Resolutions

Command

ENV Variables; RUST_BACKTRACE=full;CARGO_BLAS=openblas;RUSTFLAGS=-L native=D:\blas\OpenBLAS\build\lib\Release
Command: cargo run --release --verbose mnist linear
Toolchain: Stable

Backtrace

    Running `C:\Users\Lissa\BitBucket\fake-juice\target\release\juice-examples.exe mnist linear`
thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', C:\Users\Lissa\BitBucket\fake-juice\juice\src\layers\common\linear.rs:140:22
stack backtrace:
   0:     0x7ff6a2b03b79 - backtrace::backtrace::trace_unsynchronized
                               at C:\Users\VssAdministrator\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.40\src\backtrace\mod.rs:66
   1:     0x7ff6a2b03b79 - std::sys_common::backtrace::_print_fmt
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libstd\sys_common\backtrace.rs:77
   2:     0x7ff6a2b03b79 - std::sys_common::backtrace::_print::{{impl}}::fmt
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libstd\sys_common\backtrace.rs:61
   3:     0x7ff6a2b1bcab - core::fmt::write
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libcore\fmt\mod.rs:1028
   4:     0x7ff6a2afe604 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libstd\io\mod.rs:1412
   5:     0x7ff6a2b06659 - std::sys_common::backtrace::_print
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libstd\sys_common\backtrace.rs:65
   6:     0x7ff6a2b06659 - std::sys_common::backtrace::print
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libstd\sys_common\backtrace.rs:50
   7:     0x7ff6a2b06659 - std::panicking::default_hook::{{closure}}
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libstd\panicking.rs:188
   8:     0x7ff6a2b062ac - std::panicking::default_hook
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libstd\panicking.rs:205
   9:     0x7ff6a2b06eac - std::panicking::rust_panic_with_hook
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libstd\panicking.rs:464
  10:     0x7ff6a2b06a20 - std::panicking::continue_panic_fmt
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libstd\panicking.rs:373
  11:     0x7ff6a2b06909 - std::panicking::rust_begin_panic
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libstd\panicking.rs:302
  12:     0x7ff6a2b17d9d - core::panicking::panic_fmt
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libcore\panicking.rs:139
  13:     0x7ff6a2b17d6a - core::panicking::panic_bounds_check
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libcore\panicking.rs:96
  14:     0x7ff6a27e9fcf - <juice::layers::common::linear::Linear as juice::layer::ComputeOutput<f32,B>>::compute_output::h8193cf71aa1ea1c0
  15:     0x7ff6a280558e - juice::layer::ILayer::forward::h4eebb769287be565
  16:     0x7ff6a28aebb7 - juice::layer::Layer<B>::forward::hcfc50ebd01596570
  17:     0x7ff6a280e601 - <juice::layers::container::sequential::Sequential<B> as juice::layer::ILayer<B>>::forward::hc64c89566c731a11
  18:     0x7ff6a28aebb7 - juice::layer::Layer<B>::forward::hcfc50ebd01596570
  19:     0x7ff6a28568bf - juice::solver::Solver<SolverB,B>::train_minibatch::he64cec968ff320b3
  20:     0x7ff6a289318b - <futures::task_impl::std::ArcWrapped<T> as futures::task_impl::UnsafeNotify>::clone_raw::he6ca9746d0837675
  21:     0x7ff6a2818cc6 - std::io::Write::write_all::hc7e6f201fae8e2f8
  22:     0x7ff6a2b06867 - std::rt::lang_start_internal::{{closure}}
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libstd\rt.rs:48
  23:     0x7ff6a2b06867 - std::panicking::try::do_call<closure-0,i32>
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libstd\panicking.rs:287
  24:     0x7ff6a2b0b312 - panic_unwind::__rust_maybe_catch_panic
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libpanic_unwind\lib.rs:78
  25:     0x7ff6a2b070d2 - std::panicking::try
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libstd\panicking.rs:265
  26:     0x7ff6a2b070d2 - std::panic::catch_unwind
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libstd\panic.rs:396
  27:     0x7ff6a2b070d2 - std::rt::lang_start_internal
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14\/src\libstd\rt.rs:47
  28:     0x7ff6a289e407 - main
  29:     0x7ff6a32d169c - invoke_main
                               at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  30:     0x7ff6a32d169c - __scrt_common_main_seh
                               at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283
  31:     0x7ffef7327bd4 - BaseThreadInitThunk
  32:     0x7ffef778ced1 - RtlUserThreadStart
error: process didn't exit successfully: `C:\Users\Lissa\BitBucket\fake-juice\target\release\juice-examples.exe mnist linear` (exit code: 101)

Process finished with exit code 101

Migrate away from concourse ci

Error Description

Concourse ci is not a viable tool for CI.

  • btrfs fs corruptions due to sigkill on the btrfs binary.
  • hardware shareing into CI containers is only possible via a hack and exposes too much of the host (i.e. other drives).
  • took down the whole host network, for unknown reasons and saturated the attached network during a worker stall
  • instability issues and random stalls

Note: This does not mean concourse ci is a bad tool, it's architecture is a nice design, but the issues just ruin it for my use case, and they persisted over the last 12 months, despite filing various tickets. So it is time to move on.

What should have happend

Work just fine, do the job. Not drain resources needed for development.

examples (more likely juice itself) link-fail on both OSX and Win64

Hi

I did not see the dependency on capnproto mentioned in the README, anyway after getting it from brew on OSX and from the official latest binaries for Windows, I ended up with similar link failures on both platforms

cd juice/juice-examples cargo build --release

OSX
= note: ld: library not found for -lcublas clang: error: linker command failed with exit code 1

Windows
cannot open input file openblas.lib

The list of libraries listed by the linker in both cases is quite scary, I believe cublas would have been CUDA BLAS, and neither machine of mine has CUDA, but openblas.lib sounds like something the build process would have downloaded/built by itself, or am I asking for too much? Are both linkers working towards a static binary? Sometimes different platforms place their own constraints on the linking process. I usually try hard to produce static binaries for myself, but on this occasion I would have opted for the dynamic builds anyway.

Perhaps the README could be enhanced with a couple of different commands in case people have/have not CUDA etc? I am taking my first Rust ML steps here, promises to be fun!

warnings in bandmat

There are still a bunch of warnings in bandmat that would love be removed :)

warning: value assigned to `v1` is never read

   --> rust-blas/src/math/bandmat.rs:367:17

    |

367 |         let mut v1 = vec![];

    |                 ^^

    |

    = note: `#[warn(unused_assignments)]` on by default

    = help: maybe it is overwritten before being read?


warning: function is never used: `write_to_memory`

   --> rust-blas/src/math/bandmat.rs:366:8

    |

366 |     fn write_to_memory<T: Clone>(dest: *mut T, source: &Vec<T>) -> () {

    |        ^^^^^^^^^^^^^^^

    |

    = note: `#[warn(dead_code)]` on by default


warning: function is never used: `retrieve_memory`

   --> rust-blas/src/math/bandmat.rs:375:8

    |

375 |     fn retrieve_memory<T: Clone>(t: &mut dyn Matrix<T>, l: usize) -> Vec<T> {

    |        ^^^^^^^^^^^^^^^

Which models are currently supported?

What models are currently supported by Juice? As far as I understand, after having looked a little bit at the examples folder, you currently only support some common layers associated with CNNs (e.g. convolutional and pooling layers).

What other models are also supported? Are e.g. RNNs supported? As far as I understand, RNNs with LSTM units are not yet supported, and this is a big limitation. Are feed-forward fully-connected NNs supported?

Does this framework also aim at supporting reinforcement learning algorithms?

What is the goal of this framework? What does it aim to solve? For example, do you also have the intention of implementing SVMs, HMMs, k-NNs, etc?

I should have obtained answers to these questions by just looking at the first lines of the README. So, I guess, the README should be modified in order to provide this info more clearly.

juice does not compile on recent OS X

macOS High Sierra version 10.3.6

Ran cargo build --release in juice-examples dir as per instructions. Last few lines of error look like

          ld: library not found for -lcudnn
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

I thought that juice could compile and run without a GPU; is that wrong?

Cloning repository on windows machine

Error Description

c:\wrk\git>git clone https://github.com/spearow/juice.git
Cloning into 'juice'...
remote: Counting objects: 5415, done.
remote: Compressing objects: 100% (7/7), done.
Receiving objects:  99% (5361/5415), 3.37 MiB | 738.00 KiB/s   408
Receiving objects: 100% (5415/5415), 3.73 MiB | 807.00 KiB/s, done.
Resolving deltas: 100% (3848/3848), done.
fatal: cannot create directory at 'doc/book/http:': Invalid argument
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

What should have happened

To be able to checkout the repository on a windows machine

Describe in which context it happened

checking out the repository

Environment

OS:
Windows 10

GPU Devices:

Native related issues:

N.A.
cuda related issues:
N.A.

OpenCL related issues:
N.A.

Precision Recall

Currently there is only the accuracy implemented for the confusion_matrix implemented, but precision/recall might be a good tool to display the state too.

Memory Leak for CUDNN API Handle

Issue

CUDNN is created as a lazy_static as a handle to CUDNN API (https://github.com/spearow/juice/blob/master/coaster-nn/src/frameworks/cuda/mod.rs#L15-L17)

Lazy_statics cannot be dropped, but CUDNN has a drop method that destroys the API handle, as encouraged in the CUDNN docs.
https://github.com/spearow/juice/blob/master/rcudnn/cudnn/src/cudnn.rs#L27-L32

Without this drop, we will have a minor memory leak on each GPU run.

Complications

The simplest way to resolve this issue would be to secure the lifetime of CUDNN to the CUDA backend, either with a check for CUDNN in the user environment, or assuming anyone using CUDA has CUDNN.

The current dependency chain for Juice is that Coaster-NN depends on Coaster, and so we cannot modify the initialise for CUDA in Coaster-NN, or load in Coaster-NN code into Coaster.

My initial suggestion would be to recreate CUDNN as a mutatable global (Rc may be suitable as there should never be multiple calls to CUDNN happening across threads), but this doesn't prevent the issue that we don't have any struct to tie it to without requesting users have a second backend call just to load CUDNN.

Tests need to be caught up with foreign libraries

Error Description

If you run cargo test, the linker fails on a GEMM incompatibility.

Log

   Compiling juice v0.2.3 (file:///home/ashley/juice-project/juice)

...

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/ashley/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.138pesuvab4dy035.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.13tprap6axy2fph1.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.15kq92zzbmxot4k9.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.166zrsdca5x7z59.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.16u6js6g0l3k1ic6.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.17erb31xn70viq4b.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1a5i2tq60667vtjt.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1bgyo06bo88z8qp4.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1bi4oluhv54j40n2.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1ckp3bwk0jmrbky4.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1dqvxks6k2bzkxe.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1e698527iprj2v8f.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1im38lueib99jsk0.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1jnlhyxj59jycbjv.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1kduva7sc7em934m.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1mvmz58owquyropc.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1oca2t5yfnhtmb3x.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1paja2l0ryv4yk0i.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1q8ffos2d96smbjs.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1rv8n017ha9022uu.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1uc1wq3igno2rmnk.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1vut2eft6nlujjxr.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1xqv5lpflf7ggpga.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1y16o1qfye96o7m0.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1ybf7kcc158ckkia.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1zeawhkbeobww1zn.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.1zwd8n7bcl3vhvvh.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.23tqyymcb18u96mb.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.26cpq4kc17wqvpva.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.26tob62dhs231n08.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.285ux0t7vjsmmzc2.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.28m6b5dkfoixx5aa.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2bxg79lqe593hwex.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2bxldd3oqtodepuq.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2dh9yuzgscovothb.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2e57dzkbp006h2t3.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2f5f9atofyy5pq8l.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2jqywn86b2gsqohu.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2lsgp9slid4tupbj.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2lvxknekg89q3svy.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2lyh15q6cjwzy18c.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2oiwwqohid6mabhc.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2pomqs9zh4w20z8u.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2pykstueqbrp51f3.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2qhkzqx5zqexj20y.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2rg23b7kvq7w2bbp.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2ugsdtbc94v2yp3y.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2w6xsa2hbi53xhak.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2xs38k3nu4oe9uo6.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2yx7qu1uqvipxq6i.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.2zntujdszbgl5ksg.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3171x0bwu82dptu7.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.35dif2yfqvun9jag.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3650q94xlknug1bk.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.36ad6ygiiror6p73.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.37zg35bowvhgupmi.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.387bw5wmrzmzi9tu.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.38xaqdmnspeyek9w.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3ajif99nvwbmf7kz.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3ayaeypdcro9d6yk.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3co9pkem1sh3wbyp.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3cx7oljifvb206q7.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3f6klegmryfg2ey3.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3fer4d615r0xojzm.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3g94tobrpgum5dk6.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3hdlzcrvcuascs9d.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3ik0x0hz6l66cx38.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3kk13x0u4ktko1go.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3lhxbh187rsembyc.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3oqznv5oym7l3m4e.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3q8w2waizwhassn2.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3qi9i0urruv1q39q.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3rngp6bm2u2q5z0y.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3s1u7f9q2y4goodv.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.3vck0z67htzlxjio.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.436dotimmrgzkwfa.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.43v6g0y2xsxoggnt.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.45nf4z58qqykpcpi.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.45pc7c65foh9i35f.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.48721dc4k5qxei0u.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.49a7n47po4ttqjl7.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.49lx1q7cxvpykyv0.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4an0ix21w40jttvg.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4aolhbwzc3tsey6r.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4arb8s2lq5ac6gll.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4brwxiorhmgsb6oc.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4cxyqmsl2ros1gyv.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4dtnki5bgt8bvvrg.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4ei91acrh34fj49y.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4ezmh1vbs95c5ack.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4fkf91p9w8d8vryo.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4fucuw134ffl3tmu.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4g47d2sx6m33abop.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4g4m3v5x9045spb3.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4hvwaj80f504uofg.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4jkk7yhkl6pyymtf.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4kqxsu08wxuaoo3w.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4ncs6fhfb9hjffqf.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4rzh6npf1tuwcxx9.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4sw9hz7i7fiueihz.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4v9zhvfjjkov3sig.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4vy3qcrl28uuur63.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4xq48u46a1pwiqn7.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4xuhwz5yy6q4gvgg.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4yh8x2b62dcih00t.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4ypvbwho0bu5tnww.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.4zw1r5f78rc8egdz.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.50ihq5hb18xtkrzj.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.50l5bvs77o484wu8.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.51s1w397y42gpez1.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.51te231hjxr8ccdh.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.53uxuw1muw1jbx4l.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.56dly8q07ws8ucdq.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.571ojudrijgdq9je.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.57k06xfugllsc526.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.57qy3vyd9bhiuaon.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.5a41h599e6s0ty1z.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.5beqqbexwb143v6a.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.5e4vamswl6pruawz.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.5fi52boevgmznqzp.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.63mmpc50mjcb0lb.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.6s9l8e4gs325mgl.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.7p53qlves2rwxx0.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.8xzrsc1ux72v29j.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.98g0d9x8aw3akpe.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.9elsx31vb4it187.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.9fcb3syd3ne5k0n.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.c6lbtaiefvx3wya.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.e19kx9t7xhzajfl.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.hi61vfphyi9zbiu.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.j9fgs0cpeo356mj.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.mb501chi8fnqgmm.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.mz7vgmcf23rofcc.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.pqmjx25qpxkduz7.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.pwoyhldid8s7l5p.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.spyjbt69vcsrx9q.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.vqw3ycco7okst5v.rcgu.o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.xu4obdcw6cpdlyb.rcgu.o" "-o" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a" "/home/ashley/juice-project/juice/target/debug/deps/layer_specs-81d58b45e5827e6a.crate.allocator.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-L" "/home/ashley/juice-project/juice/target/debug/deps" "-L" "/home/ashley/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/ashley/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libtest-875324f9ac1d0205.rlib" "/home/ashley/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libterm-6b3c7f8021762801.rlib" "/home/ashley/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgetopts-9f4fb616c2996f41.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libjuice-950f7099a92a2cd5.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libcoaster_nn-5e105294e85782df.rlib" "/home/ashley/juice-project/juice/target/debug/deps/liblog-1083263758d30afa.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libcoaster_blas-a25e46d70aff0e69.rlib" "/home/ashley/juice-project/juice/target/debug/deps/librblas-2d59f7a42168cee3.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libcoaster-2f875589b04c4d43.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libbyteorder-ff5b5cbeccce4929.rlib" "/home/ashley/juice-project/juice/target/debug/deps/liblazy_static-fdfa0f33bf56f53f.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libenum_primitive-595dd4954e3534a3.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libnum_traits-e0eb695af8b7c2ff.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libbitflags-8d0d8717bd480c28.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libcapnp-c00c1b02e9834c5a.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libbyteorder-fb0fa61a79237c85.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libnum-aaa2cb67f7041715.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libnum_rational-3c7384c34e9c9d79.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libnum_bigint-3a3250060807be15.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libnum_complex-4e206c3815a55980.rlib" "/home/ashley/juice-project/juice/target/debug/deps/librustc_serialize-675d1820859dd87d.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libnum_iter-763386b6c6b39277.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libnum_integer-8cae946474f6f824.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libnum_traits-45a33a723367009b.rlib" "/home/ashley/juice-project/juice/target/debug/deps/librand-7cbcb3e7a58227e0.rlib" "/home/ashley/juice-project/juice/target/debug/deps/liblog-0449cd80c8988189.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libcfg_if-666f16f36d451673.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libtimeit-b90de33dd74fe5e9.rlib" "/home/ashley/juice-project/juice/target/debug/deps/libtime-9c3e1eb2336f6661.rlib" "/home/ashley/juice-project/juice/target/debug/deps/liblibc-2a28dfa3bdaef380.rlib" "-Wl,--start-group" "/home/ashley/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-2da986ecbb2c5327.rlib" "/home/ashley/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-57f46841c9a9f4ee.rlib" "/home/ashley/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-23263fe5893322f6.rlib" "/home/ashley/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-6ed5262c9a0a3e5a.rlib" "/home/ashley/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_system-99c162b689d43349.rlib" "/home/ashley/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-cd415b85dd267875.rlib" "/home/ashley/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-3876ac10aa96a1e3.rlib" "/home/ashley/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_unicode-598b0e9aca382e9a.rlib" "/home/ashley/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-4eabb2b1c31071b8.rlib" "-Wl,--end-group" "/home/ashley/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-d7a656735ceeae9e.rlib" "-Wl,-Bdynamic" "-l" "blas" "-l" "OpenCL" "-l" "OpenCL" "-l" "cuda" "-l" "util" "-l" "util" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util" "-l" "util"
  = note: /home/ashley/juice-project/juice/target/debug/deps/librblas-2d59f7a42168cee3.rlib(rblas-2d59f7a42168cee3.rblas1.rcgu.o): In function `<f32 as rblas::matrix::ops::Gemm>::gemm':
          /home/ashley/.cargo/registry/src/github.com-1ecc6299db9ec823/rblas-0.0.13/src/matrix/ops.rs:34: undefined reference to `cblas_sgemm'
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error

error: Could not compile `juice`.

To learn more, run the command again with --verbose.

What should have happened

Linking should have finished correctly.

Describe in which context it happened

Test

Environment

OS: Linux 4.16.11-1-ARCH #1 SMP PREEMPT Tue May 22 21:40:27 UTC 2018 x86_64 GNU/Linux

Juice v0.2.2 with OpenCL feature doesn't work on Linux

Error Description

Fails to build my project which depends on juice v0.2.2

error logs, as verbose as possible
describe which command you ran

$ cargo run --verbose
Fresh byteorder v1.2.1
Fresh rustc-serialize v0.3.24
Fresh libc v0.2.39
Fresh byteorder v0.4.2
Fresh cfg-if v0.1.2
Fresh bitflags v0.3.3
Fresh num-traits v0.2.1
Fresh lazy_static v0.1.16
Fresh capnp v0.8.16
Fresh rand v0.4.2
Fresh time v0.1.39
Fresh log v0.4.1
Fresh num-complex v0.1.43
Fresh num-traits v0.1.43
Fresh num-integer v0.1.36
Fresh capnpc v0.8.8
Fresh rand v0.3.22
Fresh timeit v0.1.2
Fresh log v0.3.9
Fresh enum_primitive v0.1.1
Fresh num-iter v0.1.35
Fresh num-bigint v0.1.43
Fresh num-rational v0.1.42
Compiling juice v0.2.2
Compiling num v0.1.42
Running /home/person/src/rust-juice/target/debug/build/juice-170b0b39777a45a1/build-script-build
Running rustc --crate-name num /home/person/.cargo/registry/src/github.com-1ecc6299db9ec823/num-0.1.42/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="bigint"' --cfg 'feature="complex"' --cfg 'feature="default"' --cfg 'feature="num-bigint"' --cfg 'feature="num-complex"' --cfg 'feature="num-rational"' --cfg 'feature="rational"' --cfg 'feature="rustc-serialize"' -C metadata=9b8ff5675c989b0b -C extra-filename=-9b8ff5675c989b0b --out-dir /home/person/src/rust-juice/target/debug/deps -L dependency=/home/person/src/rust-juice/target/debug/deps --extern num_rational=/home/person/src/rust-juice/target/debug/deps/libnum_rational-b3a835dd852aa03a.rlib --extern num_bigint=/home/person/src/rust-juice/target/debug/deps/libnum_bigint-cbe31c9389826ad7.rlib --extern num_iter=/home/person/src/rust-juice/target/debug/deps/libnum_iter-a521e06f48d9bdf0.rlib --extern num_traits=/home/person/src/rust-juice/target/debug/deps/libnum_traits-81e9d1a6389f76cc.rlib --extern num_complex=/home/person/src/rust-juice/target/debug/deps/libnum_complex-3fe441a585273f91.rlib --extern num_integer=/home/person/src/rust-juice/target/debug/deps/libnum_integer-4b890bce1c4db264.rlib --cap-lints allow
Compiling coaster v0.1.0
Running rustc --crate-name coaster /home/person/.cargo/registry/src/github.com-1ecc6299db9ec823/coaster-0.1.0/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="cuda"' --cfg 'feature="default"' --cfg 'feature="native"' --cfg 'feature="opencl"' -C metadata=9dc8fcfb401dd9c8 -C extra-filename=-9dc8fcfb401dd9c8 --out-dir /home/person/src/rust-juice/target/debug/deps -L dependency=/home/person/src/rust-juice/target/debug/deps --extern libc=/home/person/src/rust-juice/target/debug/deps/liblibc-1c5d615e00e1a1cb.rlib --extern lazy_static=/home/person/src/rust-juice/target/debug/deps/liblazy_static-002e818342daade2.rlib --extern bitflags=/home/person/src/rust-juice/target/debug/deps/libbitflags-6aeeebe587d64d7f.rlib --extern byteorder=/home/person/src/rust-juice/target/debug/deps/libbyteorder-cf6e1c132b24ffe8.rlib --extern enum_primitive=/home/person/src/rust-juice/target/debug/deps/libenum_primitive-aca529fcb4a45854.rlib --extern num=/home/person/src/rust-juice/target/debug/deps/libnum-9b8ff5675c989b0b.rlib --cap-lints allow
Compiling coaster-blas v0.2.0
Compiling coaster-nn v0.4.1
Running rustc --crate-name coaster_blas /home/person/.cargo/registry/src/github.com-1ecc6299db9ec823/coaster-blas-0.2.0/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="coaster"' --cfg 'feature="opencl"' -C metadata=0662d76eb02f8280 -C extra-filename=-0662d76eb02f8280 --out-dir /home/person/src/rust-juice/target/debug/deps -L dependency=/home/person/src/rust-juice/target/debug/deps --extern lazy_static=/home/person/src/rust-juice/target/debug/deps/liblazy_static-002e818342daade2.rlib --extern coaster=/home/person/src/rust-juice/target/debug/deps/libcoaster-9dc8fcfb401dd9c8.rlib --cap-lints allow
Running rustc --crate-name coaster_nn /home/person/.cargo/registry/src/github.com-1ecc6299db9ec823/coaster-nn-0.4.1/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="coaster"' --cfg 'feature="opencl"' -C metadata=45229dce38c935c6 -C extra-filename=-45229dce38c935c6 --out-dir /home/person/src/rust-juice/target/debug/deps -L dependency=/home/person/src/rust-juice/target/debug/deps --extern log=/home/person/src/rust-juice/target/debug/deps/liblog-7835f7eb05aee7ea.rlib --extern coaster=/home/person/src/rust-juice/target/debug/deps/libcoaster-9dc8fcfb401dd9c8.rlib --extern libc=/home/person/src/rust-juice/target/debug/deps/liblibc-1c5d615e00e1a1cb.rlib --extern lazy_static=/home/person/src/rust-juice/target/debug/deps/liblazy_static-002e818342daade2.rlib --cap-lints allow
error[E0433]: failed to resolve. Maybe a missing extern crate rblas;?
--> /home/person/.cargo/registry/src/github.com-1ecc6299db9ec823/coaster-blas-0.2.0/src/transpose.rs:20:33
|
20 | pub fn to_rblas(&self) -> ::rblas::attribute::Transpose {
| ^^^^^ Maybe a missing extern crate rblas;?

error[E0433]: failed to resolve. Maybe a missing extern crate rblas;?
--> /home/person/.cargo/registry/src/github.com-1ecc6299db9ec823/coaster-blas-0.2.0/src/transpose.rs:22:37
|
22 | Transpose::NoTrans => ::rblas::attribute::Transpose::NoTrans,
| ^^^^^ Maybe a missing extern crate rblas;?

error[E0433]: failed to resolve. Maybe a missing extern crate rblas;?
--> /home/person/.cargo/registry/src/github.com-1ecc6299db9ec823/coaster-blas-0.2.0/src/transpose.rs:23:35
|
23 | Transpose::Trans => ::rblas::attribute::Transpose::Trans,
| ^^^^^ Maybe a missing extern crate rblas;?

error[E0433]: failed to resolve. Maybe a missing extern crate rblas;?
--> /home/person/.cargo/registry/src/github.com-1ecc6299db9ec823/coaster-blas-0.2.0/src/transpose.rs:24:39
|
24 | Transpose::ConjTrans => ::rblas::attribute::Transpose::ConjTrans,
| ^^^^^ Maybe a missing extern crate rblas;?

error: aborting due to 4 previous errors

error: Could not compile coaster-blas.

Caused by:
process didn't exit successfully: rustc --crate-name coaster_blas /home/person/.cargo/registry/src/github.com-1ecc6299db9ec823/coaster-blas-0.2.0/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg feature="coaster" --cfg feature="opencl" -C metadata=0662d76eb02f8280 -C extra-filename=-0662d76eb02f8280 --out-dir /home/person/src/rust-juice/target/debug/deps -L dependency=/home/person/src/rust-juice/target/debug/deps --extern lazy_static=/home/person/src/rust-juice/target/debug/deps/liblazy_static-002e818342daade2.rlib --extern coaster=/home/person/src/rust-juice/target/debug/deps/libcoaster-9dc8fcfb401dd9c8.rlib --cap-lints allow (exit code: 101)
warning: build failed, waiting for other jobs to finish...
error: build failed

What should have happend

your expectations
The project should build

Describe in which context it happened

Trying to build my hello world program. Here's my Cargo.toml:

[package]
name = "rust-juice"
version = "0.1.0"
authors = ["Person [email protected]"]

[dependencies]
juice = { version = "0.2.2", default-features = false }

[features]
default = ["opencl"] # include only the ones you want to use, in this case "native"
native = ["juice/native"]
cuda = ["juice/cuda"]
opencl = ["juice/opencl"]

custom app, demo compilation, test run

Environment

OS:

uname -a
Linux hostname 4.15.7-1-ARCH #1 SMP PREEMPT Wed Feb 28 19:01:57 UTC 2018 x86_64 GNU/Linux
cat /etc/os-release | grep PRETTY_NAME
Arch Linux

Roadmap 2021/2022

Bigger work items:

  • Recursive Neural Networks / Long Term Short Term Memory #87
  • OpenCL Backend [juice/coaster-nn]
  • Autodiff [juice/coaster-nn]
  • Accuracy enum/marker structs instead of type usage [juice/greenglas/coaster]

Low hanging fruits:

  • Honour biases [juice] #6
  • Gradient calculation for ND-convolution native backend [coaster-nn]
  • Regression examples [juice-examples]
  • Add preprocessing filters [greenglas]

The full presentation of November 30th, 2017:
bernhard_schuster__rust_machine_learning_with_juice.pdf

Wide/shallow learning

"Juice is a open Machine Learning Framework for hackers to build classical, deep or hybrid machine learning applications."

What should be available for classical and hybrid applications? I imagine linear/logistic regression, maybe SVM?

Cannot clone on windows

Hey, I tried to clone juice but I got an error:

Cloning into 'juice'...
remote: Counting objects: 5470, done.
remote: Total 5470 (delta 0), reused 0 (delta 0), pack-reused 5470
Receiving objects: 100% (5470/5470), 3.75 MiB | 1.68 MiB/s, done.
Resolving deltas: 100% (3887/3887), done.
fatal: cannot create directory at 'doc/src/http:': Invalid argument
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

It should be enough to rename the http: directory.

Use git rather than local paths

It's awesome that you're reviving this project!
I've gotten the examples working using the native backend, but it required cloning all of the dependencies locally because it doesn't seem possible to override their paths ("../coaster-blas", "../rust-blas", etc.).
Would it be possible to use their git addresses instead?

Gemm implementation for Native doesn't correspond to standards

The current implementation of the Gemm trait in coaster-blas/src/frameworks/native.rs doesn't correspond to the specification of BLAS here: link. The reason being that the final parameter c is included in the equation: it's scaled by beta and then added to the result of multiplying the a and b matrices. However, the current implementation only treats that chunk of memory as "write-only".

Just switching this the write_only! macro to read_write! macro would cause backwards-compatibility problems all over the project since c is not necessarily initialized. A fix for this issue would require some form of initialization of that memory if it doesn't exist, probably to the default value of the type in question.

rustfmt juice and coaster

I can provide pull request but you might want to do it yourself so you don't have to review it.

Code base would be much cleaner, easier to read, thank you.

Helper to merge foreign git repositories

Not worth to keep in tree, but I'd rather not write it again :)

 function merge_unrelated_project() {
     # args:  subdir url
     local integbranch="${1}"
     local subpro="${2}"
     local remote="gh-${subpro}"
     local subbranch="${remote}-master"
     local url="${3}"
 
     git branch -D "${subbranch}" || true
     git remote add "${remote}" "${url}"
     git fetch "${remote}"
     git checkout -b "${subbranch}" "${remote}/master"
     git filter-branch --msg-filter 'printf "chore/integrate/${subpro}: " && cat'  $(git rev-parse --max-parents=0 gh-rcudnn-master)..HEAD
     mkdir -p ${subpro}
     for f in $(ls -1); do echo "moving ${f}"; git mv "${f}" "${subpro}/" || true; done
     ls -al
     git rm CONTRIB* || echo "no CONTRIB*"
     git mv .clog.toml ${subpro}/
     git mv .gitignore ${subpro}/
     git mv .github ${subpro}/ || echo "no .github folder"
 
     
     echo "===="
     ls -al
     git commit -m "chore/merge: move all of ${subpro} to a subdir"
     git status
     echo "===="
     git checkout "${integbranch}"
     git merge -m"chore/merge: integrate ${subpro}" --no-ff --allow-unrelated-histories "${remote}-master"
     git remote rm "${remote}"
 }
 
 
 merge_unrelated_project $@

Get rid of feature macros

Max:

Rust "impl specialization" should land Rust 1.9(?) (PR here: rust-lang/rust#30652).

That feature should hopefully allow us to better determine the capabilities of the different frameworks that are compiled in and use more performant operations if possible. Currently we handle this via ugly feature attributes which rely on our knowledge of the implemented operations rather than the type system. The current system of feature flags also requires us to "dumb down" the backends to the capabilities they all have in common in order to retain the backend portability.

Cargo.toml points directly to directories that don't exist

Cargo.toml contains:

coaster = { path = "../coaster", default-features = false, version = "0.1.0" }
coaster-blas = { path = "../coaster-blas", default-features = false, version = "0.2.0" }
coaster-nn = { path = "../coaster-nn", default-features = false, version = "0.4.1" }

Rather than having to track down these repos and set up my directory structure the same way, shouldn't these maybe point to to github repos (or published crates)?

Questions about Juice

  • Is it ready for full use?
  • Is it still being matained?
  • Are the naming conventions (such as the functions you use and stuff) similar to Tensorflow's and/or PyTorch's libraries?

Can't build dummy example with native feature only (on macOS)

Error Description

I'd like to explore juice with the native backend since on my laptop (macbook air 2013, osx/macOS High Sierra 10.13.4) does not have an nvidia GPU.

As such, I want to disable cuda and opencl features and only enable native, at least for now.

Unfortunately every attempts I've made were not sufficient to completely disable cuda. I always get this error:

 = note: ld: library not found for -lcuda
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

Here's a gist containing the whole thing: https://gist.github.com/nbigaouette/154e396199f481638da2253e8d22f53f

It seems that coaster is still compiled with --cfg 'feature="cuda"':

Running `rustc --crate-name coaster /Users/nicolas/libraries/coaster.git/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="cuda"' --cfg 'feature="default"' --cfg 'feature="native"' --cfg 'feature="opencl"' -C metadata=67128269456ec24d -C extra-filename=-67128269456ec24d --out-dir /Users/nicolas/juice-hello-world/target/debug/deps -C incremental=/Users/nicolas/juice-hello-world/target/debug/incremental -L dependency=/Users/nicolas/juice-hello-world/target/debug/deps --extern bitflags=/Users/nicolas/juice-hello-world/target/debug/deps/libbitflags-2442dd2387c2da9c.rlib --extern byteorder=/Users/nicolas/juice-hello-world/target/debug/deps/libbyteorder-3250be07bda40946.rlib --extern enum_primitive=/Users/nicolas/juice-hello-world/target/debug/deps/libenum_primitive-38d0147966973709.rlib --extern lazy_static=/Users/nicolas/juice-hello-world/target/debug/deps/liblazy_static-e4ec31522d2c88da.rlib --extern libc=/Users/nicolas/juice-hello-world/target/debug/deps/liblibc-c148fa7e306e3201.rlib --extern num=/Users/nicolas/juice-hello-world/target/debug/deps/libnum-f172fe852397062e.rlib --extern regex=/Users/nicolas/juice-hello-world/target/debug/deps/libregex-8fb663e54381219f.rlib`

How come coaster is compiled with the cuda feature, even though I tried many things to disable it?

What should have happend

Successful linking, without cuda (nor opencl).

Describe in which context it happened

src/main.rs:

extern crate juice;

fn main() {
    println!("Hello, world!");
}

Cargo.toml:

[package]
name = "juice-hello-world"
version = "0.1.0"
authors = ["Nicolas Bigaouette <[email protected]>"]

[dependencies]
juice = { version = "0.2.3", default-features = false }

[features]
default = ["native"] # include only the ones you want to use, in this case "native"
native  = ["juice/native"]
cuda    = ["juice/cuda"]
opencl  = ["juice/opencl"]
cargo run -v --no-default-features --features native

Environment

OS:

uname -a: Darwin MBAIRNB.local 17.5.0 Darwin Kernel Version 17.5.0: Mon Mar 5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64

GPU Devices:

None

Native related issues:

> pkg-config --libs --cflags blas
Package blas was not found in the pkg-config search path.
Perhaps you should add the directory containing `blas.pc'
to the PKG_CONFIG_PATH environment variable
No package 'blas' found

> pkg-config --libs --cflags openblas
Package openblas was not found in the pkg-config search path.
Perhaps you should add the directory containing `openblas.pc'
to the PKG_CONFIG_PATH environment variable
No package 'openblas' found

> export PKG_CONFIG_PATH=/usr/local/opt/openblas/lib/pkgconfig
> pkg-config --libs --cflags openblas
-I/usr/local/Cellar/openblas/0.3.2_1/include -L/usr/local/Cellar/openblas/0.3.2_1/lib -lopenblas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.