Skip to content

MCMC is extremely slow and OOM-prone — needs optimization #70

@eprifti

Description

@eprifti

Problem

MCMC is unusably slow on typical metagenomics datasets (1980 features, 180 samples). With default parameters (n_iter=10000), it gets OOM-killed in Docker. Even with reduced n_iter=1000, it's orders of magnitude slower than GA, ACO, or SA.

Root causes

  1. Not parallelized — runs entirely sequentially on one core
  2. SBS (Sequential Backward Selection) iterates from all features down to nmin, running full MCMC at each step — O(features × n_iter) total iterations
  3. Memory usage — stores trace data for all iterations × all features
  4. No GPU support — unlike GA/Beam

Benchmark comparison (Qin2014, 1980 features, 180 samples)

Method Time Memory
ILS 0.05s ~10MB
LASSO 0.1s ~10MB
SA 0.3s ~10MB
GA 0.5s ~50MB
ACO 7.1s ~50MB
MCMC OOM (>256MB) or minutes >>256MB

Potential fixes

  • Parallelize MCMC iterations (each chain independent)
  • Reduce memory: don't store full trace, only summary statistics
  • Pre-filter features before MCMC (use feature selection to reduce to top 50-100)
  • Add progress logging (currently no output during long runs)
  • Lower defaults: n_iter=1000, n_burn=500 (done in v0.9.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions