About InTensLi (Input-adaptive and in-place dense tensor-times-matrix multiply)
To compute a mode-n product: Y=X * U, where X and Y are dense tensors, U is a
dense matrix. * represents mode-n product.
There are two stages: first is to generate ttm code according to input tensor and other parameters (gen_ttm); second is to use generated "ttm.cpp" to run ttm code and test its performance.
The tests use random generated dense tensors, users can specify the tensor dimension and maximum and minimum dimension sizes.
How to run?
Refer to script file "run_InTensLi.sh" to run InTensLi as a whole.
The input parameters for executable file "gen_ttm" and "ttm" are the same.
./gen_ttm (or ./ttm)
- -maxdimsize=[maximum dimension size]
- -mindimsize=[minimum dimension size]
Other dimension sizes are generated by evenly distributed betwee the max and min.
- -mode=[mode-n product, the mode to be multiplied]
- -R=[the low-rank value, size of dimension n of the generated tensor Y]
- -strategy=[1, forward-strategy; 2: backward-strategy]
- -degree=[number of dimensions used to build inner-most MM kernel]
- -OMPNT=[number of threads used in for loops]
- -MKLNT=[number of threads used in MM kernel]
Parameters "degree", "OMPNT", and "MKLNT" can be specified by users, although InTensLi itself decides reasonable values for them.
- defines.h: use this file to define macros.
- driver-gen.cpp: main file for the first stage.
- gen_ttm.cpp: generate "ttm.cpp" for a particular input tensor.
- function decide_component_mode: split tensor dimensions into two parts, modes used in inner matrix multiplication kernel (M_C) and modes used as loops (M_L).
- function decide_paras: determine "degree" value and threads used in for loops ("omp_nt"), in MM kernel ("mkl_nt").
- driver-ttm.cpp: main file to the second stage.
- util.cpp: auxiliary functions.
- timer.cpp: timing functions.
- hpcdefs.h: used in timer.cpp.
Note: Code is not pretty now. Welcome any feedback to improve it!
Contact: Jiajia Li (firstname.lastname@example.org)