Documentation for BIGtensor (GPU)

Installation

Environment

BIGtensor (GPU) runs on a single machine.
The shell scripts and code packaging scripts work easily in Linux or Unix machines.
BIGtensor (GPU) needs the following software to be installed in the system:

  • OpenMP version 2.0 or above (if using gcc/g++ compiler, it is installed by default in Linux environment)
  • OpenCL version 1.2 or above
  • GPU environments (like an NVIDIA CUDA) for running OpenCL
  • Eigen: already placed in src/Eigen. Visit a homepage for more information.

Download and Install

Installation is as simple as downloading and extracting the installation file.

  1. Download the file BIGtensor-gpu.tar.gz.
  2. Extract the file by running the following command: tar xvzf BIGtensor-gpu.tar.gz.

Running

Configuration

  • Configure a shared library path with the following command:
    • export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/out/
  • Build the library and its executables with make tf and run the program with demo.sh

Detailed explanations about how to use this library are on USER Guide and API Doc below.

Code Examples

There are two ways to use the BIGtensor library: (1) writing a single executable (demo) or (2) using C/C++ API.

  1. A demo code for PARAFAC.
  2. 
    ...
    int rank = 10;	                        // rank size
    int gpu_mode = 0;                       // 0: cpu, 1: single-gpu, 2: multi-gpu
    int cp_or_tucker = 1;                   // 0: Tucker, 1: CP
    int fully_or_partially_observable = 1;	// 0: fully observable, 1: partially observable
    char* InputPath = "path/to/input/tensor";
    char* ResultPath = "path/to/output/tensor";
    
    Tensor Core;
    Tensor A = Tensor(InputPath);
    A.GPU_Mode_Change(gpu_mode);
    A.Factorization_Mode_Change(cp_or_tucker);
    A.Observation(fully_or_partially_observable);
    Tensor::tensor_factorization(A, Core, rank, ResultPath);
    ...
    

    Please see src/Test_Code and demo.sh for further examples.

  3. A code with C/C++ API for PARAFAC.
  4. 
    #include "Tensor.h"
    #include "BIGtensor.hpp"
    
    int main(int argc, char* argv[]) {
    	BIGtensor bt;
    	int rank = 10;                         // rank size
    	int fully_or_partially_observable = 1; // 0: fully observable, 1: partially observable
    	char* in_tensor_path = "path/to/input/tensor";
    	char* out_factor_path = "path/to/output/tensor";
    	bt.Parafac(rank, fully_or_partially_observable, in_tensor_path, out_factor_path, ANY);
    	return 0   
    }	
    

    Please see src/Test_Code/test_bigtensor.cpp for further examples.

User Guide

The User Guide provides information on the general overview, installation, and supported functions of BIGtensor (GPU).


User Guide

API Doc

The API Doc provides detailed information on classes and functions in BIGtensor (GPU).


API Doc