Commit 3f0d27f
authored
Latency reductions for concurrent mode (#1083)
These changes reduce concurrent-halt latency in the LP solve path by checking the halt flag at more points before long synchronous work and by moving expensive cleanup off the return path when we exit with `CONCURRENT_LIMIT`.
- Added earlier concurrent-halt checks in barrier and dual simplex around expensive non-interruptible steps, including barrier matrix/factorization setup, phase 2 initialization, and basis refactorization/transposes.
- Changed `basis_update_mpf_t `and `barrier_solver_t` from stack-owned temporaries to `std::unique_ptr` in the affected solve paths so their destruction can be deferred on `CONCURRENT_LIMIT`.
- On `CONCURRENT_LIMIT`, detached cleanup threads now take ownership of large temporary solver state so the main solve path can return sooner instead of blocking on teardown.
- Preserved solver progress metadata on early exit where applicable.
The intended behavior is unchanged aside from returning more quickly when a concurrent halt is requested, particularly in paths that previously spent significant time in setup or destruction before exiting.
(Description co-authored with Codex)
## Results
case | Presolve without | Presolve with | Delta presolve | Solve without | Solve with | Delta solve | Overhead without | Overhead with | Delta overhead | Improvement % | Total without | Total with | Delta total
-- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | --
Dual2_5000 | 10.11 | 10.27 | 0.16 | 24.57 | 24.52 | -0.05 | 9.81 | 4.61 | -5.2 | -53% | 34.37 | 29.12 | -5.25
L2CTA3D | 4.45 | 4.02 | -0.43 | 6.19 | 5.08 | -1.11 | 4.68 | 2.9 | -1.79 | -38% | 10.87 | 7.98 | -2.9
a2864 | 1.97 | 1.33 | -0.64 | 2.09 | 1.45 | -0.64 | 0.21 | 0.12 | -0.09 | -43% | 2.3 | 1.57 | -0.73
square41 | 0.9 | 0.67 | -0.23 | 6.22 | 5.64 | -0.58 | 0 | 0 | 0 | 0% | 6.22 | 5.64 | -0.58
scpm1 | 0.35 | 0.35 | 0 | 1.65 | 1.41 | -0.24 | 0.55 | 0.61 | 0.06 | 11% | 2.2 | 2.02 | -0.18
woodlands09 | 0.31 | 0.31 | 0 | 0.44 | 0.45 | 0.01 | 0.51 | 0.44 | -0.08 | -16% | 0.95 | 0.88 | -0.07
graph40-40 | 0.15 | 0.15 | 0 | 0.22 | 0.21 | 0 | 0.54 | 0.48 | -0.06 | -11% | 0.76 | 0.69 | -0.07
savsched1 | 0.21 | 0.22 | 0.01 | 0.4 | 0.4 | 0 | 0.72 | 0.66 | -0.05 | -7% | 1.12 | 1.07 | -0.05
datt256_lp | 0.14 | 0.15 | 0.01 | 0.3 | 0.31 | 0.01 | 0.22 | 0.16 | -0.06 | -27% | 0.52 | 0.47 | -0.04
neos-3025225 | 0.52 | 0.53 | 0.01 | 2.31 | 2.35 | 0.04 | 0.03 | 0.03 | 0 | 0% | 2.35 | 2.39 | 0.04
ex10 | 0.11 | 0.11 | 0 | 0.26 | 0.24 | -0.02 | 0.16 | 0.19 | 0.03 | 19% | 0.42 | 0.43 | 0.02
neos-5251015 | 0.18 | 0.17 | -0.01 | 0.52 | 0.51 | -0.01 | 0.67 | 0.73 | 0.07 | 10% | 1.18 | 1.24 | 0.06
set-cover-model | 1.23 | 1.3 | 0.07 | 7.38 | 7.57 | 0.19 | 0.19 | 0.77 | 0.57 | 300% | 7.57 | 8.33 | 0.77
dlr1 | 2.32 | 2.37 | 0.05 | 12.02 | 12.67 | 0.65 | 0.05 | 0.06 | 0.01 | 20% | 12.07 | 12.72 | 0.66
thk_48 | 3.39 | 3.77 | 0.38 | 15.96 | 17.22 | 1.26 | 0.72 | 0.61 | -0.11 | -15% | 16.68 | 17.82 | 1.15
thk_63 | 3.64 | 4.68 | 1.04 | 12.12 | 13.55 | 1.42 | 0.7 | 0.73 | 0.04 | 6% | 12.82 | 14.28 | 1.46
@rg20 wanted me to note this here: With regards to moving the destructor to a separate thread, we think there is an underlying issue that we probably want to understand first and fix any bug. The changes for moving the destructor to a detached thread has been removed. (Please see comments below) cc @chris-maes
## Issue
Authors:
- Sri Kainkaryam (https://github.com/srib)
Approvers:
- Chris Maes (https://github.com/chris-maes)
- Rajesh Gandham (https://github.com/rg20)
URL: #10831 parent 46b809a commit 3f0d27f
4 files changed
Lines changed: 80 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1094 | 1094 | | |
1095 | 1095 | | |
1096 | 1096 | | |
| 1097 | + | |
1097 | 1098 | | |
1098 | 1099 | | |
1099 | 1100 | | |
| |||
1124 | 1125 | | |
1125 | 1126 | | |
1126 | 1127 | | |
| 1128 | + | |
1127 | 1129 | | |
1128 | 1130 | | |
1129 | 1131 | | |
| |||
1253 | 1255 | | |
1254 | 1256 | | |
1255 | 1257 | | |
| 1258 | + | |
1256 | 1259 | | |
1257 | 1260 | | |
1258 | 1261 | | |
| |||
2297 | 2300 | | |
2298 | 2301 | | |
2299 | 2302 | | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
2300 | 2309 | | |
2301 | 2310 | | |
2302 | 2311 | | |
| |||
2305 | 2314 | | |
2306 | 2315 | | |
2307 | 2316 | | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
2308 | 2323 | | |
2309 | 2324 | | |
2310 | 2325 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2431 | 2431 | | |
2432 | 2432 | | |
2433 | 2433 | | |
2434 | | - | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
2435 | 2450 | | |
2436 | 2451 | | |
2437 | 2452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2488 | 2488 | | |
2489 | 2489 | | |
2490 | 2490 | | |
2491 | | - | |
2492 | 2491 | | |
2493 | 2492 | | |
2494 | 2493 | | |
| |||
2688 | 2687 | | |
2689 | 2688 | | |
2690 | 2689 | | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
2691 | 2694 | | |
2692 | 2695 | | |
2693 | 2696 | | |
| |||
2735 | 2738 | | |
2736 | 2739 | | |
2737 | 2740 | | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
2738 | 2745 | | |
2739 | 2746 | | |
2740 | 2747 | | |
2741 | 2748 | | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
2742 | 2753 | | |
2743 | 2754 | | |
2744 | 2755 | | |
| |||
2908 | 2919 | | |
2909 | 2920 | | |
2910 | 2921 | | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
2911 | 2925 | | |
2912 | 2926 | | |
2913 | 2927 | | |
| |||
2966 | 2980 | | |
2967 | 2981 | | |
2968 | 2982 | | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
2969 | 2986 | | |
2970 | 2987 | | |
2971 | 2988 | | |
| |||
3301 | 3318 | | |
3302 | 3319 | | |
3303 | 3320 | | |
| 3321 | + | |
| 3322 | + | |
| 3323 | + | |
3304 | 3324 | | |
3305 | 3325 | | |
3306 | 3326 | | |
| |||
3331 | 3351 | | |
3332 | 3352 | | |
3333 | 3353 | | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
3334 | 3357 | | |
3335 | 3358 | | |
3336 | 3359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| |||
222 | 223 | | |
223 | 224 | | |
224 | 225 | | |
225 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
226 | 230 | | |
227 | 231 | | |
228 | 232 | | |
| |||
309 | 313 | | |
310 | 314 | | |
311 | 315 | | |
312 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
313 | 320 | | |
314 | 321 | | |
315 | 322 | | |
| |||
581 | 588 | | |
582 | 589 | | |
583 | 590 | | |
| 591 | + | |
| 592 | + | |
584 | 593 | | |
585 | 594 | | |
586 | 595 | | |
| |||
681 | 690 | | |
682 | 691 | | |
683 | 692 | | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
684 | 697 | | |
685 | 698 | | |
686 | 699 | | |
| |||
0 commit comments