-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LLVM] Benchmark related changes #871
Merged
Merged
Changes from 250 commits
Commits
Show all changes
355 commits
Select commit
Hold shift + click to select a range
8fa6225
Improved output
iomaganaris ee91aaa
Fixed compilers
iomaganaris 9286bac
Changes for Ioannis script
pramodk a5a259f
Updated script and hh.cpp
iomaganaris a02dfa6
Small fix in openmp flags
iomaganaris a23b1ed
Disable python bindings for faster build
pramodk 6698213
Integrate LLVM into CMake build system
pramodk c73d83d
Code infrastructure for LLVM code generation backend
pramodk c7c6e40
Azure CI fixes for LLVM build and README update
pramodk 6cf8320
Print build status after cmake configure stage
pramodk d32e2a3
Adding test template for LLVM codegen
pramodk 01001df
Initial LLVM codegen vistor routines (#457)
georgemitenkov c8ee79b
FunctionBlock code generation and terminator checks (#470)
georgemitenkov f70c4d2
Add option to run LLVM optimisation passes (#471)
pramodk de33088
Add function call LLVM code generation (#477)
georgemitenkov d0fe34d
Support for IndexedName codegen (#478)
georgemitenkov c79689a
Improvements for code generation specific transformations (#483)
pramodk 3115a32
nrn_state function generation in NMODL AST to help LLVM codegen (#484)
pramodk 92eae90
Running functions from MOD files via LLVM JIT (#482)
georgemitenkov 5698fd7
Extended support for binary ops and refactoring (#489)
georgemitenkov a171af1
Avoid converting LOCAL statement in all StatementBlocks (#492)
pramodk 0eab81c
Handle CodegenVarType type in JSON printer (#494)
pramodk 183acbe
Integrating LLVM helper into LLVM visitor (#497)
georgemitenkov 0bf5e9b
LLVM code generation for if/else statements (#499)
georgemitenkov 5d7f2ef
Added error handling for values not in scope (#502)
georgemitenkov bb82934
Added support for WHILE statement (#501)
georgemitenkov 0dd8f72
Create mechanism instance struct in LLVM IR (#507)
iomaganaris 11a186e
Printf support in LLVM IR codegen (#510)
georgemitenkov fa01b01
Fix issue error: ‘runtime_error’ is not a member of ‘std’ (#512)
iomaganaris 748bfef
Move code gen specific InstanceStruct node to codegen.yaml (#526)
pramodk 7c8e16f
* Improvements to codegen helper (Part I)
pramodk 06e2744
Addressing TODOs for Instance struct (#533) Part II
georgemitenkov d435500
Unit test for scalar state kernel generation in LLVM (#547)
georgemitenkov 660cd31
Indexed name codegen improvements (#550)
georgemitenkov 1643f7d
Add InstanceStruct test data generation helper and unit test (#546)
iomaganaris 46133d0
Add the remainder loop for vectorization of DERIVATIVE block (#534)
a72e2f2
Always initialize return variable in function block (#554)
99d6a03
Running a kernel with NMODL-LLVM JIT (#549)
georgemitenkov d134ad4
Loop epilogue fix for LLVM visitor helper (#567)
georgemitenkov 2b4a7b7
Gather support and vectorisation fixes for LLVM code generation (#568)
georgemitenkov ecebcc0
Verification and file utilities for LLVM IR codegen (#582)
georgemitenkov 4c13787
Add gather execution test (#591)
georgemitenkov 566ea70
Fixed loop allocations (#590)
georgemitenkov 0c2cfc3
Benchmarking LLVM code generation (#583)
georgemitenkov 72feb65
Minor benchmarking improvement (#593)
pramodk c372e46
Bug fix in codegen helper: delete LOCAL statement (#595)
pramodk ebb155e
LLVM 13 compatibility and fixing void* type (#603)
georgemitenkov 31b95d8
Allow LOCAL variable inside StatementBlock for LLVM IR generation (#599)
pramodk c71b368
Update CI with LLVM v13 (trunk) (#605)
pramodk 63a662e
Integrating vector maths library into LLVM codegen (#604)
georgemitenkov b22afdc
Using shared libraries in LLVM JIT (#609)
georgemitenkov baf95f0
Avoid local std::ofstream object causing segfault (#614)
pramodk 272ffc5
Refactoring of runners' infrastructure and dumping object files (#620)
georgemitenkov 3a8b8ff
Optimisation levels for benchmarking (#623)
georgemitenkov 8f2501c
Adding function debug information (#628)
georgemitenkov 3db4535
Fixed using benchmarking_info in TestRunner (#631)
georgemitenkov 33631b9
Fixed addition of SOLVE block to kernel's FOR loop (#636)
georgemitenkov 05b1821
IR builder redesign for LLVM IR code generation pipeline (#634)
georgemitenkov 1e4809e
Fixed initialisation of `CodegenAtomicStatement` (#642)
georgemitenkov 07fe468
Fix instance struct data generation for testing/benchmarking (#641)
pramodk f7017a7
Basic scatter support (#643)
georgemitenkov 38c61bf
Benchmarking code re-organisation and minor improvements (#647)
pramodk bb3ecd0
Added attributes and metadata to LLVM IR compute kernels (#648)
georgemitenkov 167c23c
Added loaded value to the stack (#655)
georgemitenkov a02a8d0
Basic predication support for LLVM backend (#652)
georgemitenkov 999bf36
Improvements for LLVM code generation and benchmarking (#661)
georgemitenkov 2142e2d
Fixed `alloca`s insertion point for LLVM backend (#663)
georgemitenkov 6d4743b
Fast math flags for LLVM backend (#662)
georgemitenkov e752afd
Avoid generating LLVM IR for Functions and Procedures if inlined (#664)
iomaganaris 9ece2e9
Fixed typo in benchmarking metrics (#665)
georgemitenkov 468b3d1
Remove only inlined blocks from AST based on symtab properties (#668)
iomaganaris 47e3c4a
Use VarName on the RHS of assignment expression (#669)
pramodk af7540c
[LLVM] SLEEF and libsystem_m vector libraries support (#674)
georgemitenkov 19ad02a
[LLVM] Enhancements for optimization pipeline (#683)
georgemitenkov 8306736
[LLVM] Added saving to file utility (#685)
georgemitenkov 24908e2
[LLVM] Aliasing and `cpu` options for LLVM visitor and the benchmark …
georgemitenkov f721890
Fix azure yaml pipeline from merge (#687)
pramodk ff5430c
[LLVM] Support for newer versions of LLVM APIs
georgemitenkov c80a44d
Fix build issues for the rebased branch
pramodk de3a8be
[LLVM] Allocate InstanceStruct on the GPU using cudaMallocManaged (#815)
iomaganaris ad81954
[LLVM][GPU] Separated CPU and GPU CLI options
georgemitenkov 3992315
[LLVM][refactoring] Added platform abstraction
georgemitenkov d4e12d0
[LLVM][GPU] Added GPU-specific AST transformations
georgemitenkov 9940fd8
fixed comments
georgemitenkov 196a5a3
Added code generation for thread id
georgemitenkov 7044204
Added kernel annotation generation
georgemitenkov 9351e39
Added tests for annotations/intrinsics
georgemitenkov e26d961
Removed POINTER compatibility error (#821)
iomaganaris b93ce12
[LLVM][GPU] Separated CPU and GPU CLI options (#817)
georgemitenkov acb9dea
[LLVM][refactoring] Added platform abstraction
georgemitenkov 0907d3b
[LLVM][GPU] Added GPU-specific AST transformations
georgemitenkov b4943fd
fixed comments
georgemitenkov 06deff9
Added code generation for thread id
georgemitenkov b506574
Added kernel annotation generation
georgemitenkov d097cf0
Added tests for annotations/intrinsics
georgemitenkov 98184f1
[LLVM][refactoring] Added platform abstraction (#818)
georgemitenkov ad58356
[LLVM][GPU] Added GPU-specific AST transformations
georgemitenkov 0530417
fixed comments
georgemitenkov 1d4117a
Initial work for gpu runner
iomaganaris d0d1051
Compile module and load it in the GPUJITDriver
iomaganaris 35e46fe
Get rid of one unnecessary shared_ptr (#826) (#827)
b9b1418
more changes to support gpu execution
iomaganaris 7e9484d
Template BaseRunner
iomaganaris 9f4a142
Fixed compilation issues with templates
iomaganaris d515961
More small fixes
iomaganaris b69f2c7
Separated CUDADriver from JITDriver files
iomaganaris 0882fc3
Small fixes and setting the compute arch in options
iomaganaris 0ec0826
Tried workflow with test kernel and linking with libdevice
iomaganaris 0f72a74
Make clang-format happy and only compile gpu benchmark if cuda backen…
iomaganaris 881d85e
Improved a bit logs
iomaganaris a1af210
Merge branch 'georgemitenkov/llvm-gpu-codegen' into magkanar/gpu-runner
iomaganaris 7de726c
Added newline in EOF
iomaganaris 18df661
Use cmake 3.18 in the CI
iomaganaris 7aceb5b
Added optimization option and printing PTX to file
iomaganaris d0af9b4
Use the kernel real name in nvvm anotation in the generated LLVM IR
iomaganaris 44b7f00
Revert "Use the kernel real name in nvvm anotation in the generated L…
iomaganaris 8bdefb9
Replaced IF with FOR loop
georgemitenkov 2c57d4d
Added code generation for thread id
georgemitenkov 97e3940
Added kernel annotation generation
georgemitenkov dbd8cc9
Added tests for annotations/intrinsics
georgemitenkov b562d19
Addapted code generation for GPU expressions
georgemitenkov 483b363
Fixed lists of supported statements
georgemitenkov f874146
[LLVM][GPU] Added GPU-specific AST transformations (#819)
georgemitenkov e108525
Merge branch 'llvm' into georgemitenkov/llvm-gpu-codegen
pramodk 295fa25
fix merge issue: gpu code generation is now enabled by this PR
pramodk d29d0bc
Merge branch 'georgemitenkov/llvm-gpu-codegen' into magkanar/gpu-runner
iomaganaris 400aaec
Small fix from merge
iomaganaris b3de1e1
[LLVM][GPU] Basic code generation for NVPTX backend (#820)
georgemitenkov fad728d
More changes to make the LLVM IR generated by NMODL executed on GPU
iomaganaris 68cce1a
Merge branch 'llvm' into magkanar/gpu-runner
iomaganaris 26161f9
Small cleanup
iomaganaris d68671e
Print kernel wrappers and nrn_init based on Instance Struct (#551)
iomaganaris b6463d3
Added NVPTX-specific optimization passes for PTX generation
georgemitenkov a1513f8
Added tests
georgemitenkov cf459d4
Merge branch 'llvm' into magkanar/gpu-runner
iomaganaris af5ed38
Print LLVM IR to file once
iomaganaris 90a7443
Merge branch 'georgemitenkov/llvm-gpu-passes' into magkanar/gpu-runne…
iomaganaris fba92e2
Changes to generate proper code
iomaganaris b42ebe7
Addressed comments for GPU code generation
georgemitenkov a2ef4a6
Added missing include
georgemitenkov cd2921e
Merge branch 'georgemitenkov/llvm-gpu-passes' into magkanar/gpu-runne…
iomaganaris cb3547a
Replaced `find()` with `at()` when querying target information
georgemitenkov b36d7f9
Small changes to select the GPU benchmark
iomaganaris cab4fbf
Removed setting module datalayout and triple in CUDADriver
iomaganaris 4d6f047
Merge branch 'georgemitenkov/llvm-gpu-passes' into magkanar/gpu-runne…
iomaganaris afa14da
Added closing parenthesis and made sm_70 default subtarget
georgemitenkov 002e79a
Make sure that benchmark is only running for CUDA backends and restri…
iomaganaris a3fe976
Merge branch 'georgemitenkov/llvm-gpu-passes' into magkanar/gpu-runne…
iomaganaris 7524375
[LLVM][GPU] NVPTX specific passes for code generation (#833)
georgemitenkov 93eba6e
Use kernel bitcode for GPU compilation via NVVM
iomaganaris 9f1b2bf
Merge branch 'llvm' into magkanar/gpu-runner
iomaganaris 55ef3c0
Fix cmake way to find nvvm
iomaganaris 8e18915
Rename target-chip option to target-arch
iomaganaris 19aee68
Handle grid and block dim CLI options
iomaganaris f13881f
Removed unneeded GPU execution options
iomaganaris 4df56f0
Cleared up benchmark instantiation in main function
iomaganaris ab99063
Improved reading logs from nvvm compiler
iomaganaris 2da743b
Removed duplicated code from LLVMBenchmark
iomaganaris eec1dff
Removed backend name from CUDADriver init
iomaganaris 412dc0f
More cleanup of gpu name
iomaganaris 997a2d0
Refactor cuda kernel execution to avoid code duplication
iomaganaris b2ea423
Small fixes for non-CUDA backend compilation
iomaganaris a66d155
Fix wrapper issue on GPU
iomaganaris 4743361
Print async execution error on GPU
iomaganaris cd978f3
Added documentation for running the GPU benchmark
iomaganaris d6adc1f
Mention CMake 3.18 dependency
iomaganaris a12a776
Working CUDA JIT
iomaganaris 8ff894c
Cleared up NVVM code
iomaganaris 7b00e25
Revert setting kernel attributes on GPU backend code
iomaganaris 882d33c
Revert "Use cmake 3.18 in the CI"
iomaganaris a7954a4
Roll back to CMake 3.17
iomaganaris 512f2ca
Improve CUDA JIT logs
iomaganaris b39eab3
Link with libdevice
iomaganaris 38e8370
Mention CMake 3.17 in INSTALL.md
iomaganaris 8c46edf
Make clang-format happy
iomaganaris bceeba1
Free not needed char* and print ll file generated for benchmark
iomaganaris 854d2d5
Clear nvvm.annotations and update them for the wrapper function so th…
iomaganaris 9ee3d92
Handle wrapper and kernel nvvm annotations properly
iomaganaris 8cc39cb
Update INSTALL.md
iomaganaris 86b8917
Testing benchmarks in gitlab CI
iomaganaris 3b0781b
Use deployed CUDA 11.6.0 and fix allocation
iomaganaris 4af4e27
Small fix in spack variant
iomaganaris 9197429
Fix allocation
iomaganaris 7a1a599
Fix bb5 constraint
iomaganaris dde8b4b
Load nmodl with spack
iomaganaris e9263d8
Fix GPU execution configuration in the benchmark
iomaganaris b8fb7fd
Merge branch 'llvm' into magkanar/benchmark
iomaganaris de59880
Updated script to execute the benchmarks
iomaganaris 9bd6315
[LLVM] Code formatting changes (#838)
iomaganaris 6c3fe22
[LLVM][GPU][+refactoring] Replacement of math intrinsics with library…
georgemitenkov 7090c5e
Merge branch 'llvm' into magkanar/gpu-runner
iomaganaris dba0cd4
Replace simple integration test for the math libraries in LLVM benchmark
iomaganaris 951c814
Added log function and test
iomaganaris 142a4c0
Small fix in log replacement funcs
iomaganaris 9f34e75
Add log in the test mod file
iomaganaris 3118f78
Update hpc-coding-conventions
iomaganaris f85b0d1
Fix clang format
iomaganaris 84304ab
Disable addition of debug symbols in GPU code
iomaganaris 7bca898
Added sleef and svml math libs in nmodl jit executions
iomaganaris ec9fac8
Merge remote-tracking branch 'origin/magkanar/gpu-runner' into magkan…
iomaganaris 1519871
Added GPU execution in script and ncu option
iomaganaris eae47e3
Removed loading git module
iomaganaris 570c9b7
Improved condition declaration of cuda driver according to Pramod's c…
iomaganaris c154efb
JIT invocation from python for benchmarks (#832)
a1dede6
Small fixes for output
iomaganaris 91a6b06
Merge branch 'llvm' into magkanar/gpu-runner
iomaganaris 5ff83db
Added ability to run GPU jit from python
iomaganaris 90445f6
Added hh.mod file for unit test of pyjit
iomaganaris 6ebdf7b
Use the integrated tests in the gitlab CI to test the GPU jit as well
iomaganaris b273e60
Throw better error if CUDA_HOME is not set in benchmarking script
iomaganaris 690ffab
Fix CUDA_HOME path and make cmake-format happy
iomaganaris 64e8cee
Fixes issue with debug printing of visitors (#854)
iomaganaris 5952a87
Support for Breakpoint block (nrn_cur) for code generation (#645)
pramodk 261677a
Copy memory to the GPU explicitly
iomaganaris f0bc5cd
Merge branch 'llvm' into magkanar/gpu-runner
iomaganaris d6d419a
Rearrange vec_rhs and vec_d to allocate memory properly (#856)
iomaganaris 984933b
Use hh.mod from CoreNEURON for the benchmark test and enable inlining…
iomaganaris d7615af
Cleaned up llvm_ir and llvm_backend since there were 2 variables for …
iomaganaris a8a44ed
Added arg parsing in benchmark script and added expsyn.mod test
iomaganaris 2594854
Replace fabs with the libdevice corresponding function
iomaganaris f970ac4
Disable expsyn test on GPU because atomic instructions are not yet su…
iomaganaris 283c833
Working test passing explicitly results back and forth of the GPU
iomaganaris c0e8f31
Clean comments and debug prints
iomaganaris a5b7179
Make clang-format happy
iomaganaris 523d9cf
Merge branch 'magkanar/gpu-runner' into magkanar/benchmark_llvm_gpu_e…
iomaganaris 3c81509
Small changes to handle external kernel and fixes in the script
iomaganaris 95782bc
[LLVM][GPU] Added CUDADriver to execute benchmark on GPU (#829)
iomaganaris 0fd410e
Merge branch 'llvm' into magkanar/benchmark_llvm_gpu_explicit
iomaganaris ebe560b
Fixed compute-bound and memory-bound mod files for PyJIT execution
iomaganaris e4e187a
Avoid code duplication for running external kernel
iomaganaris 834a8d1
Merge branch 'llvm' into magkanar/benchmark_llvm_gpu_explicit
iomaganaris 3ad529e
Fixed kernels for JIT execution of nrn_cur
iomaganaris f2f4043
Small fixes after merge
iomaganaris ed923e3
Merge branch 'magkanar/benchmark_llvm_gpu_explicit' of github.com:Blu…
iomaganaris 1f9887f
Only compile GPU memory transfers when NMODL_LLVM_CUDA option is enabled
iomaganaris 0353c9c
Small fix for cuda related functions
iomaganaris a821bdf
Merge branch 'llvm' into magkanar/benchmark_llvm_gpu_explicit
iomaganaris 750fd6a
Merge branch 'llvm' into magkanar/benchmark_llvm_gpu_explicit
iomaganaris 1475efc
Fix missing fast_math option for llvm jit
iomaganaris 583911b
[LLVM] Adding python script for benchmarking (#874)
iomaganaris 9764dbb
Merge branch 'llvm' into magkanar/benchmark_llvm_gpu_explicit
iomaganaris 8d06bbf
Mention llvm branch in PAD and Dockerfiles
iomaganaris 591923a
Disable debug symbols in nvptx64 JIT runs due to PTX ISA error
iomaganaris 475a571
Added which branch to clone in the readme for the gpu docker runtime …
iomaganaris 23eb5e8
Added some small changes in the PAD text
iomaganaris 896ffd0
Small exmplanation regarding install.sh
iomaganaris 2b8fc56
Fix GPU regression
iomaganaris 70d0dc0
Updated readme
iomaganaris f60ac4e
Updated PAD file according to the submission
iomaganaris e5e010b
Small fixes in the readme file
iomaganaris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
|
||
# MOD2IR: High-Performance Code Generation for a Biophysically Detailed Neuronal Simulation DSL | ||
|
||
## Preliminary Artifact Description | ||
|
||
### Broad Description | ||
|
||
This artifact provides all the necessary code, scripts and results to compile the NMODL transpiler | ||
with the MOD2IR extension and run all benchmarks described in the manuscript. To simplify the | ||
evaluation process we provide along with the instructions a Dockerfile that will setup a viable | ||
system for the benchmarks. The driver script compiles the membrane mechanism model `hh.mod` and the | ||
synapse mechanism model `expsyn.mod` with various compile-time configurations and then runs the | ||
generated binaries comparing their runtimes. More specifically the benchmark compares the execution | ||
runtime of the binaries generated via the two-step compilation process MOD-C++-binary using various | ||
open-source and commercial compiler frameworks with the one-step ahead-of-time and just-in-time | ||
processes of MOD2IR. | ||
MOD2IR is implemented as a code generation backend inside the NMODL Framework and it makes heavy | ||
use of the LLVM IR and compilation passes. Most of the relevant code of the described work can be | ||
found [here](https://github.com/BlueBrain/nmodl/tree/llvm/src/codegen/llvm) and | ||
[here](https://github.com/BlueBrain/nmodl/tree/llvm/test/benchmark). The intructions to reproduce | ||
georgemitenkov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
the results can be found [here](https://github.com/BlueBrain/nmodl/blob/llvm/docs/CC2023/README.md). | ||
georgemitenkov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Badge | ||
|
||
Blue Badge (results validated). We hope that using the provided Dockerfile and scripts the | ||
georgemitenkov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
evaluators should be able to fully build our code and reproduce our benchmark setup as well as | ||
obtain benchmarking results. Please note that in all likelihood the obtained runtimes by the | ||
evaluators will slightly differ from the presented results in the paper as they heavily depend on | ||
the used hardware and system software. We believe, however, that the results should nevertheless be | ||
qualitiatively the same as the ones we have presented. | ||
georgemitenkov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Hardware requisites | ||
|
||
The provided artifact can in theory be run on any x86 hardware platform. For the prupose of closely | ||
georgemitenkov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
reproducing our benchmark results it is required a workstation (or cloud instance) with Intel Xeon | ||
Skylake (or newer) CPU that supports AVX-512 instructions and an NVIDIA Volta V100 (or newer) GPU. | ||
All benchmark runs are single-core and have relatively low memory-requirement. For building or running | ||
the Docker image (and more specifically the NMODL Framework) we, however, recommend a system with plenty | ||
of cores, at least 32GB of RAM available and 20 GB of disk space. | ||
|
||
### Software requisites | ||
|
||
Any reasonably up-to-date Linux system with Docker should be sufficient. If GPU results are to be | ||
reproduced, an up-to-date CUDA (11.0 or newer) should be present. | ||
|
||
|
||
### Expectations | ||
|
||
We expect that all setup and benchmarks can be completed within one working day. The expected time for | ||
building or pulling the docker image is around 10 minutes using a modern multicore system with a stable | ||
internet connection. The expected runtime of the benchmarks is around 5 hours. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
|
||
# MOD2IR: High-Performance Code Generation for a Biophysically Detailed Neuronal Simulation DSL | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that the attachment of the artifact can be only this file? Or should we provide the docker image as well? |
||
|
||
Please refer to the PAD.md file for an overview and necessary prerequisites. | ||
|
||
## Benchmarking Instructions | ||
|
||
To reproduce as closely as possible our environment and to lower the burden of the | ||
installation of the different compilers and libraries we have created Docker images which take | ||
care of installing all the necessary packages and compilers to install MOD2IR and execute the | ||
benchmarks. | ||
Due to technical restrictions imposed by Docker to execute a Docker image and be able to execute | ||
applications on NVIDIA GPUs there are some extra steps needed. For this reason we have created two | ||
different `Dockerfile`s, one that takes care of both the CPU and GPU benchmarks and one for CPU only | ||
execution if there is no NVIDIA GPU available in the test system. | ||
|
||
### CPU and GPU docker image | ||
|
||
The image that targets both CPU and GPU can be found in `test/benchmark/gpu_docker/Dockerfile`. | ||
To launch the Docker image you can execute the following: | ||
|
||
``` | ||
git clone -b llvm https://github.com/BlueBrain/nmodl.git | ||
cd nmodl/test/benchnark/gpu_docker # Enter the directory that contains the Dockerfile (based on Ubuntu 22.04 but with small changes in should be supported by any Ubuntu version or other linux distributions) | ||
bash install_gpu_docker_env.sh # Installs docker and NVIDIA docker runtime (needs sudo permission) | ||
docker run -it -v $PWD:/opt/mount --gpus all bluebrain/nmodl:mod2ir-gpu-benchmark # Execute docker image (~16GB) | ||
``` | ||
|
||
After building and launching the docker file we can now execute the benchmarks and generate the same | ||
plots as the ones we included in the paper with the new results along the reference plots from the paper. | ||
To do this we need to execute the following two scripts inside the docker image environment: | ||
|
||
``` | ||
cd nmodl/test/benchmark # Enter the directory where the scripts are inside the docker image | ||
bash run_benchmark_script_cpu_gpu.sh # Runs all the benchmarks on CPU and GPU | ||
python3 plot_benchmarks_cpu_gpu.py # Generate the plots based on the outputs of the previous script | ||
cp -r graphs_output_pandas /opt/mount # Copy the graphs from the docker image to your environment | ||
``` | ||
|
||
Executing `run_benchmark_script_dockerfile.sh` will generate two pickle files that include the results | ||
in `hh_expsyn_cpu/benchmark_results.pickle` for the CPU benchmarks and `hh_expsyn_gpu/benchmark_results.pickle` | ||
for the GPU benchmarks. Those will then be loaded by `plot_benchmarks.py` to generate the plots. | ||
Now you can exit the docker image terminal and open the above files which exist in your local directory. | ||
|
||
|
||
### CPU only docker image | ||
|
||
In case there is no GPU available instead of running the above Docker container you can also run a | ||
CPU only container. | ||
To do this you need to: | ||
|
||
``` | ||
cd test/benchnark/cpu_docker # Enter the directory that contains the Dockerfile | ||
georgemitenkov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
docker run -it -v $PWD:/opt/mount bluebrain/nmodl:mod2ir-cpu-benchmark # Execute docker image (~16GB) | ||
``` | ||
|
||
Then inside the docker shell: | ||
|
||
``` | ||
cd nmodl/test/benchmark # Enter the directory where the scripts are inside the docker image | ||
bash run_benchmark_script_cpu_only.sh # Runs all the benchmarks on CPU | ||
python3 plot_benchmarks_cpu_only.py # Generate the plots based on the outputs of the previous script | ||
cp -r graphs_output_pandas /opt/mount # Copy the graphs from the docker image to your environment | ||
``` | ||
|
||
By executing `run_benchmark_script_cpu_only.sh` there will be only `hh_expsyn_cpu/benchmark_results.pickle` | ||
generated containing the CPU results. | ||
|
||
|
||
## Notes | ||
|
||
1. Acceleration results with `GCC` compiler might be better in the docker container than the paper | ||
due to the newer OS we're using in the Dockerfile. Latest Ubuntu versions come with GLIBC 2.3x that | ||
includes `libmvec` which provides vectorized implementations to the `GCC` compiler enabling the | ||
vectorization of the kernels even without providing the `SVML` library to `GCC`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason with only this branch I get the following:
v1.0-alpha-llvm
is the lastNMODL
tag