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

feat: Add kernel callable dense LA solvers for small systems. #3287

Merged
merged 23 commits into from
Aug 26, 2024

Conversation

CusiniM
Copy link
Collaborator

@CusiniM CusiniM commented Aug 19, 2024

No description provided.

@CusiniM CusiniM requested a review from victorapm August 19, 2024 17:53
@CusiniM CusiniM marked this pull request as ready for review August 19, 2024 18:01
@CusiniM
Copy link
Collaborator Author

CusiniM commented Aug 19, 2024

@dkachuma this should be useful for the PVT module too.

@rrsettgast rrsettgast requested a review from corbett5 August 19, 2024 20:09
@corbett5
Copy link
Contributor

I feel like these would fit in better in LvArray. I mean it's already got the functions for solving 2x2 and 3x3 eigenvalue and inverse problems, why shouldn't the linear system solvers live there as well? Where ever they wind up there should be unit tests as well.

Copy link
Member

@rrsettgast rrsettgast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These optimizations are not guaranteed to be done by the compiler.

we should have a plan for a central location for all operations of this type. It was in LvArray. If you want to move these out of LvArray we should discuss that. I would push for a kernel callable LA package separate from GEOS and LvArray, but that is just how I roll.

src/coreComponents/denseLinearAlgebra/denseLASolvers.hpp Outdated Show resolved Hide resolved
src/coreComponents/denseLinearAlgebra/denseLASolvers.hpp Outdated Show resolved Hide resolved
src/coreComponents/denseLinearAlgebra/denseLASolvers.hpp Outdated Show resolved Hide resolved
@castelletto1
Copy link
Contributor

I feel like these would fit in better in LvArray. I mean it's already got the functions for solving 2x2 and 3x3 eigenvalue and inverse problems, why shouldn't the linear system solvers live there as well? Where ever they wind up there should be unit tests as well.

Yes, linear algebra operations, including tensor operations, should live in the same place.

we should have a plan for a central location for all operations of this type. It was in LvArray. If you want to move these out of LvArray we should discuss that. I would push for a kernel callable LA package separate from GEOS and LvArray, but that is just how I roll.

I agree with @rrsettgast . Linear algebra and tensor operations should be a package independent of LvArray and of GEOS.

@rrsettgast
Copy link
Member

I feel like these would fit in better in LvArray. I mean it's already got the functions for solving 2x2 and 3x3 eigenvalue and inverse problems, why shouldn't the linear system solvers live there as well? Where ever they wind up there should be unit tests as well.

Yes, linear algebra operations, including tensor operations, should live in the same place.

we should have a plan for a central location for all operations of this type. It was in LvArray. If you want to move these out of LvArray we should discuss that. I would push for a kernel callable LA package separate from GEOS and LvArray, but that is just how I roll.

I agree with @rrsettgast . Linear algebra and tensor operations should be a package independent of LvArray and of GEOS.

isn't there a kernel callable set of dense linear algebra functions?

@castelletto1
Copy link
Contributor

castelletto1 commented Aug 19, 2024

I feel like these would fit in better in LvArray. I mean it's already got the functions for solving 2x2 and 3x3 eigenvalue and inverse problems, why shouldn't the linear system solvers live there as well? Where ever they wind up there should be unit tests as well.

Yes, linear algebra operations, including tensor operations, should live in the same place.

we should have a plan for a central location for all operations of this type. It was in LvArray. If you want to move these out of LvArray we should discuss that. I would push for a kernel callable LA package separate from GEOS and LvArray, but that is just how I roll.

I agree with @rrsettgast . Linear algebra and tensor operations should be a package independent of LvArray and of GEOS.

isn't there a kernel callable set of dense linear algebra functions?

There are many libraries. However, our need is to solve very small problems in each thread. @corbett5 do you have any experience with using Eigen in a device (CUDA) kernel?

@corbett5
Copy link
Contributor

Breaking out all the kernel callable tensor operations in LvArray into a new repo sounds fine to me.

@castelletto1 no I have not tried Eigen. I know that they have device compatible compile time fixed size 2x2 and 3x3 eigen decompositions, but I'm not sure for example if they have a general suite of device compatible fixed size routines. If they do I doubt they have the support for a static 2x2 and 3x3 symmetric format. Using Eigen would also lock us into the pattern of always performing operations on local variables, where as for example with LvArray::tensorOps you can pass in whatever mix of local variables and LvArray::Array objects you want.

Copy link
Contributor

@castelletto1 castelletto1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand @CusiniM needs this kernel for #3280. I propose we move forward incrementally, and focus on the refactoring we all seem to agree on in a future PR.

@CusiniM please make sure to add unit tests as required by @corbett5.

Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 97.05882% with 4 lines in your changes missing coverage. Please review.

Project coverage is 56.45%. Comparing base (a3e4a51) to head (2460a17).
Report is 90 commits behind head on develop.

Files with missing lines Patch % Lines
...enseLinearAlgebra/unitTests/testDenseLASolvers.cpp 93.93% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3287      +/-   ##
===========================================
+ Coverage    56.36%   56.45%   +0.09%     
===========================================
  Files         1056     1059       +3     
  Lines        89233    89444     +211     
===========================================
+ Hits         50296    50498     +202     
- Misses       38937    38946       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@CusiniM CusiniM self-assigned this Aug 20, 2024
@CusiniM CusiniM added ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI labels Aug 20, 2024
@CusiniM
Copy link
Collaborator Author

CusiniM commented Aug 20, 2024

Added unitTests. This should be good to go for now.

@CusiniM CusiniM added the flag: no rebaseline Does not require rebaseline label Aug 21, 2024
@CusiniM CusiniM merged commit cbe9c5d into develop Aug 26, 2024
21 of 22 checks passed
@CusiniM CusiniM deleted the feature/cusini/denseLASolvers branch August 26, 2024 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI flag: no rebaseline Does not require rebaseline
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants