Giter VIP home page Giter VIP logo

tinyhpipm's Introduction

๐Ÿค tinyHPIPM

This project is an opinionated and stripped down version of HPIPM packaged with the linear algebra subroutines in BLASFEO. I created it based on my own personal needs (which were mostly oriented around QCQPs and the Python interface), but if you want me to add something, don't hesitate to open a PR.
Currently, the main differences with the original project(s) are:

  • for BLASFEO: a lot of the compilation options have been removed to keep only those actually used in HPIPM (high performance implementation with panel major matrix format, no external BLAS interface).
  • for HPIPM: no tree OCP interface
  • the compilation targets for both have been merged, simplified and renamed (based on CPU capabilities instead of vendor architectures)
  • no more Make build system, only modern CMake that simplifies the usage from other project
  • no more Matlab interface
  • some small bugfixes in the OCP QCQP interface

WARNING: This project is in its early stages, a lot can change unexpectedly (especially in the C interface that I have not yet finished cleaning up), so this is currently not production ready.

In the future I would like to add:

  • automatic compilation target selection
  • a more extensive Python interface
  • more testing and code analysis to ensure space grade software quality
    • unit testing (probably with CTest in the beginning but I could switch to a more complete C framework)
    • high MCDC coverage
    • use static analysis tools like SonarLint, IKOS, COBRA to ensure standards like MISRA-C.
  • more documentation

New compilation targets

The table below is a summary of the correspondance between the old compilation targets of BLASFEO and the new compilation targets of tinyHPIPM.

old target new target cflags asm flags
TARGET_X86_AMD_BARCELONA TARGET_X86_SSE3 -m32 -msse3
TARGET_X86_AMD_JAGUAR TARGET_X86_AVX -m32 -mavx
TARGET_X64_INTEL_CORE TARGET_X64_SSE3 -m64 -msse3
TARGET_X64_INTEL_SANDY_BRIDGE TARGET_X64_AVX -m64 -mavx
TARGET_X64_AMD_BULLDOZER TARGET_X64_AVX_FMA -m64 -mavx -mfma
TARGET_X64_INTEL_HASWELL TARGET_X64_AVX2_FMA -m64 -mavx2 -mfma
TARGET_X64_INTEL_SKYLAKE_X TARGET_X64_AVX512_FMA -m64 -mavx512f -mavx512vl -mfma
TARGET_ARMV7A_... TARGET_ARMV7A_NEON_VPFV3 -marm -mfloat-abi=hard -mfpu=neon-vfpv3 -mfpu=neon-vfpv4
TARGET_ARMV8A_... TARGET_ARMV8A_NEON2_VPFV4 -march=armv8-a+crc+crypto+simd
TARGET_GENERIC TARGET_GENERIC

tinyhpipm's People

Contributors

tudoroancea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

mfkiwl

tinyhpipm's Issues

Change the genericity system

In the blasfeo and hpipm codebases, almost all the code is implemented for both single and double precision. To accomplish this with the least code duplication, the original authors chose to:

  1. create a single header file to declare all the data structures and functions twice (once with the d_ and once with the s_ prefix in the names, e.g. d_ocp_qcqp/s_ocp_qcqp, d_ocp_qcqp_create()/s_ocp_qcqp_create())
  2. create two source files (with the d_,s_ prefixes) that uses preprocessor directives to define generic names referring to the used real type (double or float), referenced data structures and functions, and includes (with the syntax #include "x_....c")
  3. a third source files whose name starts with x_ and that implements the functions

The main problem with this system is that the x_ files are not mentioned in the CMakeLists.txt and therefore not in the generated compile_commands.json file, which limits the IDE integration and does not properly allow for autocompletion.
To accelerate the development and modernize the codebase, we are looking for another genericity system that would ideally still allow writing a single function declaration for both versions.

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.