Skip to content

HiPO in Python#2994

Open
galabovaa wants to merge 183 commits intolatestfrom
mods-novc
Open

HiPO in Python#2994
galabovaa wants to merge 183 commits intolatestfrom
mods-novc

Conversation

@galabovaa
Copy link
Copy Markdown
Contributor

@galabovaa galabovaa commented Apr 29, 2026

@mathgeekcoder Please let me know if this looks OK to you too!

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 43.62416% with 84 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.82%. Comparing base (7cf21f0) to head (db0e178).
⚠️ Report is 49 commits behind head on latest.

Files with missing lines Patch % Lines
highs/HighsExternalDeps.h 12.24% 43 Missing ⚠️
highs/ipm/hipo/factorhighs/CallAndTimeBlas.cpp 0.00% 11 Missing ⚠️
highs/ipm/hipo/ipm/FactorHiGHSSolver.cpp 0.00% 10 Missing ⚠️
check/TestCallbacks.cpp 20.00% 4 Missing ⚠️
highs/HighsExternalDeps.cpp 73.33% 4 Missing ⚠️
highs/io/HighsIO.cpp 20.00% 4 Missing ⚠️
app/HighsRuntimeOptions.h 0.00% 2 Missing ⚠️
check/TestHighsExternalDeps.cpp 86.66% 2 Missing ⚠️
highs/lp_data/HighsOptions.cpp 93.93% 2 Missing ⚠️
highs/ipm/IpxWrapper.cpp 0.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##           latest    #2994      +/-   ##
==========================================
- Coverage   81.31%   72.82%   -8.49%     
==========================================
  Files         359      417      +58     
  Lines       88852   101979   +13127     
  Branches        0    16431   +16431     
==========================================
+ Hits        72250    74271    +2021     
- Misses      16602    27432   +10830     
- Partials        0      276     +276     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@galabovaa galabovaa requested review from filikat and jajhall April 29, 2026 14:46
Comment thread highs/lp_data/HighsOptions.cpp Outdated
Comment thread highspy-extras/README.md Outdated

Extension package for [highspy](https://pypi.org/project/highspy/) that enables access to external dependencies with licensing terms different from HiGHS, such as Apache 2.0.

The HiPO Interior Point Method (IPM) solver currently uses these external dependencies to provide enhanced performance for linear programming problems. Other algorithms may also rely on `highspy-extras` in the future.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

"to provide enhanced performance for linear and quadratic programming problems."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fixed!

Comment thread highs/HighsExternalDeps.cpp Outdated
@filikat
Copy link
Copy Markdown
Collaborator

filikat commented Apr 29, 2026

On Mac, the header reports Using BLAS: unknown, unless I specify manually -DBLAS_LIBRARIES=... when configuring CMake.
It appears that if it finds Apple BLAS automatically, BLAS_LIBRARIES is not defined in HConfig.h, even though the CMake log correctly prints Using BLAS library: ...

@galabovaa
Copy link
Copy Markdown
Contributor Author

Thank you @filikat I will address your comments

@filikat
Copy link
Copy Markdown
Collaborator

filikat commented Apr 30, 2026

I benchmarked this branch on my set of 330 LPs and QPs and there's no performance difference.

@filikat
Copy link
Copy Markdown
Collaborator

filikat commented Apr 30, 2026

If I try to compile with ALL_TESTS=ON and BUILD_SHARED_EXTRAS_LIB=OFF, I get the error

CMake Error at check/CMakeLists.txt:123 (target_link_libraries):
  The keyword signature for target_link_libraries has already been used with
  the target "unit_tests".  All uses of target_link_libraries with a target
  must be either all-keyword or all-plain.

  The uses of the keyword signature are here:

   * check/CMakeLists.txt:114 (target_link_libraries)

@filikat
Copy link
Copy Markdown
Collaborator

filikat commented Apr 30, 2026

Everything else looks fine to me.
Great job getting this to work!

…lso fixed linker issue when `HIPO=OFF` and `BUILD_SHARED_EXTRAS_LIB=OFF`.

Note: The `PRIVATE` declaration is "new-style" and conflicted with the other `target_link_libraries` "old-style" calls.  An equally valid fix is to add `PRIVATE` to all the other calls.

Co-authored-by: Copilot <copilot@github.com>
@mathgeekcoder
Copy link
Copy Markdown
Collaborator

If I try to compile with ALL_TESTS=ON and BUILD_SHARED_EXTRAS_LIB=OFF, I get the error

Fixed. Good catch, thanks!

FYI: Was an issue with the new-style PRIVATE syntax for target_link_libraries. The other linker calls were "old-style", and apparently cmake doesn't like to mix the styles.

Also, BUILD_SHARED_EXTRAS_LIB=OFF should be a no-op when HIPO=OFF. This was causing a link error, but I've fixed this too.

@mathgeekcoder
Copy link
Copy Markdown
Collaborator

BTW: ignore the "Co-authored-by: Copilot copilot@github.com" in my commit message. It wasn't a big change, but I wrote it all myself. It's trying to claim co-authorship, even when it just autocompletes a word or two 😆

Apparently, this is a recent "feature" of vscode. Thankfully, there's a "git.addAICoAuthor": "off" setting.

… HighsOptions to remove redundancy.

The new error message is also more generic, in case future algorithms need these external dependencies.
….e., HIGHS_SHARED_EXTRAS_LIBRARY was not being defined in HConfig.h

* Cleaned up C++ usage of HIPO.  Developers don't need to wrap everything in `#ifdef HIPO`, can just use centralized `HighsExternalDeps` and it will build correctly in every configuration.
* Cleaned up cmake usage of HIPO. No longer necessary to worry about header or linker (propagated via libhighs)
* Fixed issue with "unknown" BLAS Library string on mac
* Updated highs_extras README to include quadratic
@mathgeekcoder
Copy link
Copy Markdown
Collaborator

mathgeekcoder commented May 2, 2026

BTW: @galabovaa, I noticed and fixed a potential big issue for C++ users of highs. We weren't including HIGHS_SHARED_EXTRAS_LIBRARY define in HConfig.h. We didn't see this in our build system since we always define it appropriately via cmake.

While I fixing this, I also made it much easier to consume/develop. The appropriate header/linker details are now propagated via libhighs using PUBLIC cmake declarations.

I also made it unnecessary to use #ifdef HIPO everywhere, we can simply rely on HighsExternalDeps::isAvailable() instead. Any half-decent compiler will optimize out the unused code if HIPO=OFF.

Most of these changes are here: a86d16a

I've also updated the bazel and meson builds - but as you already know, they assume HIPO=OFF. Is this something we need to support in this PR?

@mathgeekcoder
Copy link
Copy Markdown
Collaborator

On Mac, the header reports Using BLAS: unknown, unless I specify manually -DBLAS_LIBRARIES=... when configuring CMake. It appears that if it finds Apple BLAS automatically, BLAS_LIBRARIES is not defined in HConfig.h, even though the CMake log correctly prints Using BLAS library: ...

@filikat: I changed this to return the BLA_VENDOR (if exists). So, for Apple BLAS, it'll simply say "Apple". Is this suitable?

@galabovaa
Copy link
Copy Markdown
Contributor Author

BTW: @galabovaa, I noticed and fixed a potential big issue for C++ users of highs. We weren't including HIGHS_SHARED_EXTRAS_LIBRARY define in HConfig.h. We didn't see this in our build system since we always define it appropriately via cmake.

While I fixing this, I also made it much easier to consume/develop. The appropriate header/linker details are now propagated via libhighs using PUBLIC cmake declarations.

I also made it unnecessary to use #ifdef HIPO everywhere, we can simply rely on HighsExternalDeps::isAvailable() instead. Any half-decent compiler will optimize out the unused code if HIPO=OFF.

Great, thank you for fixing these!

I've also updated the bazel and meson builds - but as you already know, they assume HIPO=OFF. Is this something we need to support in this PR?

We can keep HiPO off in bazel and meson for now.

@filikat
Copy link
Copy Markdown
Collaborator

filikat commented May 3, 2026

I changed this to return the BLA_VENDOR (if exists). So, for Apple BLAS, it'll simply say "Apple". Is this suitable?

Great thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants