GPU-accelerated intrinsic dimension estimators in PyTorch. A port of scikit-dimension with batched/vectorized implementations and CUDA support.
scikit-dimension is the reference library for intrinsic dimension (ID) estimation but
is CPU-only and relies heavily on per-point Python loops. torchid re-implements every
estimator using batched torch ops so the same methods run 100–2700× faster on GPU
(measured on an NVIDIA H100, see BENCHMARKS.md) while producing outputs
that match the reference library within documented tolerances.
pip install "torchid[cpu]" # CPU-only (faiss-cpu)
pip install "torchid[cuda]" # GPU-enabled (faiss-cuda-cu128, manylinux_2_28+)For a CUDA-capable install, also pick the PyTorch wheel that matches your driver, e.g.:
pip install torch --index-url https://download.pytorch.org/whl/cu128
pip install "torchid[cuda]"For running parity tests against scikit-dimension from a clone:
uv sync --group validationimport torch
from torchid.estimators import lPCA
X = torch.randn(10_000, 50, device="cuda")
est = lPCA().fit(X)
print(est.dimension_)