Skip to content

Commit 0992a90

Browse files
authored
Merge pull request #2600 from ERGO-Code/latest-docs
Documentation updates
2 parents 14eb056 + 7aac7ef commit 0992a90

File tree

10 files changed

+320
-65
lines changed

10 files changed

+320
-65
lines changed

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31"
33
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
44

55
[compat]
6-
Clang = "0.14, 0.17, 0.18"
6+
#Clang = "0.14, 0.17, 0.18"
77
Documenter = "0.27"

docs/README.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

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: 39 additions & 26 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

@@ -113,11 +113,12 @@ tolerance.
113113

114114
### Solutions without a corresponding basis
115115

116-
The HiGHS PDLP solver and the interior point solver without crossover
117-
(IPX) yield "optimal" primal and dual values that satisfy internal
118-
conditions for termination of the underlying algorithm. These
119-
conditions are discussed below, and are used for good reason. However
120-
they can lead to a misleading claim of optimality.
116+
The HiGHS PDLP solver and the interior point solvers (HiPO and IPX)
117+
without crossover yield "optimal" primal and dual values that satisfy
118+
internal conditions for termination of the underlying algorithm. These
119+
conditions are discussed below, and are used for good reason. However,
120+
particularly in the case of PDLP, they can lead to a misleading claim
121+
of optimality.
121122

122123
#### Interior point solutions
123124

@@ -138,6 +139,13 @@ HiGHS. It terminates when
138139
\end{aligned}
139140
```
140141

142+
In practice, the feasibility tolerances are readily satisfied when
143+
using interior point solvers. Hence their termination generally
144+
depends on satisfying the optimality tolerance, with relative
145+
feasibility satisfied to a higher tolerance than required. Thus the
146+
solution obtained using interior point solvers typically has small
147+
absolute feasibility errors.
148+
141149
#### PDLP solutions
142150

143151
The PDLP algorithm uses an independent [optimality tolerance](@ref
@@ -155,27 +163,32 @@ feasibility by construction. It terminates when
155163
\end{aligned}
156164
```
157165

166+
Unlike interior point solvers, PDLP does not readily satisfy the
167+
relative feasibility tolerances. Although they and the optimality
168+
tolerance are satisfied on successful termination, the solution
169+
obtained may have meaningful absolute feasibility errors.
170+
158171
#### HiGHS solutions
159172

160-
The relative measures used by PDLP and IPX assume that all components
161-
of the cost and RHS vectors are relevant. When an LP problem is in
162-
standard form this is true for ``b``, but not necessarily for the cost
163-
vector ``c``. Consider a large component of ``c`` for which the
164-
corresponding reduced cost value in ``s`` is also large, in which case
165-
the LP solution is insensitive to the cost. This component will
166-
contribute significantly to ``\|c\|`` and, hence, the RHS of the dual
167-
residual condition, allowing large values of ``\|c-A^Ty-s\|`` to be
168-
accepted. However, this can lead to unacceptably large absolute
169-
residual errors and non-optimal solutions being deemed "optimal". When
170-
equations in ``Ax=b`` correspond to inequality constraints with large
171-
RHS values and a slack variable (so the constraint is redundant) the
172-
same issue occurs in the case of primal residual errors. The solution
173-
of the LP is not sensitive to this large RHS value, but its
174-
contribution to ``||b||`` can allow large absolute primal residual
175-
errors to be overlooked.
173+
The relative measures used by HiPO, IPX and PDLP assume that all
174+
components of the cost and RHS vectors are relevant. When an LP
175+
problem is in standard form this is true for ``b``, but not
176+
necessarily for the cost vector ``c``. Consider a large component of
177+
``c`` for which the corresponding reduced cost value in ``s`` is also
178+
large, in which case the LP solution is insensitive to the cost. This
179+
component will contribute significantly to ``\|c\|`` and, hence, the
180+
RHS of the dual residual condition, allowing large values of
181+
``\|c-A^Ty-s\|`` to be accepted. However, this can lead to
182+
unacceptably large absolute residual errors and non-optimal solutions
183+
being deemed "optimal". When equations in ``Ax=b`` correspond to
184+
inequality constraints with large RHS values and a slack variable (so
185+
the constraint is redundant) the same issue occurs in the case of
186+
primal residual errors. The solution of the LP is not sensitive to
187+
this large RHS value, but its contribution to ``||b||`` can allow
188+
large absolute primal residual errors to be overlooked.
176189

177190
To make an informed assessment of whether an "optimal" solution
178-
obtained by IPX or PDLP is acceptable, HiGHS computes infinity norm
191+
obtained by HiPO, IPX or PDLP is acceptable, HiGHS computes infinity norm
179192
measures of ``b`` and ``c`` corresponding to the components that
180193
define the optimal solution. For ``c`` these are the components
181194
corresponding to positive values of ``x`` and reduced costs that are

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__](@ref
43+
option-user_objective_scale) and/or [__user\_bound\_scale__](@ref
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)