ruoyuGao / scikit-opt-gpu

We implemented our own sequential version of GA, PSO, SA and ACA using C++ (some using Eigen3 as matrix operation backend) and the parallelized version with CUDA support. All of them are much faster than the popular lib scikit-opt.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

License Platform GitHub version Cuda version Cmake version gcc version py version

loc commit visitors lang

Links

test_file(ACA) → link

Our report(Fixed some typo mistakes) → link

Usage

  1. Load gcc 9.2 and git 2.6 from CIMS cluster
module load gcc-9.2
module load git-2.6.3
module load cmake-3
module load cuda-11.4

If you want to test the python version of this lib, please refer to the url above and do

module load python-3.7
pip install scikit-opt
  1. Clone this repo and build it
git clone https://github.com/ruoyuGao/scikit-opt-gpu.git
cd scikit-opt-gpu
mkdir build
cd build

You can use any cmake flags to build the project as long as it compiles. However, If you are on CIMS cluster please use the following flags or gcc-9.2 can't be used. CMAKE will automatically go to /usr/local/gcc whose version is 4.8.5.

cmake -DCMAKE_C_COMPILER=/usr/local/stow/gcc-9.2/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/stow/gcc-9.2/bin/g++ ..
make -j4
  1. Run executable file
# GA sequential version
./mainGaSeq iteration pop_size cross_prob mutate_prob
# GA cuda version
./GA_gpu iteration pop_size cross_prob mutate_prob
# PSO sequntial version
./main particleNum maxIteration verbose
# PSO cuda version
./mainCuda particleNum maxIteration verbose
# SA sequential version
./mainSA num_of_initalSolutions maxOuterIteration maxInnerIteration verbose
# SA cuda version
./mainSACuda num_of_initalSolutions maxOuterIteration maxInnerIteration verbose
# ACA sequential version
./mainACA_seq num_ants max_iters filename
# ACA cuda version
./mainACA_cuda num_ants max_iters filename

About

We implemented our own sequential version of GA, PSO, SA and ACA using C++ (some using Eigen3 as matrix operation backend) and the parallelized version with CUDA support. All of them are much faster than the popular lib scikit-opt.

License:MIT License


Languages

Language:C++ 65.2%Language:Cuda 28.9%Language:CMake 3.2%Language:Python 2.6%Language:Shell 0.0%