Repository navigation
Commit e1950d5
authored
Guard the power-mean relaxation factor estimate (#88)
The asymmetric power-mean sweeps overrelax by a factor `ω` estimated
from plain sweeps and raised from the rates of later windows. Two
defects in that rule made some solves far slower than plain sweeps.
An `ω` set on a plateau was never lowered. Far from the fixed point the
imbalance can stay nearly constant for several sweeps before it
contracts quickly. An `ω` estimated there is near its cap, and above
the optimum the relaxed rate is `ω - 1` whatever the plain rate is, so
the windows read it as steady progress. The plain estimate now waits
while the contraction is still improving from one sweep to the next,
and sets `ω` no higher than 1.5, where a relaxed sweep contracts by at
least half even above the optimum. Windows raise it from there.
A window was judged against the smallest imbalance of all earlier
windows. The imbalance is the size of the plain step, which a relaxed
iterate overshoots by `ω - 1` times, so its level rises with `ω`, and
windows at a raised `ω` could show no progress while the iteration
converged. Those windows tripped the stall rule, which halves `ω - 1`
when it should rise. Each window is now judged against the window
before it. The first window after `ω` changes is still judged against
one at the old `ω` and reads as slow, so one window shrinks `2 - ω` by
at most a factor of 8.
The handoff to Newton after the plain estimate is predicted at the rate
of the factor that estimate implies, as before, not at the capped
factor the first relaxed sweeps use.
On 1200 random matrices of 2 to 8 rows and columns (lognormal entries
with σ of 1, 3 or 6, up to half zeroed), with `p` of 1 and 2 and the
default and flat starts, 4800 runs in all. With `newton = false`, on
the 4663 runs that plain sweeps finish in 50,000:
| | before | after |
|---|---|---|
| sweeps | 552,513 | 254,336 |
| runs more than 2 sweeps slower than plain | 213 | 9 |
| worst ratio to plain | 85 | 1.73 |
| runs where the stall rule fires (of 4800) | 55 | 3 |
| runs plain does not finish that the rule does | 87 of 137 | 101 of 137 |
The 3 remaining stalls are runs that neither rule finishes in 10^5
sweeps. With `newton = true`:
| | before | after |
|---|---|---|
| runs handed to Newton | 949 | 974 |
| passes over the support | 317,998 | 302,284 |
| factorizations | 5130 | 5227 |
Sweeps with `newton = false` on larger problems, plain / before / after:
| problem | plain | before | after |
|---|---|---|---|
| bidiagonal n=100, flat start, p=1 | 97,194 | 6114 | 6466 |
| bidiagonal n=100, flat start, p=2 | >10^5 | 7610 | 7651 |
| cyclic bidiagonal n=50, p=1 | 19,630 | 2063 | 739 |
| cyclic bidiagonal n=200, p=2 | >10^5 | 27,464 | 27,459 |
| cyclic tridiagonal n=100, p=2 | 82,699 | 940 | 940 |
| integral equation n=100, p=1 | >10^5 | 16,220 | 2217 |
| sparse lognormal 200x200 3%, flat start, p=2 | 3557 | 223 | 241 |
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent cb4bc5e commit e1950d5
2 files changed
Lines changed: 89 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
| |||
339 | 345 | | |
340 | 346 | | |
341 | 347 | | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
349 | 371 | | |
350 | 372 | | |
351 | 373 | | |
352 | | - | |
353 | | - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
354 | 377 | | |
355 | 378 | | |
356 | 379 | | |
| |||
360 | 383 | | |
361 | 384 | | |
362 | 385 | | |
363 | | - | |
364 | | - | |
| 386 | + | |
| 387 | + | |
365 | 388 | | |
366 | 389 | | |
367 | 390 | | |
| |||
376 | 399 | | |
377 | 400 | | |
378 | 401 | | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
384 | 409 | | |
385 | 410 | | |
386 | | - | |
| 411 | + | |
387 | 412 | | |
388 | 413 | | |
389 | 414 | | |
390 | 415 | | |
391 | 416 | | |
392 | | - | |
| 417 | + | |
393 | 418 | | |
394 | 419 | | |
395 | 420 | | |
396 | 421 | | |
397 | 422 | | |
398 | 423 | | |
399 | | - | |
| 424 | + | |
400 | 425 | | |
401 | 426 | | |
402 | 427 | | |
403 | 428 | | |
404 | 429 | | |
405 | 430 | | |
406 | | - | |
| 431 | + | |
407 | 432 | | |
408 | 433 | | |
409 | | - | |
| 434 | + | |
410 | 435 | | |
411 | | - | |
| 436 | + | |
412 | 437 | | |
413 | 438 | | |
414 | 439 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
179 | 186 | | |
180 | 187 | | |
181 | 188 | | |
| |||
187 | 194 | | |
188 | 195 | | |
189 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
190 | 227 | | |
191 | 228 | | |
192 | 229 | | |
| |||
0 commit comments