Skip to content

perf(install): reduce install size and time #56

Open

Description

@AzulGarza

Problem

pip install foundationforecast installs every model backend as a hard dependency:
~250 packages, ~2 GB on macOS, plus ~3 GB of NVIDIA CUDA wheels on Linux via torch.

Largest contributors (installed size):

  • torch ~400 MB (+ ~3 GB nvidia-* wheels on Linux)
  • jax/jaxlib ~260 MB, only from timecopilot-uni2ts (Moirai)
  • mlx ~150 MB, from tabpfn (via tabpfn-time-series)
  • wandb ~70 MB, from timecopilot-timesfm
  • tensorboard + grpcio ~50 MB, from timecopilot-uni2ts
  • statsmodels, from tabpfn-time-series

Dev tools declared as runtime deps in forks we maintain:

  • timecopilot-toto: pytest, pytest-env, mypy, black, isort, types-*, boto3, matplotlib
  • timecopilot-timesfm: wandb, typer
  • timecopilot-uni2ts: jax[cpu], tensorboard, hydra-core

Proposal

  1. Trim the timecopilot-* forks (non-breaking): drop dev/training-only deps, release
    patch versions, bump minimum pins in pyproject.toml.
  2. Optional per-model extras (breaking, target v0.2.0): core deps stay minimal
    (pandas, numpy, utilsforecast, huggingface-hub, nixtla); add extras such as
    [chronos], [moirai], [timesfm], [toto], [tirex], [tabpfn], [t0],
    [granite], [tafsut], and [all].
    • Make foundationforecast/models/__init__.py import lazily (module __getattr__)
      and raise a clear "install foundationforecast[x]" error when a backend is missing.
    • Update CI to install [all], and update README/docs install sections.
  3. Docs quick win: document CPU-only torch for Linux users without a GPU:
    pip install torch --index-url https://download.pytorch.org/whl/cpu.

Notes

FoundationForecast takes model instances, so optional extras don't need core API changes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions