Skip to content

necst/AIE-kmeans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[FPL 2025] Accelerating K-Means: A Vectorized Approach for AI Engines & Neural Processing Units

Main Structure

The archive contains two different implementations of the K-means Clustering algorithm: MacQueen's and Lloyd's. Each version might have multiple implementations, described in detail in the README file inside each folder. Each implementation is structured as follows:

├─ aie/                # AIE kernel for transfomation
|  └─ src/             # Contains the code
├─ data_movers/        # PL kernels for setting up the AIE and for fetching
├─ mutual_info/        # PL Kernel for computing mutual information
├─ common/             # Common codes and variables
├─ hw/                 # System integration
├─ sw/                 # Host application and dataset
└─ Makefile/           # Top-level Makefile to build and run  

Instructions to build and test project

Step 1 - Clone the repository

Open a terminal, then clone the repository by running the following command

git clone https://github.com/necst/AIE-kmeans.git

Then, move into the repository with

cd AIE-KMEANS

and move in the folder of the selected version with

cd implementation/version

Step 2 - Setup the environment

Before building and/or running the framework, run the following script. Notice that this will source Vitis 2022.1, xrt and devtoolset-7

source ./setup_all.sh

Main Commands

aie

make aie_compile_x86 : compile your code for x86 architecture.
make aie_simulate_x86 : simulate your x86 architecture.
make aie_compile : compile your code for VLIW architecture, as your final hardware for HW ad HW_EMU.
make aie_simulate : simulate your code for VLIW architecture, as your final hardware.
make clean : removes all the output file created by the commands listed above.

data_movers

make compile TARGET=HW/HW_EMU: compiles all your kernel, skipping the ones already compiled.
make run_testbench_setup_aie : compiles and execute the testbench for the kernel setup_aie.
make run_testbench_sink_from_aie : compiles and execute the testbench for the kernel setup_aie.

HW

make all TARGET=HW : builds the hardware linking your components make all TARGET=HW_EMU : builds the hardware emu linking your components make clean: removes all files.

SW

make build_sw : compiles the sw ./setup_emu.sh -s on : enables the hardware emulation ./host_overlay.exe : runs the emulation

General useful commands:

If you need to move your bitstream and executable on the target machine, you may want it prepared in a single folder that contains all the required stuff to be moved. In this case, you can use the

make build_and_pack TARGET=hw/hw_emu : it allows you to pack our build in a single folder. Notice that the hw_emu does not have to be moved on the device, it must be executed on the development machine.

Paper Citation

If you find this repository useful, please use the following citation:

About

Towards an HW/SW Co-Design Approach for Versal-Based Kmeans Acceleration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •