Skip to content

Commit 6e7ce4d

Browse files
committed
Updated two minor dev logging cases, updated gup.md and kkt.md, and added numerics.md
1 parent 3c25534 commit 6e7ce4d

File tree

7 files changed

+99
-15
lines changed

7 files changed

+99
-15
lines changed

docs/make.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ Documenter.makedocs(
5757
"guide/further.md",
5858
"guide/advanced.md",
5959
"guide/gpu.md",
60-
"guide/kkt.md"
60+
"guide/kkt.md",
61+
"guide/numerics.md"
6162
],
6263
"Data structures" => Any[
6364
"structures/index.md",

docs/src/guide/gpu.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,49 @@
11
# [GPU acceleration](@id gpu)
22

3-
From HiGHS v1.10.0, its first order primal-dual LP (PDLP) solver [cuPDLP-C](https://github.com/COPT-Public/cuPDLP-C) can be run on an NVIDIA GPU under Linux and Windows. However, to achieve this, CUDA utilities must be installed and HiGHS must be built locally using CMake, as described below.
3+
From HiGHS v1.10.0, its first order primal-dual LP (PDLP) solver
4+
[cuPDLP-C](https://github.com/COPT-Public/cuPDLP-C) can be run on an
5+
NVIDIA GPU under Linux and Windows. However, to achieve this, CUDA
6+
utilities must be installed and HiGHS must be built locally using
7+
CMake, as described below.
48

59
### PDLP: A health warning
610

7-
First order solvers for LP are still very much "work in progress". Although impressive results have been reported, these are often to lower accuracy than is achieved by simplex and interior point solvers, have been obtained using top-of-the-range GPUs, and not achieved for all problem classes. Note that, due to PDLP using relative termination conditions, a solution deemed optimal by PDLP may not be accepted as optimal by HiGHS. The user should consider the infeasibility data returned by [HighsInfo](@ref HighsInfo) to decide whether the solution is acceptable to them.
11+
First order solvers for LP are still very much "work in
12+
progress". Although impressive results have been reported, these are
13+
often to lower accuracy than is achieved by simplex and interior point
14+
solvers, have been obtained using top-of-the-range GPUs, and not
15+
achieved for all problem classes. Note that, due to PDLP using
16+
relative termination conditions, a solution deemed optimal by PDLP may
17+
not be accepted as optimal by HiGHS. The user should consider the
18+
infeasibility data returned by [HighsInfo](@ref HighsInfo) to decide
19+
whether the solution is acceptable to them.
820

921
#### Termination criteria
1022

11-
Although the PDLP solver may report that it has terminated with an optimal solution, HiGHS may identify that the solution returned by PDLP is not optimal. As discussed in [HiGHS feasibilty and optimality tolerances](@ref kkt), this is due to PDLP using relative termination criteria.
12-
13-
If you use the HiGHS PDLP solver, in the first instance it is recommended that you increase the feasibility and optimality tolerances to `1e-4`, since this will result in the algorithm terminating much sooner. There are multiple feasibility and optimality tolerances, but all will be set to the value of the [`kkt_tolerance`](@ref option-kkt-tolerance) option (if it differs from its default value of `1e-4`) so this is recommended in the first instance.
23+
Although the PDLP solver may report that it has terminated with an
24+
optimal solution, HiGHS may identify that the solution returned by
25+
PDLP is not optimal. As discussed in [HiGHS feasibility and optimality
26+
tolerances](@ref kkt), this is due to PDLP using relative termination
27+
criteria and (unlike interior point solvers) not satisfying
28+
feasibility to high accuracy.
29+
30+
If you use the HiGHS PDLP solver, in the first instance it is
31+
recommended that you increase the feasibility and optimality
32+
tolerances to `1e-4`, since this will result in the algorithm
33+
terminating much sooner. There are multiple feasibility and optimality
34+
tolerances, but all will be set to the value of the
35+
[`kkt_tolerance`](@ref option-kkt-tolerance) option (if it differs
36+
from its default value of `1e-4`) so this is recommended in the first
37+
instance.
1438

1539
### Requirements
1640

1741
CUDA Toolkit and CMake.
1842

19-
A [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit) installation is required, along with the matching NVIDIA driver. Please install both following the instructions on NVIDIA's website.
43+
A [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit)
44+
installation is required, along with the matching NVIDIA
45+
driver. Please install both following the instructions on NVIDIA's
46+
website.
2047

2148
HiGHS must be build locally with CMake.
2249

docs/src/guide/kkt.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# [Feasibilty and optimality](@id kkt)
1+
# [Feasibility and optimality](@id kkt)
22

3-
Mathematically, continuous optimization problems have exact feasibilty
3+
Mathematically, continuous optimization problems have exact feasibility
44
and optimality conditions. However, since solvers cannot always
55
satisfy these conditions exactly when using floating-point arithmetic,
66
they do so to within tolerances. As explored below, some solvers aim
@@ -12,7 +12,7 @@ and can give a misleading claim of optimality. To achieve consistency,
1212
HiGHS reassesses the optimal solution claimed by such a solver in a
1313
reasonable and uniform manner.
1414

15-
### Feasibilty and optimality conditions
15+
### Feasibility and optimality conditions
1616

1717
To discuss tolerances and their use in different solvers, consider the
1818
standard form linear programming (LP) problem with ``n`` variables and
@@ -26,7 +26,7 @@ standard form linear programming (LP) problem with ``n`` variables and
2626
\end{aligned}
2727
```
2828

29-
The feasibilty and optimality conditions (KKT conditions) are that, at
29+
The feasibility and optimality conditions (KKT conditions) are that, at
3030
a point ``x``, there exist (row) dual values ``y`` and reduced costs
3131
(column dual values) ``s`` such that
3232

docs/src/guide/numerics.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# [Numerical considerations](@id numerics)
2+
3+
Optimization solvers cannot be expected to find the exact solution of
4+
a problem, since it may not be possible to represent that solution
5+
using floating-point arithemtic. However, solvers will typically run
6+
faster and find more accurate solutions if the problem has good
7+
numerical properties. Ideally the optimal value of all primal
8+
variables (and dual variables when relevant) will be of order
9+
unity. This typically occurs if all objective and constraint matrix
10+
coefficients, as well as finite variable and constraint bounds, are of
11+
order unity. Whilst there may be some reasons why this ideal cannot be
12+
achieved in all models, there are many pitfalls to avoid. For an
13+
insight into reasons why a model may have bad numerical properties and
14+
how to avoid them, users are recommended to study this [JuMP
15+
tutorial](https://jump.dev/JuMP.jl/stable/tutorials/getting_started/tolerances/). Improving
16+
the numerical properties of a model will typically lead to it being
17+
solved faster and more accurately/reliably, so the investment should
18+
pay off!
19+
20+
Internally, the HiGHS continuous optimization solvers scale the
21+
constraint matrix to improve the numerical properties of the problem,
22+
[feasibility and optimality tolerances](@ref kkt) are determined with
23+
respect to the original, unscaled problem. However, faced with a model
24+
with bad numerical properties, there is only so much that HiGHS can do
25+
to solve it efficiently and accurately.
26+
27+
If the optimal values of many variables in a model are typically very
28+
large, this can correspond to very large values of the objective
29+
coefficients and finite variable and constraint bounds. Since most of
30+
the HiGHS solvers terminate according to small absolute [feasibility
31+
tolerances](@ref kkt), large objective coefficients and bounds force
32+
the solvers to achieve an accuracy that may be unrealsitic in the
33+
context of a model. As well as having an impact on efficiency, the
34+
solver may ultimately be unable to achieve the required accuracy and
35+
fail. Objective coefficients and bounds that are less than the
36+
feasibility and optimality tolerances can also be problematic,
37+
although this is less common and less serious.
38+
39+
HiGHS offers a facility to enable users to assess the consequences of
40+
better problem scaling, in cases where some objective coefficients or
41+
bounds are large, or if all objective coefficients or bounds are
42+
small. By setting the options [user\_objective\_scale](@id
43+
option-user-objective-scale) and/or [user\_bound\_scale](@id
44+
option-user-bound-scale), HiGHS will solve the given model with
45+
uniform scaling of the objective coefficients or bounds. Note that
46+
these options define the exponent in power-of-two scaling factors so
47+
that model accuracy is not compromised. After solving the problem,
48+
feasibility and optimality will be assessed for the original model,
49+
with a warning given if the tolerances are not satisfied. Note that
50+
uniform scaling of bounds on discrete variables is not possible, and
51+
is achieved implicitly by scaling their cost and matrix
52+
coefficients. Also, when bounds on variables in a quadratic
53+
programming problem are scaled up (down), the values in the Hessian
54+
matrix must be scaled down (up) so that the overall scaling of the
55+
objective is uniform.

docs/src/options/definitions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@
115115
- Range: {0, 2147483647}
116116
- Default: 0
117117

118-
## user\_objective\_scale
118+
## user\_objective\_scale(@id option-user-objective-scale)
119119
- Exponent of power-of-two objective scaling for model
120120
- Type: integer
121121
- Range: {-2147483647, 2147483647}
122122
- Default: 0
123123

124-
## user\_bound\_scale
124+
## user\_bound\_scale(@id option-user-bound-scale)
125125
- Exponent of power-of-two bound scaling for model
126126
- Type: integer
127127
- Range: {-2147483647, 2147483647}

highs/lp_data/HighsSolution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1727,7 +1727,7 @@ bool reportKktFailures(const HighsLp& lp, const HighsOptions& options,
17271727
optimality_tolerance = options.kkt_tolerance;
17281728
}
17291729

1730-
const bool force_report = false;
1730+
const bool force_report = options.log_dev_level >= kHighsLogDevLevelInfo;
17311731
const bool complementarity_error =
17321732
!is_mip && info.primal_dual_objective_error > optimality_tolerance;
17331733
const bool integrality_error =

highs/pdlp/CupdlpWrapper.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ HighsStatus solveLpCupdlp(const HighsOptions& options, HighsTimer& timer,
230230
assert(111 == 777);
231231
}
232232
#if CUPDLP_DEBUG
233-
analysePdlpSolution(options, lp, highs_solution);
233+
if (options.log_dev_level >= kHighsLogDevLevelDetailed)
234+
analysePdlpSolution(options, lp, highs_solution);
234235
#endif
235236
} else {
236237
// Failure return from LP_SolvePDHG

0 commit comments

Comments
 (0)