Giter Club home page Giter Club logo

Comments (9)

ashermancinelli avatar ashermancinelli commented on June 8, 2024 1

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.

cnpetra avatar cnpetra commented on June 8, 2024

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.

pelesh avatar pelesh commented on June 8, 2024

CC: @cameronrutherford @JuanDiegoMontoya

from hiop.

cnpetra avatar cnpetra commented on June 8, 2024

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.

pelesh avatar pelesh commented on June 8, 2024

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.

ashermancinelli avatar ashermancinelli commented on June 8, 2024

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.

pelesh avatar pelesh commented on June 8, 2024

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 class
    • hiopMatrixDense - virtual, base class for all dense matrix implementations
      • hiopMatrixDenseRowMajor - current implementation of hiopMatrixDense renamed
      • hiopMatrixDenseRowMajorRaja - portable dense matrix implementation using RAJA
    • hiopMatrixSparse - virtual base class for all sparse matrix implementations
      • hiopMatrixSparseTriplet triplet implementation of the sparse matrix
      • hiopMatrixSparseTripletRaja - portable triplet implementation using RAJA
      • hiopMatrixSparseCSR - if ever needed ...

from hiop.

ashermancinelli avatar ashermancinelli commented on June 8, 2024

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.

cnpetra avatar cnpetra commented on June 8, 2024

looking quite good, will take the final look when the PR comes in here.

from hiop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.