Skip to content
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 355 commits into from
Jan 2, 2023
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
355 commits
Select commit Hold shift + click to select a range
8fa6225
Improved output
iomaganaris Jun 4, 2021
ee91aaa
Fixed compilers
iomaganaris Jun 4, 2021
9286bac
Changes for Ioannis script
pramodk Jun 6, 2021
a5a259f
Updated script and hh.cpp
iomaganaris Jun 7, 2021
a02dfa6
Small fix in openmp flags
iomaganaris Jun 8, 2021
a23b1ed
Disable python bindings for faster build
pramodk Nov 27, 2020
6698213
Integrate LLVM into CMake build system
pramodk Nov 28, 2020
c73d83d
Code infrastructure for LLVM code generation backend
pramodk Nov 28, 2020
c7c6e40
Azure CI fixes for LLVM build and README update
pramodk Nov 28, 2020
6cf8320
Print build status after cmake configure stage
pramodk Nov 29, 2020
d32e2a3
Adding test template for LLVM codegen
pramodk Nov 29, 2020
01001df
Initial LLVM codegen vistor routines (#457)
georgemitenkov Dec 22, 2020
c8ee79b
FunctionBlock code generation and terminator checks (#470)
georgemitenkov Dec 25, 2020
f70c4d2
Add option to run LLVM optimisation passes (#471)
pramodk Dec 28, 2020
de33088
Add function call LLVM code generation (#477)
georgemitenkov Dec 30, 2020
d0fe34d
Support for IndexedName codegen (#478)
georgemitenkov Dec 30, 2020
c79689a
Improvements for code generation specific transformations (#483)
pramodk Jan 6, 2021
3115a32
nrn_state function generation in NMODL AST to help LLVM codegen (#484)
pramodk Jan 6, 2021
92eae90
Running functions from MOD files via LLVM JIT (#482)
georgemitenkov Jan 8, 2021
5698fd7
Extended support for binary ops and refactoring (#489)
georgemitenkov Jan 12, 2021
a171af1
Avoid converting LOCAL statement in all StatementBlocks (#492)
pramodk Jan 12, 2021
0eab81c
Handle CodegenVarType type in JSON printer (#494)
pramodk Jan 13, 2021
183acbe
Integrating LLVM helper into LLVM visitor (#497)
georgemitenkov Jan 25, 2021
0bf5e9b
LLVM code generation for if/else statements (#499)
georgemitenkov Jan 25, 2021
5d7f2ef
Added error handling for values not in scope (#502)
georgemitenkov Jan 26, 2021
bb82934
Added support for WHILE statement (#501)
georgemitenkov Jan 26, 2021
0dd8f72
Create mechanism instance struct in LLVM IR (#507)
iomaganaris Feb 1, 2021
11a186e
Printf support in LLVM IR codegen (#510)
georgemitenkov Feb 3, 2021
fa01b01
Fix issue error: ‘runtime_error’ is not a member of ‘std’ (#512)
iomaganaris Feb 15, 2021
748bfef
Move code gen specific InstanceStruct node to codegen.yaml (#526)
pramodk Mar 5, 2021
7c8e16f
* Improvements to codegen helper (Part I)
pramodk Feb 27, 2021
06e2744
Addressing TODOs for Instance struct (#533) Part II
georgemitenkov Mar 6, 2021
d435500
Unit test for scalar state kernel generation in LLVM (#547)
georgemitenkov Mar 9, 2021
660cd31
Indexed name codegen improvements (#550)
georgemitenkov Mar 12, 2021
1643f7d
Add InstanceStruct test data generation helper and unit test (#546)
iomaganaris Mar 13, 2021
46133d0
Add the remainder loop for vectorization of DERIVATIVE block (#534)
Mar 17, 2021
a72e2f2
Always initialize return variable in function block (#554)
Mar 19, 2021
99d6a03
Running a kernel with NMODL-LLVM JIT (#549)
georgemitenkov Apr 9, 2021
d134ad4
Loop epilogue fix for LLVM visitor helper (#567)
georgemitenkov Apr 9, 2021
2b4a7b7
Gather support and vectorisation fixes for LLVM code generation (#568)
georgemitenkov Apr 10, 2021
ecebcc0
Verification and file utilities for LLVM IR codegen (#582)
georgemitenkov Apr 13, 2021
4c13787
Add gather execution test (#591)
georgemitenkov Apr 16, 2021
566ea70
Fixed loop allocations (#590)
georgemitenkov Apr 17, 2021
0c2cfc3
Benchmarking LLVM code generation (#583)
georgemitenkov Apr 17, 2021
72feb65
Minor benchmarking improvement (#593)
pramodk Apr 18, 2021
c372e46
Bug fix in codegen helper: delete LOCAL statement (#595)
pramodk Apr 19, 2021
ebb155e
LLVM 13 compatibility and fixing void* type (#603)
georgemitenkov Apr 20, 2021
31b95d8
Allow LOCAL variable inside StatementBlock for LLVM IR generation (#599)
pramodk Apr 20, 2021
c71b368
Update CI with LLVM v13 (trunk) (#605)
pramodk Apr 22, 2021
63a662e
Integrating vector maths library into LLVM codegen (#604)
georgemitenkov Apr 22, 2021
b22afdc
Using shared libraries in LLVM JIT (#609)
georgemitenkov Apr 22, 2021
baf95f0
Avoid local std::ofstream object causing segfault (#614)
pramodk Apr 24, 2021
272ffc5
Refactoring of runners' infrastructure and dumping object files (#620)
georgemitenkov Apr 30, 2021
3a8b8ff
Optimisation levels for benchmarking (#623)
georgemitenkov May 7, 2021
8f2501c
Adding function debug information (#628)
georgemitenkov May 8, 2021
3db4535
Fixed using benchmarking_info in TestRunner (#631)
georgemitenkov May 8, 2021
33631b9
Fixed addition of SOLVE block to kernel's FOR loop (#636)
georgemitenkov May 11, 2021
05b1821
IR builder redesign for LLVM IR code generation pipeline (#634)
georgemitenkov May 13, 2021
1e4809e
Fixed initialisation of `CodegenAtomicStatement` (#642)
georgemitenkov May 13, 2021
07fe468
Fix instance struct data generation for testing/benchmarking (#641)
pramodk May 13, 2021
f7017a7
Basic scatter support (#643)
georgemitenkov May 13, 2021
38c61bf
Benchmarking code re-organisation and minor improvements (#647)
pramodk May 16, 2021
bb3ecd0
Added attributes and metadata to LLVM IR compute kernels (#648)
georgemitenkov May 17, 2021
167c23c
Added loaded value to the stack (#655)
georgemitenkov May 18, 2021
a02a8d0
Basic predication support for LLVM backend (#652)
georgemitenkov May 20, 2021
999bf36
Improvements for LLVM code generation and benchmarking (#661)
georgemitenkov May 20, 2021
2142e2d
Fixed `alloca`s insertion point for LLVM backend (#663)
georgemitenkov May 20, 2021
6d4743b
Fast math flags for LLVM backend (#662)
georgemitenkov May 21, 2021
e752afd
Avoid generating LLVM IR for Functions and Procedures if inlined (#664)
iomaganaris May 21, 2021
9ece2e9
Fixed typo in benchmarking metrics (#665)
georgemitenkov May 21, 2021
468b3d1
Remove only inlined blocks from AST based on symtab properties (#668)
iomaganaris May 21, 2021
47e3c4a
Use VarName on the RHS of assignment expression (#669)
pramodk May 25, 2021
af7540c
[LLVM] SLEEF and libsystem_m vector libraries support (#674)
georgemitenkov May 30, 2021
19ad02a
[LLVM] Enhancements for optimization pipeline (#683)
georgemitenkov Jun 3, 2021
8306736
[LLVM] Added saving to file utility (#685)
georgemitenkov Jun 3, 2021
24908e2
[LLVM] Aliasing and `cpu` options for LLVM visitor and the benchmark …
georgemitenkov Jun 3, 2021
f721890
Fix azure yaml pipeline from merge (#687)
pramodk Jun 3, 2021
ff5430c
[LLVM] Support for newer versions of LLVM APIs
georgemitenkov Mar 8, 2022
c80a44d
Fix build issues for the rebased branch
pramodk Mar 8, 2022
de3a8be
[LLVM] Allocate InstanceStruct on the GPU using cudaMallocManaged (#815)
iomaganaris Mar 10, 2022
ad81954
[LLVM][GPU] Separated CPU and GPU CLI options
georgemitenkov Mar 11, 2022
3992315
[LLVM][refactoring] Added platform abstraction
georgemitenkov Mar 12, 2022
d4e12d0
[LLVM][GPU] Added GPU-specific AST transformations
georgemitenkov Mar 12, 2022
9940fd8
fixed comments
georgemitenkov Mar 12, 2022
196a5a3
Added code generation for thread id
georgemitenkov Mar 13, 2022
7044204
Added kernel annotation generation
georgemitenkov Mar 13, 2022
9351e39
Added tests for annotations/intrinsics
georgemitenkov Mar 13, 2022
e26d961
Removed POINTER compatibility error (#821)
iomaganaris Mar 14, 2022
b93ce12
[LLVM][GPU] Separated CPU and GPU CLI options (#817)
georgemitenkov Mar 14, 2022
acb9dea
[LLVM][refactoring] Added platform abstraction
georgemitenkov Mar 12, 2022
0907d3b
[LLVM][GPU] Added GPU-specific AST transformations
georgemitenkov Mar 12, 2022
b4943fd
fixed comments
georgemitenkov Mar 12, 2022
06deff9
Added code generation for thread id
georgemitenkov Mar 13, 2022
b506574
Added kernel annotation generation
georgemitenkov Mar 13, 2022
d097cf0
Added tests for annotations/intrinsics
georgemitenkov Mar 13, 2022
98184f1
[LLVM][refactoring] Added platform abstraction (#818)
georgemitenkov Mar 15, 2022
ad58356
[LLVM][GPU] Added GPU-specific AST transformations
georgemitenkov Mar 12, 2022
0530417
fixed comments
georgemitenkov Mar 12, 2022
1d4117a
Initial work for gpu runner
iomaganaris Mar 15, 2022
d0d1051
Compile module and load it in the GPUJITDriver
iomaganaris Mar 16, 2022
35e46fe
Get rid of one unnecessary shared_ptr (#826) (#827)
Mar 16, 2022
b9b1418
more changes to support gpu execution
iomaganaris Mar 17, 2022
7e9484d
Template BaseRunner
iomaganaris Mar 18, 2022
9f4a142
Fixed compilation issues with templates
iomaganaris Mar 18, 2022
d515961
More small fixes
iomaganaris Mar 18, 2022
b69f2c7
Separated CUDADriver from JITDriver files
iomaganaris Mar 18, 2022
0882fc3
Small fixes and setting the compute arch in options
iomaganaris Mar 18, 2022
0ec0826
Tried workflow with test kernel and linking with libdevice
iomaganaris Mar 21, 2022
0f72a74
Make clang-format happy and only compile gpu benchmark if cuda backen…
iomaganaris Mar 21, 2022
881d85e
Improved a bit logs
iomaganaris Mar 21, 2022
a1af210
Merge branch 'georgemitenkov/llvm-gpu-codegen' into magkanar/gpu-runner
iomaganaris Mar 21, 2022
7de726c
Added newline in EOF
iomaganaris Mar 21, 2022
18df661
Use cmake 3.18 in the CI
iomaganaris Mar 21, 2022
7aceb5b
Added optimization option and printing PTX to file
iomaganaris Mar 21, 2022
d0af9b4
Use the kernel real name in nvvm anotation in the generated LLVM IR
iomaganaris Mar 21, 2022
44b7f00
Revert "Use the kernel real name in nvvm anotation in the generated L…
iomaganaris Mar 21, 2022
8bdefb9
Replaced IF with FOR loop
georgemitenkov Mar 22, 2022
2c57d4d
Added code generation for thread id
georgemitenkov Mar 13, 2022
97e3940
Added kernel annotation generation
georgemitenkov Mar 13, 2022
dbd8cc9
Added tests for annotations/intrinsics
georgemitenkov Mar 13, 2022
b562d19
Addapted code generation for GPU expressions
georgemitenkov Mar 22, 2022
483b363
Fixed lists of supported statements
georgemitenkov Mar 22, 2022
f874146
[LLVM][GPU] Added GPU-specific AST transformations (#819)
georgemitenkov Mar 22, 2022
e108525
Merge branch 'llvm' into georgemitenkov/llvm-gpu-codegen
pramodk Mar 22, 2022
295fa25
fix merge issue: gpu code generation is now enabled by this PR
pramodk Mar 22, 2022
d29d0bc
Merge branch 'georgemitenkov/llvm-gpu-codegen' into magkanar/gpu-runner
iomaganaris Mar 22, 2022
400aaec
Small fix from merge
iomaganaris Mar 22, 2022
b3de1e1
[LLVM][GPU] Basic code generation for NVPTX backend (#820)
georgemitenkov Mar 22, 2022
fad728d
More changes to make the LLVM IR generated by NMODL executed on GPU
iomaganaris Mar 23, 2022
68cce1a
Merge branch 'llvm' into magkanar/gpu-runner
iomaganaris Mar 23, 2022
26161f9
Small cleanup
iomaganaris Mar 23, 2022
d68671e
Print kernel wrappers and nrn_init based on Instance Struct (#551)
iomaganaris Mar 23, 2022
b6463d3
Added NVPTX-specific optimization passes for PTX generation
georgemitenkov Mar 24, 2022
a1513f8
Added tests
georgemitenkov Mar 24, 2022
cf459d4
Merge branch 'llvm' into magkanar/gpu-runner
iomaganaris Mar 24, 2022
af5ed38
Print LLVM IR to file once
iomaganaris Mar 24, 2022
90a7443
Merge branch 'georgemitenkov/llvm-gpu-passes' into magkanar/gpu-runne…
iomaganaris Mar 24, 2022
fba92e2
Changes to generate proper code
iomaganaris Mar 24, 2022
b42ebe7
Addressed comments for GPU code generation
georgemitenkov Mar 25, 2022
a2ef4a6
Added missing include
georgemitenkov Mar 25, 2022
cd2921e
Merge branch 'georgemitenkov/llvm-gpu-passes' into magkanar/gpu-runne…
iomaganaris Mar 28, 2022
cb3547a
Replaced `find()` with `at()` when querying target information
georgemitenkov Mar 28, 2022
b36d7f9
Small changes to select the GPU benchmark
iomaganaris Mar 28, 2022
cab4fbf
Removed setting module datalayout and triple in CUDADriver
iomaganaris Mar 28, 2022
4d6f047
Merge branch 'georgemitenkov/llvm-gpu-passes' into magkanar/gpu-runne…
iomaganaris Mar 28, 2022
afa14da
Added closing parenthesis and made sm_70 default subtarget
georgemitenkov Mar 28, 2022
002e79a
Make sure that benchmark is only running for CUDA backends and restri…
iomaganaris Mar 28, 2022
a3fe976
Merge branch 'georgemitenkov/llvm-gpu-passes' into magkanar/gpu-runne…
iomaganaris Mar 28, 2022
7524375
[LLVM][GPU] NVPTX specific passes for code generation (#833)
georgemitenkov Mar 28, 2022
93eba6e
Use kernel bitcode for GPU compilation via NVVM
iomaganaris Mar 28, 2022
9f1b2bf
Merge branch 'llvm' into magkanar/gpu-runner
iomaganaris Mar 28, 2022
55ef3c0
Fix cmake way to find nvvm
iomaganaris Mar 29, 2022
8e18915
Rename target-chip option to target-arch
iomaganaris Mar 29, 2022
19aee68
Handle grid and block dim CLI options
iomaganaris Mar 29, 2022
f13881f
Removed unneeded GPU execution options
iomaganaris Mar 29, 2022
4df56f0
Cleared up benchmark instantiation in main function
iomaganaris Mar 29, 2022
ab99063
Improved reading logs from nvvm compiler
iomaganaris Mar 29, 2022
2da743b
Removed duplicated code from LLVMBenchmark
iomaganaris Mar 29, 2022
eec1dff
Removed backend name from CUDADriver init
iomaganaris Mar 29, 2022
412dc0f
More cleanup of gpu name
iomaganaris Mar 29, 2022
997a2d0
Refactor cuda kernel execution to avoid code duplication
iomaganaris Mar 29, 2022
b2ea423
Small fixes for non-CUDA backend compilation
iomaganaris Mar 29, 2022
a66d155
Fix wrapper issue on GPU
iomaganaris Mar 29, 2022
4743361
Print async execution error on GPU
iomaganaris Mar 29, 2022
cd978f3
Added documentation for running the GPU benchmark
iomaganaris Mar 29, 2022
d6adc1f
Mention CMake 3.18 dependency
iomaganaris Mar 29, 2022
a12a776
Working CUDA JIT
iomaganaris Mar 31, 2022
8ff894c
Cleared up NVVM code
iomaganaris Mar 31, 2022
7b00e25
Revert setting kernel attributes on GPU backend code
iomaganaris Mar 31, 2022
882d33c
Revert "Use cmake 3.18 in the CI"
iomaganaris Mar 31, 2022
a7954a4
Roll back to CMake 3.17
iomaganaris Mar 31, 2022
512f2ca
Improve CUDA JIT logs
iomaganaris Mar 31, 2022
b39eab3
Link with libdevice
iomaganaris Mar 31, 2022
38e8370
Mention CMake 3.17 in INSTALL.md
iomaganaris Mar 31, 2022
8c46edf
Make clang-format happy
iomaganaris Mar 31, 2022
bceeba1
Free not needed char* and print ll file generated for benchmark
iomaganaris Apr 1, 2022
854d2d5
Clear nvvm.annotations and update them for the wrapper function so th…
iomaganaris Apr 1, 2022
9ee3d92
Handle wrapper and kernel nvvm annotations properly
iomaganaris Apr 1, 2022
8cc39cb
Update INSTALL.md
iomaganaris Apr 1, 2022
86b8917
Testing benchmarks in gitlab CI
iomaganaris Apr 1, 2022
3b0781b
Use deployed CUDA 11.6.0 and fix allocation
iomaganaris Apr 4, 2022
4af4e27
Small fix in spack variant
iomaganaris Apr 4, 2022
9197429
Fix allocation
iomaganaris Apr 4, 2022
7a1a599
Fix bb5 constraint
iomaganaris Apr 4, 2022
dde8b4b
Load nmodl with spack
iomaganaris Apr 4, 2022
e9263d8
Fix GPU execution configuration in the benchmark
iomaganaris Apr 4, 2022
b8fb7fd
Merge branch 'llvm' into magkanar/benchmark
iomaganaris Apr 4, 2022
de59880
Updated script to execute the benchmarks
iomaganaris Apr 4, 2022
9bd6315
[LLVM] Code formatting changes (#838)
iomaganaris Apr 5, 2022
6c3fe22
[LLVM][GPU][+refactoring] Replacement of math intrinsics with library…
georgemitenkov Apr 8, 2022
7090c5e
Merge branch 'llvm' into magkanar/gpu-runner
iomaganaris Apr 8, 2022
dba0cd4
Replace simple integration test for the math libraries in LLVM benchmark
iomaganaris Apr 8, 2022
951c814
Added log function and test
iomaganaris Apr 8, 2022
142a4c0
Small fix in log replacement funcs
iomaganaris Apr 8, 2022
9f34e75
Add log in the test mod file
iomaganaris Apr 8, 2022
3118f78
Update hpc-coding-conventions
iomaganaris Apr 8, 2022
f85b0d1
Fix clang format
iomaganaris Apr 8, 2022
84304ab
Disable addition of debug symbols in GPU code
iomaganaris Apr 12, 2022
7bca898
Added sleef and svml math libs in nmodl jit executions
iomaganaris Apr 20, 2022
ec9fac8
Merge remote-tracking branch 'origin/magkanar/gpu-runner' into magkan…
iomaganaris Apr 20, 2022
1519871
Added GPU execution in script and ncu option
iomaganaris Apr 26, 2022
eae47e3
Removed loading git module
iomaganaris Apr 27, 2022
570c9b7
Improved condition declaration of cuda driver according to Pramod's c…
iomaganaris Apr 27, 2022
c154efb
JIT invocation from python for benchmarks (#832)
Apr 27, 2022
a1dede6
Small fixes for output
iomaganaris Apr 27, 2022
91a6b06
Merge branch 'llvm' into magkanar/gpu-runner
iomaganaris Apr 27, 2022
5ff83db
Added ability to run GPU jit from python
iomaganaris Apr 27, 2022
90445f6
Added hh.mod file for unit test of pyjit
iomaganaris Apr 27, 2022
6ebdf7b
Use the integrated tests in the gitlab CI to test the GPU jit as well
iomaganaris Apr 27, 2022
b273e60
Throw better error if CUDA_HOME is not set in benchmarking script
iomaganaris Apr 28, 2022
690ffab
Fix CUDA_HOME path and make cmake-format happy
iomaganaris Apr 28, 2022
64e8cee
Fixes issue with debug printing of visitors (#854)
iomaganaris Apr 29, 2022
5952a87
Support for Breakpoint block (nrn_cur) for code generation (#645)
pramodk May 2, 2022
261677a
Copy memory to the GPU explicitly
iomaganaris May 2, 2022
f0bc5cd
Merge branch 'llvm' into magkanar/gpu-runner
iomaganaris May 2, 2022
d6d419a
Rearrange vec_rhs and vec_d to allocate memory properly (#856)
iomaganaris May 3, 2022
984933b
Use hh.mod from CoreNEURON for the benchmark test and enable inlining…
iomaganaris May 3, 2022
d7615af
Cleaned up llvm_ir and llvm_backend since there were 2 variables for …
iomaganaris May 3, 2022
a8a44ed
Added arg parsing in benchmark script and added expsyn.mod test
iomaganaris May 3, 2022
2594854
Replace fabs with the libdevice corresponding function
iomaganaris May 3, 2022
f970ac4
Disable expsyn test on GPU because atomic instructions are not yet su…
iomaganaris May 3, 2022
283c833
Working test passing explicitly results back and forth of the GPU
iomaganaris May 3, 2022
c0e8f31
Clean comments and debug prints
iomaganaris May 3, 2022
a5b7179
Make clang-format happy
iomaganaris May 3, 2022
523d9cf
Merge branch 'magkanar/gpu-runner' into magkanar/benchmark_llvm_gpu_e…
iomaganaris May 3, 2022
3c81509
Small changes to handle external kernel and fixes in the script
iomaganaris May 3, 2022
95782bc
[LLVM][GPU] Added CUDADriver to execute benchmark on GPU (#829)
iomaganaris May 9, 2022
0fd410e
Merge branch 'llvm' into magkanar/benchmark_llvm_gpu_explicit
iomaganaris May 10, 2022
ebe560b
Fixed compute-bound and memory-bound mod files for PyJIT execution
iomaganaris May 10, 2022
e4e187a
Avoid code duplication for running external kernel
iomaganaris May 10, 2022
834a8d1
Merge branch 'llvm' into magkanar/benchmark_llvm_gpu_explicit
iomaganaris May 17, 2022
3ad529e
Fixed kernels for JIT execution of nrn_cur
iomaganaris May 17, 2022
f2f4043
Small fixes after merge
iomaganaris May 17, 2022
ed923e3
Merge branch 'magkanar/benchmark_llvm_gpu_explicit' of github.com:Blu…
iomaganaris May 19, 2022
1f9887f
Only compile GPU memory transfers when NMODL_LLVM_CUDA option is enabled
iomaganaris May 19, 2022
0353c9c
Small fix for cuda related functions
iomaganaris May 19, 2022
a821bdf
Merge branch 'llvm' into magkanar/benchmark_llvm_gpu_explicit
iomaganaris May 19, 2022
750fd6a
Merge branch 'llvm' into magkanar/benchmark_llvm_gpu_explicit
iomaganaris May 19, 2022
1475efc
Fix missing fast_math option for llvm jit
iomaganaris May 20, 2022
583911b
[LLVM] Adding python script for benchmarking (#874)
iomaganaris Dec 26, 2022
9764dbb
Merge branch 'llvm' into magkanar/benchmark_llvm_gpu_explicit
iomaganaris Dec 26, 2022
8d06bbf
Mention llvm branch in PAD and Dockerfiles
iomaganaris Dec 26, 2022
591923a
Disable debug symbols in nvptx64 JIT runs due to PTX ISA error
iomaganaris Dec 26, 2022
475a571
Added which branch to clone in the readme for the gpu docker runtime …
iomaganaris Dec 27, 2022
23eb5e8
Added some small changes in the PAD text
iomaganaris Dec 27, 2022
896ffd0
Small exmplanation regarding install.sh
iomaganaris Dec 27, 2022
2b8fc56
Fix GPU regression
iomaganaris Jan 2, 2023
70d0dc0
Updated readme
iomaganaris Jan 2, 2023
f60ac4e
Updated PAD file according to the submission
iomaganaris Jan 2, 2023
e5e010b
Small fixes in the readme file
iomaganaris Jan 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,19 @@ venv.bak/
.cmake-format.yaml
.pre-commit-config.yaml
.ipynb_checkpoints

# Benchmark outputs
test/benchmark/*.ll
test/benchmark/*.ptx
test/benchmark/*.out
test/benchmark/*.log
test/benchmark/*.cpp
test/benchmark/*.txt
test/benchmark/core.*
test/benchmark/memory_bound_*
test/benchmark/memory-bound_*
test/benchmark/hh_*
test/benchmark/compute_bound_*
test/benchmark/compute-bound_*
test/benchmark/llvm_benchmark_*
test/benchmark/v*
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ add_compile_options(${NMODL_COMPILER_WARNING_SUPPRESSIONS})
# =============================================================================
project(
NMODL
VERSION ${NMODL_GIT_LAST_TAG}
VERSION "1.0"
Copy link
Contributor Author

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:

CMake Error at CMakeLists.txt:83 (project):
  VERSION "v1.0-alpha-llvm" format invalid.

v1.0-alpha-llvm is the last NMODL tag

LANGUAGES CXX)

# =============================================================================
Expand Down
22 changes: 0 additions & 22 deletions docker/docker-compose.yml

This file was deleted.

50 changes: 0 additions & 50 deletions docker/recipe/Dockerfile

This file was deleted.

41 changes: 0 additions & 41 deletions docker/recipe/entrypoint

This file was deleted.

51 changes: 51 additions & 0 deletions docs/CC2023/PAD.md
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.
75 changes: 75 additions & 0 deletions docs/CC2023/README.md
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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?

@georgemitenkov @ohm314 @pramodk


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`.
2 changes: 1 addition & 1 deletion src/codegen/codegen_acc_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void CodegenAccVisitor::print_channel_iteration_block_parallel_hint(BlockType ty


void CodegenAccVisitor::print_atomic_reduction_pragma() {
if (!info.artificial_cell) {
if (info.point_process) {
printer->add_line("nrn_pragma_acc(atomic update)");
printer->add_line("nrn_pragma_omp(atomic update)");
}
Expand Down
2 changes: 1 addition & 1 deletion src/codegen/llvm/codegen_llvm_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ void CodegenLLVMVisitor::visit_codegen_atomic_statement(const ast::CodegenAtomic
const auto& member_node = codegen_intance_node->get_member_var();
const auto& member_name = member_node->get_node_name();

// Sanity checks. Not that there is a bit of duplication with `read_from_or_write_to_instance`
// Sanity checks. Note that there is a bit of duplication with `read_from_or_write_to_instance`
// but this is not crucial for now.
// TODO: remove this duplication!
if (!instance_var_helper.is_an_instance_variable(member_name))
Expand Down
7 changes: 7 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ int main(int argc, const char* argv[]) {
/// the number of repeated experiments for the benchmarking
int num_experiments = 100;

/// benchmark external kernel with JIT
std::string external_kernel_library;

/// X dimension of grid in blocks for GPU execution
int llvm_cuda_grid_dim_x = 1;

Expand Down Expand Up @@ -268,6 +271,9 @@ int main(int argc, const char* argv[]) {
benchmark_opt->add_option("--repeat",
num_experiments,
fmt::format("Number of experiments for benchmarking ({})", num_experiments))->ignore_case();
benchmark_opt->add_option("--external",
external_kernel_library,
fmt::format("Benchmark external kernels from shared library({})", external_kernel_library))->ignore_case()->check(CLI::ExistingFile);
benchmark_opt->add_option("--grid-dim-x",
llvm_cuda_grid_dim_x,
fmt::format("Grid dimension X ({})", llvm_cuda_grid_dim_x))->ignore_case();
Expand Down Expand Up @@ -447,6 +453,7 @@ int main(int argc, const char* argv[]) {
platform,
cfg.llvm_opt_level_ir,
cfg.llvm_opt_level_codegen,
external_kernel_library,
gpu_execution_parameters);
benchmark.run();
}
Expand Down
15 changes: 11 additions & 4 deletions src/pybind/pynmodl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,26 +188,31 @@ class JitDriver {
}


benchmark::BenchmarkResults run(std::shared_ptr<nmodl::ast::Program> node,
benchmark::BenchmarkResults run(const std::shared_ptr<const nmodl::ast::Program> node,
std::string& modname,
int num_experiments,
int instance_size,
std::string& external_kernel_library,
int cuda_grid_dim_x,
int cuda_block_dim_x) {
// New directory is needed to be created otherwise the directory cannot be created
// automatically through python
if (cfg.nmodl_ast || cfg.json_ast || cfg.json_perfstat) {
utils::make_path(cfg.scratch_dir);
}
cg_driver.prepare_mod(node, modname);
utils::make_path(cfg.output_dir);
// Make copy of node to be able to run the visitors according to any changes in the
// configuration and execute the mechanisms' functions multiple times
auto new_node = std::make_shared<nmodl::ast::Program>(*node);
cg_driver.prepare_mod(new_node, modname);
nmodl::codegen::CodegenLLVMVisitor visitor(modname,
cfg.output_dir,
platform,
0,
!cfg.llvm_no_debug,
cfg.llvm_fast_math_flags,
true);
visitor.visit_program(*node);
visitor.visit_program(*new_node);
const GPUExecutionParameters gpu_execution_parameters{cuda_grid_dim_x, cuda_block_dim_x};
nmodl::benchmark::LLVMBenchmark benchmark(visitor,
modname,
Expand All @@ -218,6 +223,7 @@ class JitDriver {
platform,
cfg.llvm_opt_level_ir,
cfg.llvm_opt_level_codegen,
external_kernel_library,
gpu_execution_parameters);
return benchmark.run();
}
Expand Down Expand Up @@ -313,8 +319,9 @@ PYBIND11_MODULE(_nmodl, m_nmodl) {
&nmodl::JitDriver::run,
"node"_a,
"modname"_a,
"num_experiments"_a,
"instance_size"_a,
"num_experiments"_a = 1,
"external_kernel_library"_a = "",
"cuda_grid_dim_x"_a = 1,
"cuda_block_dim_x"_a = 1);
#else
Expand Down
7 changes: 7 additions & 0 deletions test/benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ if(NMODL_ENABLE_JIT_EVENT_LISTENERS)
target_compile_definitions(llvm_benchmark PUBLIC NMODL_HAVE_JIT_EVENT_LISTENERS)
endif()

# =============================================================================
# external kernel stub
# =============================================================================
add_library(extkernel SHARED ext_kernel.cpp)
set_target_properties(extkernel PROPERTIES CXX_VISIBILITY_PRESET default)
target_link_libraries(llvm_benchmark PUBLIC extkernel)

# =============================================================================
# LLVM pyjit
# =============================================================================
Expand Down
Loading