Skip to main content

FaST-LMM

PyPI version Build Status Python versions

FaST-LMM, which stands for Factored Spectrally Transformed Linear Mixed Models, is a program for performing genome-wide association studies (GWAS) on datasets of all sizes, up to one million individuals.

This release contains the following features, each illustrated with an IPython notebook.

Improvements:

A C++ version, which is generally less functional, is available. See http://fastlmm.github.io/.

Quick install:

pip install fastlmm

FaST-LMM supports Python 3.11.5 through 3.15. HDF5 and BGEN file support are optional and available on Python 3.11 through 3.14: install fastlmm[hdf5], fastlmm[bgen], or fastlmm[hdf5,bgen].

For best CPU performance, limit BLAS threads to your physical core count (for example, export OMP_NUM_THREADS=16 on a 16-core, 32-thread CPU); in our tests, using every logical core was slower. For large problems, an NVIDIA GPU is much faster; see GPU and float32.

GPU and float32

FaST-LMM's single-kernel single_snp can run on an NVIDIA GPU, in float32 (strongly recommended) or float64, thanks to CuPy, the NumPy-compatible GPU array library. On a synthetic dataset with 14,925 individuals and 100,000 SNPs, float32 on an RTX 3060 ran over 10 times as fast as the default CPU float64, and about 5 times as fast as CPU float32. On the CPU alone, float32 ran about 2.5 times as fast as float64. These figures were measured with pre-release versions of FaST-LMM 1.1.0, PySnpTools 1.1.0, and bed-reader 1.3.0; we will repeat the benchmark with the final releases. See the benchmark for details and how to reproduce it.

Install the cupy extra:

pip install "fastlmm[cupy]"

Then ask for the GPU and float32:

from fastlmm.association import single_snp

results = single_snp(bed_fn, pheno_fn, covar=cov_fn, count_A1=False, xp="cupy", dtype="float32")

Float32 changes p-values slightly, so compare against float64 on representative data when precision matters. Other FaST-LMM functions, including two-kernel single_snp and epistasis, warn and run on the CPU in float64. GPU support requires NVIDIA CUDA 13 (driver 580 or later) on x86-64 Windows or Linux, including WSL2; without a CUDA 13 Toolkit installed, also install "cupy-cuda13x[ctk]" for NVIDIA's CUDA libraries. Python 3.15 is currently CPU-only: CuPy has no Python 3.15 wheel yet, so pip install "fastlmm[cupy]" fails there; install fastlmm without the extra. A 12 GB card handled 20,000 individuals with a full-rank kernel, and 50,000 individuals with a 5,000-SNP low-rank kernel; the guide gives the general rule. See the GPU guide for setup, defaults, caching, and limitations.

Documentation

Code

Development

The project uses uv for reproducible development environments, dependency locking, testing, and builds:

uv sync --frozen --extra dev --extra hdf5 --extra bgen
cd tests
uv run --frozen --no-sync python test.py
cd ..
uv build --no-sources

Testing has two supported runners. pytest collects Python tests and module, reStructuredText, and Markdown doctests under fastlmm/; it is useful for focused tests and editor integration. The canonical tests/test.py runner also executes the input-based expected-output cases in tests/inputs and assembles the project's legacy unittest suites. The runners overlap but cover different workflows, so pytest collection does not replace the canonical runner. CI and release qualification also run the focused backend and dtype pytest modules. Cases that need a usable CUDA device require a separate GPU run.

See RELEASING.md for lower-bound, artifact, notebook, and release qualification.

Policy on AI-assisted development and contributions

AI tools may be used as productivity aids for drafting, exploration, and refactoring. Every contributed code or documentation change must be reviewed, edited, and validated by a human. AI does not replace design judgment, testing, or human responsibility for correctness.

The repository's published instructions and constraints for AI tools are in AGENTS.md.

Contacts

Metadata

Release files for fastlmm 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastlmm 1.1.0
File Size Uploaded Provenance Actions
fastlmm-1.1.0.tar.gz 1.3 MB With provenance Details for fastlmm-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fastlmm 1.1.0
File Interpreter ABI Platform Actions
fastlmm-1.1.0-py3-none-any.whl Python 3 none any Details for fastlmm-1.1.0-py3-none-any.whl

Total release size: 2.7 MB

Release files / fastlmm-1.1.0.tar.gz

Download URL fastlmm-1.1.0.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
65a5bb47c97e23b53eb73c38d7e73c1c40b112924ffc33b9b58466a524a35c21
BLAKE2b-256 checksum
How to use checksums
1e8041c76e22d520ba02ad4b42ebb5fc92c142e85e93487254f05aa805ae391f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / fastlmm-1.1.0-py3-none-any.whl

Download URL fastlmm-1.1.0-py3-none-any.whl
Size 1.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
d70e321e957deba0043327af75ba02a8662e0f1f646399d2f07c00d96d8f6bd6
BLAKE2b-256 checksum
How to use checksums
60c8ae27f51fe8863f5202576225f828afc6c23af73b8296f60bd3ebde008ff2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for fastlmm 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fastlmm-1.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files Full provenance

0.2.15

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page