Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Fix the issue with Eigen+OpenACC while executing on GPU#726

Closed
pramodk wants to merge 5 commits into
eigen_openacc_compatibilityfrom
pramodk/eigen_openacc_compatibility
Closed

Fix the issue with Eigen+OpenACC while executing on GPU#726
pramodk wants to merge 5 commits into
eigen_openacc_compatibilityfrom
pramodk/eigen_openacc_compatibility

Conversation

@pramodk

@pramodk pramodk commented Sep 2, 2021

Copy link
Copy Markdown
Contributor

Update conspiracy theory here once @kotsaloscv (and @olupton soon)
confirms that testcorenrn and channel-benchmark tests are working 😅

Branches to use:

  • neuron: master
  • coreneuron: master
  • nmodl: pramodk/eigen_openacc_compatibility

I quickly testcorenrn/hhkin and looks good.

@olupton : seems like there is something additional in channel-benchmark. Will look into details shortly...

olupton and others added 4 commits August 26, 2021 21:13
* Tweak NVHPC warning suppressions. This makes them
  work properly in standalone builds, when NMODL is not
  a submodule of CoreNEURON.
* Add const version of PyAst::get_shared_ptr. Fixes
  NVHPC compiler warning: warning #612-D: overloaded
  virtual function "nmodl::ast::Ast::get_shared_ptr" is
  only partially overridden in class "PyAst".
* Remove unused variable. Fixes compiler warning.
* Tweak code so clang-format-{11,12} agree. Otherwise
  clang-format-12 added whitespace that
  clang-format-11 did not.
* Call flex and bison with relative paths. This avoids
  #line directives and asserts containing the absolute
  path of the build directory, which should in turn
  improve ccache performance in the CI.
* Fix comment and add note about ccache misses.
* Fixes compilation issue when the operator() was declared as const while it changed some of values outside of its scope in the sympy solver

* Use DefUseAnalyzeVisitor to find out whether the operator() is Using or Defining any of the variables outside its scope

* Update DefUseAnalyzeVisitor to be able to process LOCAL variables as well, given precedence to GLOBAL/RANGE variables, when they have the same name

* Added related unit tests

* Fix codegen issue in CONSTRUCTOR and DESTRUCTOR blocks code when compiled for CoreNEURON

Fixes #691
FIxes #692
<update conspiracy theory once Christos and Olli confirms
 that testcorenrn and channel-benchmark tests are working>
@bbpbuildbot

Copy link
Copy Markdown
Collaborator

Logfiles from GitLab pipeline #15555 (:no_entry:) have been uploaded here!

Status and direct links:

@bbpbuildbot

Copy link
Copy Markdown
Collaborator

Logfiles from GitLab pipeline #15561 (:no_entry:) have been uploaded here!

Status and direct links:

@bbpbuildbot

Copy link
Copy Markdown
Collaborator

Logfiles from GitLab pipeline #15610 (:no_entry:) have been uploaded here!

Status and direct links:

@bbpbuildbot

Copy link
Copy Markdown
Collaborator

Logfiles from GitLab pipeline #15609 (:no_entry:) have been uploaded here!

Status and direct links:

@olupton

olupton commented Sep 3, 2021

Copy link
Copy Markdown
Contributor

Part of this PR should close #725.

@pramodk

pramodk commented Sep 6, 2021

Copy link
Copy Markdown
Contributor Author

Superseded by #728

Update conspiracy theory here once @kotsaloscv (and @olupton soon)

This was related to use of [] operator i.e. mat[i][j] resulting into PGI compiler inlining/copying [] operator overloaded function and somehow causing that issue. We haven't analysed Eigen source to check if [] is correctly annotated as device function. I used the approach suggested in here.

@pramodk pramodk closed this Sep 6, 2021
pramodk pushed a commit that referenced this pull request Sep 6, 2021
* Two factors contribute to the above solution:
   - New eigen branch (version 3.5 and above). Currently we are
      using a mirrored version of Eigen in BlueBrain organisation
      https://github.com/BlueBrain/eigen/releases/tag/v3.5-alpha
   - An API that makes possible to call any Eigen `__device__` 
      function from within OpenACC regions.
* More details: Eigen-3.5+ provides better GPU support; however,
   some functions cannot be called directly from within OpenACC regions.
   Therefore, we need to wrap them in a special API (decorate them with 
    `__device__` & `acc routine` tokens), which allows us to eventually call
    them from OpenACC. Calling these functions from CUDA kernels presents
    no issue.
*  From #726: Avoid use `[]` operator with eigen Matrix objects. This results
    into runtime error with OpenACC and PGI compiler.
* Note that this should works in combination with BlueBrain/CoreNeuron/pull/624

fixes #311 
fixes #135
@1uc 1uc deleted the pramodk/eigen_openacc_compatibility branch July 12, 2024 14:03
JCGoran pushed a commit to neuronsimulator/nrn that referenced this pull request Mar 12, 2025
…rain/nmodl#728)

* Two factors contribute to the above solution:
   - New eigen branch (version 3.5 and above). Currently we are
      using a mirrored version of Eigen in BlueBrain organisation
      https://github.com/BlueBrain/eigen/releases/tag/v3.5-alpha
   - An API that makes possible to call any Eigen `__device__` 
      function from within OpenACC regions.
* More details: Eigen-3.5+ provides better GPU support; however,
   some functions cannot be called directly from within OpenACC regions.
   Therefore, we need to wrap them in a special API (decorate them with 
    `__device__` & `acc routine` tokens), which allows us to eventually call
    them from OpenACC. Calling these functions from CUDA kernels presents
    no issue.
*  From BlueBrain/nmodl#726: Avoid use `[]` operator with eigen Matrix objects. This results
    into runtime error with OpenACC and PGI compiler.
* Note that this should works in combination with BlueBrain/CoreNeuron/pull/624

fixes BlueBrain/nmodl#311 
fixes BlueBrain/nmodl#135 

NMODL Repo SHA: BlueBrain/nmodl@5f4462a
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants