You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of the parallelization improvement plan tracked in PARALLELIZATION.md (Priority 4, optional/advanced).
Split out of #16 so it can be scoped and closed independently of progress bars (#18) and backend selection (#19).
Background
Real benchmarking done while investigating #15 showed that for af() at n.c = 24, B = 30, actual future::multisession wall-clock time ran 250-370% over the naive ideal (total sequential work ÷ cores) at cores = 8/10, purely from worker-startup and per-future dispatch overhead — i.e. parallelizing was a net loss at that problem size. PARALLELIZATION.md's "Performance Considerations" section already flags this qualitatively (n < 200, p < 50 as a rough threshold) but it's currently just documentation; the functions themselves don't act on it.
Tasks
Benchmark af(), vis(), and bglmnet() across a grid of problem sizes (n, p, B/n.c/nlambda) and core counts using bench::mark(), to establish where parallel overhead outweighs benefit for each function (their cost profiles likely differ)
Based on the benchmarks, add an automatic heuristic (or at minimum a message()/warning()) that falls back to cores = 1 (or suggests it) when the estimated problem size is too small to benefit from multisession overhead
Document the memory tradeoff: each worker holds its own copy of large objects (X, Xy, fitted models) — with N workers, expect roughly Nx memory footprint for large datasets. Add this to the relevant cores parameter documentation in af(), vis(), and bglmnet()
Consider exposing the benchmarking script/results (e.g. as a vignette or inst/benchmarks/ script) so the heuristic thresholds are reproducible and can be re-validated as the package evolves
See PARALLELIZATION.md section "Performance Considerations" for existing (currently qualitative) guidance, and the af() benchmark discussion in #15 for methodology.
Part of the parallelization improvement plan tracked in PARALLELIZATION.md (Priority 4, optional/advanced).
Split out of #16 so it can be scoped and closed independently of progress bars (#18) and backend selection (#19).
Background
Real benchmarking done while investigating #15 showed that for
af()atn.c = 24,B = 30, actualfuture::multisessionwall-clock time ran 250-370% over the naive ideal (total sequential work ÷ cores) atcores = 8/10, purely from worker-startup and per-future dispatch overhead — i.e. parallelizing was a net loss at that problem size.PARALLELIZATION.md's "Performance Considerations" section already flags this qualitatively (n < 200, p < 50as a rough threshold) but it's currently just documentation; the functions themselves don't act on it.Tasks
af(),vis(), andbglmnet()across a grid of problem sizes (n,p,B/n.c/nlambda) and core counts usingbench::mark(), to establish where parallel overhead outweighs benefit for each function (their cost profiles likely differ)message()/warning()) that falls back tocores = 1(or suggests it) when the estimated problem size is too small to benefit frommultisessionoverheadX,Xy, fitted models) — with N workers, expect roughly Nx memory footprint for large datasets. Add this to the relevantcoresparameter documentation inaf(),vis(), andbglmnet()inst/benchmarks/script) so the heuristic thresholds are reproducible and can be re-validated as the package evolvesSee PARALLELIZATION.md section "Performance Considerations" for existing (currently qualitative) guidance, and the
af()benchmark discussion in #15 for methodology.