Skip to content
dtheodor79 edited this page Jun 11, 2024 · 21 revisions

Welcome to the OPTIMA-ICCS wiki!

OOPS Library

The OOPS library, part of the work done for the OPTIMA EuroHPC JU project, supports in total 30 kernels, including BLAS L1, L2, L3, sparse matrix-vector multiplication, as well as a Jacobi preconditioner and matrix LU decomposition. OOPS enables performance and energy-efficient HPC implementations that can reduce energy consumption (when compared to server-class machines) up to 50x for L1 BLAS kernels, up to 20x for specific L2 BLAS kernels, up to 1.5x for specific L3 BLAS kernels, and up to 1.5x for CAE solvers. You can find a set of evaluation results here.

The main idea for using this repository is to download a template project for the AMD / Xilinx Vitis workflow by specifying the kernel that will be implemented to hardware. All kernels support single precision floating point data type. Please note that some kernels have limitations regarding their supported data formats and execution, designated in the tables below.


BLAS (Basic Linear Algebra Subprograms)

L1

Kernel Name Description Limitations
asum sum of absolute values CUs: 1-16, N must be grater of equal to the number of used CUs
axpy y = a*x + y CUs: 1-16, N must be grater of equal to the number of used CUs
copy copy x into y CUs: 1-16, N must be grater of equal to the number of used CUs
ddot dot product with extended precision accumulation CUs: 1-10, N must be grater of equal to the number of used CUs
dot dot product CUs: 1-10, N must be grater of equal to the number of used CUs
iamax index of max abs value CUs: 1-16, N must be grater of equal to the number of used CUs
iamin index of min abs value CUs: 1-16, N must be grater of equal to the number of used CUs
nrm2 Euclidean Norm CUs: 1-16, N must be grater of equal to the number of used CUs
rot setup Givens rotation CUs: 1-16, N must be grater of equal to the number of used CUs
rotm setup modified Givens rotation CUs: 1-10, N must be grater of equal to the number of used CUs
scal x = a*x CUs: 1-32, N must be grater of equal to the number of used CUs
swap swap x and y CUs: 1-16, N must be grater of equal to the number of used CUs

L2

Kernel Name Description Limitations
gbmv banded matrix vector multiply CUs: fixed number to 10
gemv matrix vector multiply CUs: fixed number to 14
gemv_new matrix vector multiply CUs: fixed number to 8
sbmv symmetric banded matrix vector multiply CUs: fixed number to 10
spmv symmetric packed matrix vector multiply CUs: fixed number to 8, Supports only upper triangular matrix as input, Minimum N=128, N must be power of 2
symv symmetric matrix vector multiply CUs: fixed number to 10
tbmv triangular banded matrix vector multiply CUs: fixed number to 14
tbsv solving triangular banded matrix problems CUs: fixed number to 16
tpmv triangular packed matrix vector multiply CUs: fixed number to 8, Supports only upper triangular matrix as input, Minimum N=128, N must be power of 2
tpsv solving triangular packed matrix problems CUs: fixed number to 16 Supports only upper triangular matrix as input, Minimum N=256, N must be power of 2
trmv triangular matrix vector multiply CUs: fixed number to 14
trsv solving triangular matrix problems CUs: fixed number to 1

L3

Kernel Name Description Limitations
gemm matrix matrix multiply CUs: fixed number to 8
symm symmetric matrix matrix multiply CUs: fixed number to 2
trmm triangular matrix matrix multiply CUs: fixed number to 4
trsm solving triangular matrix with multiple right hand sides CUs: fixed number to 10

Note: trsm may produce wrong results numerically.

SpMV

CUs: fixed number to 16

CAE

Kernel Name Description Limitations
jacobi applies the Jacobi preconditioning up to 8192x8192 matrices, single precision floating point format
lu matrix decomposition to upper and lower ones up to 8192x8192 matrices, single precision floating point format, input matrix main diagonal must not contain 0s

The project structure is as follows

host folder

Contains host code for each kernel (workload generation, preparation/collection of data to/from the FPGA and verification of the results)

kernel folder

Contains HW kernels for different OOPS functions.

kernel_config_files folder

Contains cfg files required for kernels (during compilation of kernel code, system synthesis and packaging)

template_project folder

Contains a generic template project, that can be used to test all the kernels. The template project structure must not be changed in order for the building scripts to work properly.


How to use the template project to test the kernels

Clarification

We have tested every kernel with the provided scripts and template project with our system. Our system setup basic information

This guide assumes that you have a fully working system with the above characteristics as well.

Initial configuration

  1. Clone the main branch OPTIMA-ICCS repository
    • This can be done from the main page of the repository
  2. Navigate to the root of template project directory
cd your_path_to_git_repo/OPTIMA-ICCS/template_project/
  1. Open the make_script.sh with a text editor
  2. Navigate to line 64 and change the XILINX variables according to you system setup
export XILINX_XRT=/opt/xilinx/xrt
export XILINX_VIVADO=/opt/Xilinx/Vivado/2022.1/
export XILINX_VITIS=/opt/Xilinx/Vitis/2022.1/
export XILINX_VITIS_HLS=/opt/Xilinx/Vitis_HLS/2022.1/

Testing kernels

  1. Navigate to the root of template project directory
cd your_path_to_git_repo/OPTIMA-ICCS/template_project/
  1. Use the copy_files.sh script in order to copy into the template_project the necessary files for kernel testing. You can find the supported kernels in list. Their name can be used as argument when calling the script. Example of usage of the copy_files script.
bash copy_files.sh -k=asum
  1. Execute the make_script.sh with the desired arguments. This script builds the entire project.
    • -k=* or --kernel=* : specify the "kernel_name"

    • -c=* or --cus=* : specify the number of CUs depending on the kernel implementation. You can check the supported numbers of CUs for a specific kernel by navigating to the corresponding directory inside the kernel_config_files directory. The supported number of CUs for each kernel is also referred on the .cfg files name

    • -p=* or --platform=* : specify the platform. Currently OOPS supports only u55 platform. We intent to support u280 at the future

    • -t=* or --target=* : specify the target for building the project. Could be "Emulation-SW", "Emulation-HW" or "Hardware". The default value is "Emulation-SW". Example of using the make_script.sh

      bash make_script.sh -k=asum -c=16 -t=Emulation-SW
  2. Execute the run script by specifying the number of CUs and the target for execution. Example of usage of run_script
bash run_script.sh -c=16 -t=Emulation-SW

If you want to test another kernel first you must bring the template project to its initial state. This can be done using the clean_project.sh script, which deletes all the extra files that are generating during the building process.

bash clean_project.sh