ozIMMU - DGEMM on Int8 Tensor Core

August 10, 2024 ยท View on GitHub

This library intercepts function calls for cuBLAS DGEMM functions and executes ozIMMU instead

Build

git clone https://github.com/enp1s0/ozIMMU --recursive
cd ozIMMU
mkdir build
cd build
cmake ..
make -j4

Usage

  1. Set an environmental variable to hijack the function calls
export LD_PRELOAD=/path/to/ozIMMU/build/libozimmu.so
  1. Set an environmental variable to choose the compute mode
export OZIMMU_COMPUTE_MODE=fp64_int8_9

The supported compute modes are here.

  1. Execute the application

Supported compute mode

ModeTensor Core typeNum splits
dgemm----Disable hijacking
sgemm----Use SGEMM internally
fp64_int8_3Int8 TC3
fp64_int8_4Int8 TC4
fp64_int8_5Int8 TC5
fp64_int8_6Int8 TC6
fp64_int8_7Int8 TC7
fp64_int8_8Int8 TC8
fp64_int8_9Int8 TC9
fp64_int8_10Int8 TC10
fp64_int8_11Int8 TC11
fp64_int8_12Int8 TC12
fp64_int8_13Int8 TC13
fp64_int8_14Int8 TC14
fp64_int8_15Int8 TC15
fp64_int8_16Int8 TC16
fp64_int8_17Int8 TC17
fp64_int8_18Int8 TC18
fp64_int8_autoInt8 TCAUTOfp64_int8_3..18 / dgemm

Optional environmental variables

# Show info log
export OZIMMU_INFO=1

# Show error and warning log
export OZIMMU_ERROR=1

# Show CULiP ( https://github.com/enp1s0/CULiP ) log
export OZIMMU_ENABLE_CULIP_PROFILING=1

# Choose malloc mode
export OZIMMU_MALLOC_ASYNC=1

# Set AUTO mode mantissa loss threshold
export OZIMMU_AUTO_AVG_MANTISSA_LOSS_THRESHOLD=1.5

# Set ozIMMU intercept threshold.
export OZIMMU_INTERCEPT_THRESHOLD_M=128
export OZIMMU_INTERCEPT_THRESHOLD_N=128
export OZIMMU_INTERCEPT_THRESHOLD_K=128
# The ozIMMU gemm function is executed if `m`, `n`, and `k` are larger or equal to `OZIMMU_INTERCEPT_THRESHOLD_M`, `N`, and `K`.
# Otherwise, the original cuBLAS function is executed.

Citation

@article{ootomo2024dgemm,
    author = {Hiroyuki Ootomo and Katsuhisa Ozaki and Rio Yokota},
    title = {DGEMM on integer matrix multiplication unit},
    journal = {The International Journal of High Performance Computing Applications},
    year = {2024},
    doi = {10.1177/10943420241239588},
    URL = {https://doi.org/10.1177/10943420241239588}
}

License

MIT