4 releases (breaking)

0.6.0 Nov 21, 2021
0.5.0 Jun 11, 2020
0.3.0 Jan 17, 2020
0.2.0 Jun 12, 2017

#111 in Machine learning

Download history 4/week @ 2024-02-05 5/week @ 2024-02-12 40/week @ 2024-02-26 14/week @ 2024-03-04 18/week @ 2024-03-11 13/week @ 2024-03-18 16/week @ 2024-03-25 76/week @ 2024-04-01

127 downloads per month
Used in 6 crates (3 directly)

MIT/Apache

375KB
11K SLoC

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 git@github.com: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.

Dependencies

~0.4–1MB
~22K SLoC