Skip to content

Repository Map

This page gives a quick path through the repository for contributors and power users.

Top-level areas

PathPurpose
README.mdGitHub landing page
docs/.vitepress/config.jsNavigation and site structure for the /docs/ site
web/Static landing page assets for the published site root
docs/VitePress source for the versioned documentation site
examples/Notebooks and runnable examples
foreblocks/Main forecasting library
foretools/Companion tooling
darts/Neural architecture search (DARTS)

foreblocks/

PathPurpose
foreblocks/__init__.pyTop-level public exports
foreblocks/config.pyPublic configuration dataclasses (ModelConfig, TrainingConfig)
foreblocks/ops/Low-level compute kernels (Triton/CUDA): kernels/ (grouped_gemm, swiglu, norms), attention/ (FLA, fused RoPE, paged/chunked), mamba/ (SSD, conv1d), raven/
foreblocks/layers/Reusable nn.Module primitives: norms/, embeddings/, graph/
foreblocks/modules/Composable model modules: attention/, moe/, blocks/, heads/, skip/
foreblocks/models/Assembled models + composition APIs (ForecastingModel, GraphForecastingModel), popular/ named models, transformer/ stack, kan/ (Kolmogorov-Arnold backbone)
foreblocks/sequence/Alternative sequence backbones: mamba/ (original), mamba_hybrid/ (formerly custom_mamba), raven/ (formerly custom_raven)
foreblocks/core/Core forecasting internals (model, att, sampling, extend), plus training/ (trainer) and evaluation/ (metrics)
foreblocks/data/Dataset and dataloader helpers
foreblocks/ts_handler/Preprocessing and sequence construction
mltracker/Experiment tracking
foreblocks/experimental/Not-yet-stable components: attention_kernels/ (formerly custom_att, has own setup.py)
foreblocks/third_party/Small vendored compatibility helpers; larger external projects should stay outside the wheel

Package organization (post-reorg)

The package was reorganized into a tiered layout. There are no compatibility shims — old import paths (foreblocks.transformer.*, foreblocks.blocks.*, foreblocks.custom_mamba.*, foreblocks.custom_raven.*, foreblocks.custom_att.*) were hard-renamed. See Reorg Migration Map for the full old → new table.

TierPackageWhat lives here
computeforeblocks/ops/Triton/CUDA kernels, no nn.Module API surface
primitivesforeblocks/layers/Reusable nn.Module primitives (norms, embeddings, graph)
modulesforeblocks/modules/Composable model modules (attention, moe, blocks, heads, skip)
modelsforeblocks/models/Fully assembled models + composition, incl. popular/ and transformer/
backbonesforeblocks/sequence/Alternative sequence backbones (mamba, mamba_hybrid, raven)
experimentalforeblocks/experimental/Not-yet-stable sub-projects (e.g. attention_kernels)

Conventions:

  • ops/ is pure compute. If it imports torch.nn as an API surface, it belongs in layers/ or modules/.
  • modules/blocks/ holds research blocks; models/popular/ holds the named end-to-end models (NBEATS, Informer, …). The transformer/popular/ and blocks/popular/ split was merged into models/popular/.
  • sequence/ drops the old custom_ prefix; custom_mambamamba_hybrid to distinguish it from the original mamba.
  • Frontend assets under foreblocks/studio/ and mltracker/dashboard_v2/: package only built dist assets; keep node_modules, runtime databases, and local tracker artifacts out of git and release archives.
  • mltracker/mltracker_data/: prefer .foreblocks/mltracker_data, ~/.foreblocks/mltracker_data, or an explicit user-configured run directory rather than the package tree.

foretools/

PathPurpose
foretools/tsgen/Synthetic time-series generation
foretools/bohb/BOHB, TPE configuration, pruning, and optimization plots
foretools/foreminer/Exploratory analysis and diagnostics
foretools/fengineer/Feature engineering utilities
foretools/emd_like/Decomposition tools
foretools/tsaug/AutoDA-Timeseries: automated data augmentation with adaptive policy

Recommended entry points by task

TaskEntry point
Training a baseline modelREADME.md, Getting Started
Understanding architecture compositionforeblocks/models/
Working with graph forecastingforeblocks/models/graph_forecasting.py, foreblocks/layers/graph/
Writing Triton kernelsforeblocks/ops/
Configuring runsforeblocks/config.py
Building dataloadersforeblocks/data/dataset.py
Adding preprocessing logicforeblocks/ts_handler/preprocessing.py
Exploring transformer internalsforeblocks/models/transformer/transformer.py
Working on architecture searchdarts/
Using SSM / Mamba-style blocksforeblocks/sequence/mamba_hybrid/
Generating synthetic dataforetools/tsgen/
Running hyperparameter searchforetools/bohb/
Augmenting training data adaptivelyforetools/tsaug/

MIT License