GeneSuite
Documentation / Understand the methods

11. Large-scale computation and approximation

Advanced notes: contents · Abbreviations

1 The large object need not be stored

For sparse direct computation see Chen et al. (2008); for iterative and matrix-free linear algebra see Saad (2003).

The covariance representation \(V=ZKZ^\top+R\) defines a model independently of whether \(V\) is materialized. Dense \(n\times n\) storage grows quadratically; a generic dense factorization grows cubically. Sparse mixed-model equations can be much smaller computationally, but factor fill depends on connectivity and ordering rather than only the input nonzero count.

A matrix-free method computes products with \(C\) or \(V\) through incidence, relationship and residual operators. It saves storage but must repeatedly apply those operators. Packed marker products avoid an explicit dense \(G\) and can reuse a genotype representation across traits or right-hand sides.

2 Factorization, repeated solves and PCG

Preconditioning and Krylov iteration are treated systematically by Saad (2003). Their use does not remove the need for a scientifically correct target system.

A retained sparse factor amortizes analysis and numerical factorization over many right-hand sides. Changing covariance parameters may preserve sparsity analysis while requiring a new numerical factor. Selected uncertainty and trace calculations can require many solves beyond the prediction solve.

For a symmetric positive definite (SPD) target system, preconditioned conjugate gradient (PCG) uses a compatible SPD preconditioner to change convergence, not the target equations. The preconditioner may be approximate; its setup cost, application cost and effect on iteration count all belong in the total budget. Changing preconditioners changes finite stopping behavior, so verify the reconstructed original-system residual rather than assuming that a preconditioned norm proves the required acceptance.

Independent trait/channel right-hand sides can sometimes be batched to reuse memory traffic and factors. Batching does not imply that all traits are independent: the operator must still apply their genetic and residual covariance.

3 Distinguish statistical and numerical approximations

Approximation What can change? Required assessment
Approximate PCG preconditioner Convergence path and finite stopping error Original-system acceptance and total work
Approximate relationship or APY target precision The fitted covariance model Prediction/likelihood sensitivity to approximation
Low-rank covariance truncation Available genetic directions Rank sensitivity and target-population validation
Randomized trace estimation Numerical derivative/curvature estimates Probe uncertainty, solve error and optimizer behavior
Stochastic PEV estimation Reported uncertainty estimates Target-specific precision and calibration
Genotype imputation Predictor information and sometimes covariance Imputation assumptions, alignment and uncertainty

A stochastic diagonal used only to construct a preconditioner is not a stochastic estimate of the final predictions or their prediction-error variance (PEV). It can preserve the same target equations and acceptance gates. This does not prove that every probe count or model combination is qualified.

4 Trace estimation has two sources of error

Stochastic trace estimation was developed by Hutchinson (1989). Avron and Toledo (2011) analyzes sample requirements for implicit symmetric positive semidefinite matrices; those relative-error guarantees should not be transferred automatically to every derivative operator.

For suitable independent zero-mean unit-covariance probes \(z_b\),

\[ \operatorname{tr}(B)=E(z_b^\top Bz_b),\qquad \widehat{\operatorname{tr}(B)}=\frac1m\sum_{b=1}^m z_b^\top Bz_b. \]

Monte Carlo error decreases with probe count under the corresponding moment conditions, but products involving an inverse may also have iterative solve error. More probes do not automatically remove bias from insufficiently solved systems. Reusing probes across parameter evaluations can stabilize comparisons, but induces dependence that must be respected when assessing precision.

Randomized derivatives and randomized uncertainty have different scientific roles. Their precision controls and solve accounting should be reported separately, not inferred from prediction convergence.

5 Hardware and reproducible performance

Sparse triangular solves, marker decoding and dense products have different memory-access patterns. Physical cores, simultaneous multithreading, memory bandwidth, non-uniform memory access (NUMA) placement and Basic Linear Algebra Subprograms (BLAS)/OpenMP runtime choices can change timings without changing the model. Thread counts alone do not establish comparable hardware use.

Record the node central processing unit (CPU) model, allowed CPU mask, physical-core allocation, runtime versions and placement settings. Avoid universal affinity or memory-placement prescriptions: a measured interleaving benefit on one system need not transfer to another. Separate setup from repeated operations and include end-to-end time.

5.1 Richer covariance models create different computational workloads

An annotation-weighted covariance can apply \(K_a v=W D(W^\top v)\) without forming a dense animal matrix. Its parameter derivative has the same pattern with derivative weights. Shared marker passes can therefore serve several estimation directions, but increasing annotation count still adds derivative, trace and optimization work. A packed prediction product alone is not a complete covariance-estimation algorithm.

For phenomics, separate genetic dimensions, trait count, basis size and record count. Reduced-rank covariance can save parameters and operations by imposing structure; a structured operator representation can instead preserve a specified model while changing storage. Distinguish these cases when comparing timings. Include measurement extraction and representation learning in end-to-end costs where they are required for deployment. See functional derivatives and phenomics estimation.

6 Resource accounting

Sparse animal-model restricted maximum likelihood (REML) illustrates why factorization and repeated right-hand-side (RHS) solves need separate accounting (Johnson and Thompson, 1995). For large single-step covariance estimation with Monte Carlo operations, see Bermann et al. (2025).

Report factor dimensions and fill, resident marker cache, right-hand-side batch width, iteration count, operator applications and backend solve RHS. Refinement counts describe backend correction work and cannot be recovered from PCG iteration counts alone. Distinguish measured counters from inferred averages.

Memory metrics also differ: a sampled sum of process resident set size (RSS) is not the same as GNU Time maximum RSS or a Slurm/cgroup high-water mark. Preserve the metric, sampling interval and possibility of shared-page double counting.

For route-specific controls and limits see the solver guide, packed single-step REML and prediction-error guide.

NoteImplementation in gsuite

Sparse-direct and matrix-free execution, packed marker products, retained factors and specified stochastic estimation are implemented through the solver routes and packed REML. The execution reports record phase timings, memory and placement information. Exact/stochastic uncertainty and approximate preconditioning have separate controls and qualification; backend coverage identifies which combinations are available. Hardware-policy benefits remain dependent on the workload.

Next: checking and validation.

For the derivations behind the operator, elimination, REML and uncertainty calculations, see the algorithmic reference.

For applications to automated measurements and high-dimensional traits, see large-scale phenomics.

7 References

Avron, H., and Toledo, S. (2011). Randomized algorithms for estimating the trace of an implicit symmetric positive semi-definite matrix. Journal of the ACM, 58(2), 8:1–8:34. https://doi.org/10.1145/1944345.1944349.
Bermann, M., Legarra, A., Aguilar, I., Alvarez-Munera, A., Misztal, I., and Lourenco, D. (2025). Estimation of (co)variance components for very large datasets and complex single-step genomic models. Genetics Selection Evolution, 57(1). https://doi.org/10.1186/s12711-025-01006-9.
Chen, Y., Davis, T. A., Hager, W. W., and Rajamanickam, S. (2008). Algorithm 887: CHOLMOD, Supernodal Sparse Cholesky Factorization and Update/Downdate. ACM Transactions on Mathematical Software, 35(3), 22:1–22:14. https://doi.org/10.1145/1391989.1391995.
Hutchinson, M. F. (1989). A Stochastic Estimator of the Trace of the Influence Matrix for Laplacian Smoothing Splines. Communications in Statistics - Simulation and Computation, 18(3), 1059–1076. https://doi.org/10.1080/03610918908812806.
Johnson, D. L., and Thompson, R. (1995). Restricted Maximum Likelihood Estimation of Variance Components for Univariate Animal Models Using Sparse Matrix Techniques and Average Information. Journal of Dairy Science, 78(2), 449–456. https://doi.org/10.3168/jds.S0022-0302(95)76654-1.
Saad, Y. (2003). Iterative Methods for Sparse Linear Systems. 2nd ed. Society for Industrial and Applied Mathematics. https://doi.org/10.1137/1.9780898718003.