Skip to content

TUD-MLA/bnn_on_gpu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bnn_on_gpu

  1. Navigate to folder of respective model
  2. Change desired batch size in utils.h
  3. A. run using
$ bash run.bash
  1. B. alternitavely: set the path to the CUDA Runtime Library of your system in Makefile
  • currently commented out: the path on my personal PC on line 5, and the path on the server on line 7
  • and run using
$ make
$ ./fashion_prof.o <OR ./cifar.o>

Layer configuration for FashionMNIST BNN model

L1 Conv → L2 Maxpool → L3 Step → L4 Conv → L5 Maxpool → L6 Step → L7 Flattening → L8 Gemm → L9 Step → L10 Gemm

Default starting configuration:

  • Layer 1, 2, 4, 5, 8, 10 on GPU using PROFILE XYZ
  • Layer 3, 6, 7, 9 on CPU.

Layer configuration for CIFAR-10 BNN model

L1 Conv → L2 Step → L3 Conv → L4 Maxpool → L5 Step → L6 Conv → L7 Step → L8 Conv → L9 Maxpool → L10 Step → L11 Conv → L12 Step → L13 Conv → L14 Maxpool → L15 Step → L16 Flattening → L17 Gemm → L18 Step → L19 Gemm

Default starting configuration:

  • Layer 1, 3, 4, 6, 8, 9, 11, 13, 14, 17, 19 on GPU using PROFILE XYZ
  • Layer 2, 5, 7, 10, 12, 15, 16, 18 on CPU.

Run layers on CPU only:

in net.cpp (X layer number):

  • comment /* Layer X GPU */ lines
  • comment out immediate /* Layer X CPU */ lines

Run layers on GPU in different parallel configurations:

  • Revert previous steps in case they were performed
  • Do NOT comment out the STEP layers (i.e. the layers running on CPU by default)

Available parallel configurations:

  • PROFILE X – data-images
  • PROFILE Y – windows
  • PROFILE Z – neurons
  • PROFILE XY – data-images + windows
  • PROFILE XZ – data-images + neurons
  • PROFILE YZ – windows + neurons
  • PROFILE XYZ – data-images + windows + neurons

in cuda_kernel.cu:

  • Each layer is specifically implemented for every profile iteratively
  • Each profile can be found between delimiting lines: =============
  • Search for desired profile using CTRL+F, comment out all lines of coude between delimiting lines
  • Don't forget to comment-in previously used profiles (e.g. default profile XYZ at the bottom of the file)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages