Notes and checks for running HiGHS' GPU PDLP through OR-Tools. These are
run by hand on GPU machines; CI only covers the CPU builds
(.github/workflows/ortools-*.yml). The commands are in
../or-tools-readme.md.
check_highs_gpu.py: solves an LP with HiGHS through OR-Tools' Python API (pywraplp) with HiGHS options (defaultsolver=pdlp). Run it through../ortools/check_log.py --require-gputo make sure PDLP really ran on the GPU.../ortools/highs_check/: the same check in C++, used for Bazel. It is copied into the OR-Tools tree as//highs_checkbyortools/prepare.sh.../ortools/check_log.py: runs a command and checks its output: OPTIMAL status, objective, HiGHS version, and with--require-gputheCuda device N: <name>line that cuPDLP-C prints when it starts on a GPU (with HiGHS output on). Without that line, PDLP ran on the CPU.
- CMake,
HIGHS_GPU_LIB=ON(HiGHS option, passed straight through OR-Tools' CMake): builds the CUDA code into the HiGHS library itself (it impliesCUPDLP_GPU=ON), so the GPU solver works from OR-Tools' Python wheel. Use this for the Python checks. - CMake,
CUPDLP_GPU=ONalone: the CUDA code goes in a separatecudalinlibrary, which OR-Tools' Python build does not pick up. - Bazel:
--@highs//:cupdlp_gpu --@rules_cuda//cuda:archs=sm_XY.XYis the GPU's compute capability without the dot, fromnvidia-smi --query-gpu=compute_cap --format=csv,noheader(8.9 ->sm_89).--//:cupdlp_gpuis only for building HiGHS on its own.
ortools/linear_solver/solve --solver=highs --params=...cannot be used: it CHECK-fails, becauseHighsInterface::SetSolverSpecificParametersAsString()returns false. Runsolvewithout--params, or usehighs_check.- The same call from
pywraplpor C++MPSolverreturnsFalse, but the string is still stored and passed to HiGHS onSolve(), so it works. Ignore the return value. - Format:
name=valueorname value, separated by commas or newlines, e.g.solver=pdlp,presolve=off. Avoid empty lines (HiGHS' parser readsline[0]of every line), so no"""\nsolver pdlp\n"""strings. - Python APIs:
pywraplp(legacy): options work as above; it cannot read MPS files directly, socheck_highs_gpu.py --mpsgoes throughmodel_builderandLoadModelFromProto.model_builder: reads MPS files but cannot pass HiGHS options.math_opt: options go throughhighs_pb2.HighsOptionsProtoinSolveParameters(highs=...). The genericLPAlgorithm.FIRST_ORDERis not mapped to HiGHS PDLP.
- Python 3.8+ ignores
PATHwhen it loads extension module DLLs.check_highs_gpu.pyadds%CUDA_PATH%\bin(andbin\x64for CUDA 13) itself. Use--dll-dirfor anything else, e.g. the build'sRelease\binif the wheel is missing a DLL. - Building the Python wheel needs
mypyandmypy-protobuf(pip install mypy mypy-protobuf), andstubgen.exeonPATH. For apip install --usersetup:$env:PATH += ";$env:APPDATA\Python\Python312\Scripts". - On Windows, HiGHS builds as a shared library whenever GPU is on.
- Install
swig,mypyandmypy-protobufbefore building the Python wheel. - If the CUDA libraries are not in the loader path:
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH.