Comments (9)
I see a potential need to include such methods in an interface...
This would make testing and transitioning to new implementations much easier as you mentioned. Ideally every internal method deals with only an interface so we can swap out implementations as needed. In my opinion, making hiopMatrixSparseTriplet
and hiopMatrixDense
pure virtual would be the single most helpful step we could take in this regard.
from hiop.
that is intended design at least with the mentioned method(s) and for the time being -- only sparse matrices should have and need that functionality
from hiop.
CC: @cameronrutherford @JuanDiegoMontoya
from hiop.
I see a potential need to include such methods in an interface (for the sparse matrices) when porting, but it really depends on the specific of the device implementation, for example this would/should not be needed (ideally) if the hardware abstraction layer can run cpu or gpu in a way that is oblivious to the code using this class... like in RAJA vector class.
from hiop.
I should have clarified that using matrix type IDs is a transitional solution that will help us experiment with GPU implementations with minimal changes to the existing HiOp code until we understand better how to refactor the API to support hardware accelerator code in a long term. By using matrix/vector type IDs and dynamic casts we can enforce the same matrix compatibility requirements without major refactoring of the API and leaving existing CPU code largely intact.
from hiop.
a transitional solution...
I only worry that any transitional solution will create too much inertia and we'll never actually solve the design challenge. Other than that, LGTM!
from hiop.
Per our discussion, refactoring interfaces would be a much better long-term solution, and per @ashermancinelli's assessment, it wouldn't take too much effort. We could think of inheritance structure like this:
hiopMatrix
- pure virtual base matrix classhiopMatrixDense
- virtual, base class for all dense matrix implementationshiopMatrixDenseRowMajor
- current implementation ofhiopMatrixDense
renamedhiopMatrixDenseRowMajorRaja
- portable dense matrix implementation using RAJA
hiopMatrixSparse
- virtual base class for all sparse matrix implementationshiopMatrixSparseTriplet
triplet implementation of the sparse matrixhiopMatrixSparseTripletRaja
- portable triplet implementation using RAJAhiopMatrixSparseCSR
- if ever needed ...
from hiop.
I am a big fan of the naming & inheritance scheme you've laid out. I was in the process of writing up something just like it 😄
In my opinion, we should make this the highest priority so we can build on top of this internally with our additional unit/integration tests. I will make an internal MR and expedite this work unless @cnpetra disagrees.
from hiop.
looking quite good, will take the final look when the PR comes in here.
from hiop.
Related Issues (20)
- Unnecessary dynamic_cast to hiopVectorPar in hiopHessianLowRank HOT 1
- update code style in hiopHessianLowRank
- Update CMake files for building HiOp and LiDO in co-develop mode
- Introduce more user parameters to control NLP scaling
- Update Ginkgo interface so it can take data directly on GPU HOT 1
- Narrowing conversion in Ginko HOT 7
- Install Ginkgo via Spack for HiOp HOT 1
- Primal regularizations for x and d are different
- Failure from the feasibility restoration
- `hiop~mpi` includes MPI headers HOT 6
- Segmentation fault when copying empty matrix in sparse GPU mode
- `hiop@develop%clang-rocm` unable to build HOT 5
- Hiop fails to build on Frontier with Exago build script from KPP2
- `hiop+cuda ^cuda@12` failes to build HOT 7
- Build with Strumpack enabled fails due to -Werror (`-Werror=unused-variable`, `-Werror=reorder`) HOT 4
- RAJA must be used when CUDA is selected. HOT 2
- Are versions retagged? HOT 4
- Cannot build with CUDA flag set ON HOT 3
- Update Incline CI to use ROCm 5.6.0/6.0.0
- Derivative checker
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hiop.