Skip to main content

A Rust-accelerated, scikit-learn-compatible machine learning library — drop-in replacement with 2-18x speedups

Project description

Thermite ML

A blazing-fast, Rust-accelerated machine learning library for Python — drop-in compatible with scikit-learn.

Thermite: an exothermic reaction that burns at 2500°C. Your ML training should be just as fast.

License: MIT Python 3.8+ Rust PyPI


Why Thermite?

scikit-learn is the most widely-used ML library in the world (40M+ monthly downloads), but its internals are built on NumPy/SciPy/Cython — fast for 2010, but bottlenecked by 2026 standards.

Thermite rewrites the compute-heavy core natively in Rust using explicit SIMD, Rayon multithreading, and matrixmultiply optimizations. We expose the exact same Python API you already know. No new syntax. No migration guide. Just import thermite instead of import sklearn.

Unmatched Capabilities

  • Zero-Copy Polars Integration: Feed Apache Arrow polars DataFrames directly into Thermite's Rust core without any conversion or data duplication.
  • GPU Acceleration (wgpu): Native WebGPU/CUDA hardware acceleration backend thermite-gpu. Dispatch compute shaders for massive ensemble aggregations and matrix multiplications instantly by simply adding device='gpu'.
  • True Parallelism (No GIL): Unlike Scikit-Learn which relies on heavy multiprocess pickling via joblib, Thermite releases the Python GIL during heavy computation. GridSearchCV and RandomizedSearchCV effortlessly scale across all your cores with zero IPC overhead.
  • Native Categorical & Sparse Support: Decision Trees handle categorical features natively (bypassing One-Hot Encoding overhead). LinearRegression and KMeans natively ingest and optimize scipy.sparse matrices.
  • Out-of-Core Learning: Memory too small? Use .partial_fit() to train GaussianNB or LogisticRegression on streaming datasets incrementally.

The Numbers (Performance Superiority)

Thermite offers incredible performance boosts while maintaining 100% accuracy parity.

Operation scikit-learn Thermite Speedup
LogisticRegression.fit (Sparse NLP) 0.1068s 0.0059s 18.22x
LinearSVC.fit (Sparse TF-IDF) 0.0244s 0.0022s 10.99x
RandomForest.fit (Categorical Splits) 0.1806s 0.0653s 2.76x
LinearRegression.fit (Dense 10k) 0.0238s 0.0100s 2.37x
KMeans.fit (Dense) 0.0829s 0.0356s 2.33x
GridSearchCV (100 folds, 8 cores) ~14.0s ~1.5s ~9.3x

Tested on an M2 Apple Silicon chip. See BENCHMARKS.md for reproducible scripts.


Installation

Thermite v1.0.0 is distributed as pre-compiled wheels for macOS, Linux, and Windows. No Rust toolchain required!

pip install thermite-ml

Quick Start: scikit-learn Drop-In

# The API is 100% identical to scikit-learn
from thermite.ensemble import RandomForestClassifier
from thermite.model_selection import train_test_split
from thermite.preprocessing import StandardScaler

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)

scaler = StandardScaler()
X_train = scaler.fit_transform(X_train)
X_test = scaler.transform(X_test)

# Opt-in to Hardware Acceleration with `device='gpu'`
clf = RandomForestClassifier(n_estimators=100, n_jobs=-1, device='gpu')
clf.fit(X_train, y_train)

print(f"Accuracy: {clf.score(X_test, y_test):.4f}")

Zero-Copy Polars Integration

Traditional scikit-learn forces you to convert polars DataFrames to pandas or numpy, triggering a massive memory copy. Thermite natively ingests the underlying Apache Arrow memory buffers:

import polars as pl
from thermite.linear_model import LogisticRegression
from thermite.polars_compat import make_polars_pipeline

df = pl.read_csv("100GB_dataset.csv")

# Instantly train directly on the Polars DataFrame
model = make_polars_pipeline(LogisticRegression())
model.fit(df.select(pl.exclude("target")), df["target"])

System Architecture

Thermite is structured to provide safety, performance, and portability:

  1. thermite-core (Rust): The backbone. Implements the mathematical optimization routines using ndarray and rayon. Safe, memory-efficient, and brutally fast.
  2. thermite-gpu (Rust): WebGPU (wgpu) based compute shader dispatch system targeting Vulkan, Metal, and DX12 dynamically.
  3. thermite-binding (Rust/PyO3): The translation layer bridging Python NumPy arrays to Rust contiguous views with zero allocation.
  4. thermite (Python): The high-level Python wrappers that mimic scikit-learn estimator APIs, implementing input validation and BaseEstimator compatibility.

Supported Algorithms

  • Linear Models: LinearRegression, Ridge, Lasso, LogisticRegression (Binary & Multinomial OvR), LinearSVC.
  • Ensembles: RandomForestClassifier, RandomForestRegressor, GradientBoostingClassifier, GradientBoostingRegressor.
  • Trees: DecisionTreeClassifier, DecisionTreeRegressor.
  • Clustering: KMeans, DBSCAN.
  • Decomposition: PCA.
  • Probabilistic: GaussianNB.
  • Preprocessing: StandardScaler, MinMaxScaler, OneHotEncoder, LabelEncoder.
  • Pipelines: Pipeline, GridSearchCV, cross_val_score.
  • Deep Learning Connectivity: Native __dlpack__ integrations for PyTorch/JAX from_dlpack zero-copy tensor passing.
  • AutoML: Rust native BayesianOptimizer utilizing Ridge surrogates.

What Sets Thermite Apart & Competitive Comparison

While scikit-learn dominates the ML ecosystem (with over 100+ algorithms and extensive preprocessing), Thermite differentiates itself as an extreme performance overlay for production deployments.

Why people still use scikit-learn:

  1. Algorithm Breadth: scikit-learn offers extensive specialized algorithms (e.g. Gaussian Mixture Models, complex Imputers like MICE) not yet ported to Thermite.
  2. Ecosystem Tooling: Vastly wider array of third-party plugins.

Why Thermite is unique:

  1. Rust-Native & Zero-Copy: While similar projects like Intel(R) Extension for Scikit-learn try to accelerate operations by monkey-patching Cython with daal4py, Thermite is rewritten ground-up in Rust. We achieve true zero-copy data transmission for Apache Arrow/Polars AND Deep Learning frameworks (PyTorch/JAX via DLPack).
  2. Distributed Computing Preparedness: Thermite's Rust estimators derive Serde enabling high-speed bincode serialization out-of-the-box. This natively plugs into distributed execution engines like Ray and Dask without the heavy overhead of Python's standard pickle.
  3. Rust AutoML: Instead of looping cross-validation in Python, Thermite provides a fast native BayesianOptimizer.
  4. Scale-up Milestones v1.3.0:
    • Text Preprocessing: Blazing fast CountVectorizer and TfidfVectorizer utilizing Rust's hash maps.
    • Advanced Imputation: IterativeImputer handles missing values dynamically via Ridge regression.
    • Histogram-Based GBDT: Fast discretizing tree building (HistGradientBoostingClassifier, HistGradientBoostingRegressor).
    • Deep Learning: Built-in MLPClassifier with GPU-accelerated forward passes (thermite_gpu).
  5. Scale-up Milestones v1.4.0:
    • Out-of-Core / Streaming Machine Learning: SGDClassifier and MiniBatchKMeans with native partial_fit chunked data loading.
    • Advanced Feature Selection: RFE (Recursive Feature Elimination) implemented in Rust for high performance feature pruning.
    • Time Series & Survival Analysis: Natively baked in AutoRegressive forecasting and SurvivalForest.
    • Native ONNX Export: Export trained core models directly to ONNX binaries with .to_onnx() without overhead.
  6. Scale-up Milestones v1.6.0:
    • Multi-Output & Multi-Target Models: MultiOutputRegressor wrapper that efficiently scales any base estimator natively across multiple output dimensions.
    • Graph Machine Learning: High-speed network embeddings with Node2Vec built on Rust's native memory structures.
    • Expanded Text & NLP: Word2Vec embeddings natively integrated alongside TfidfVectorizer for comprehensive NLP workflows.
    • Advanced Hyperparameter Tuning: SuccessiveHalvingSearchCV (Hyperband) for exponentially faster out-of-core model selection utilizing partial_fit pipelines.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thermite_ml-1.6.0.tar.gz (109.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

thermite_ml-1.6.0-cp38-abi3-win_amd64.whl (917.2 kB view details)

Uploaded CPython 3.8+Windows x86-64

thermite_ml-1.6.0-cp38-abi3-win32.whl (820.7 kB view details)

Uploaded CPython 3.8+Windows x86

thermite_ml-1.6.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

thermite_ml-1.6.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ i686

thermite_ml-1.6.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

thermite_ml-1.6.0-cp38-abi3-macosx_11_0_arm64.whl (985.0 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

thermite_ml-1.6.0-cp38-abi3-macosx_10_12_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file thermite_ml-1.6.0.tar.gz.

File metadata

  • Download URL: thermite_ml-1.6.0.tar.gz
  • Upload date:
  • Size: 109.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for thermite_ml-1.6.0.tar.gz
Algorithm Hash digest
SHA256 4c00a23b85724f01e9dce3cfe0093d8f8fcd6910a46f032afd26e5f2b100aa1d
MD5 a82b01df63366160b71e6bd28de2259b
BLAKE2b-256 38f8ff5ada6017ba53aa24b1b5a0bf6359f59cf4ddbb37d5611b752bd77df594

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-1.6.0.tar.gz:

Publisher: release.yml on KartavyaDikshit/Thermite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file thermite_ml-1.6.0-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: thermite_ml-1.6.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 917.2 kB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for thermite_ml-1.6.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ccfa6f3a2437fd26a64e156766a92e46586bcee786bd00f72048868cfadd714c
MD5 a7f47f0de7fce713a058ac24c24ab812
BLAKE2b-256 1e35f088fbd3f60bbd4f27985530ef3014c7915d051d390cebea393a5931b141

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-1.6.0-cp38-abi3-win_amd64.whl:

Publisher: release.yml on KartavyaDikshit/Thermite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file thermite_ml-1.6.0-cp38-abi3-win32.whl.

File metadata

  • Download URL: thermite_ml-1.6.0-cp38-abi3-win32.whl
  • Upload date:
  • Size: 820.7 kB
  • Tags: CPython 3.8+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for thermite_ml-1.6.0-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 f747377f834b3b91da88efc7e2c91eca809bdf00ceec254fb3c3ecd4ce684749
MD5 2374afa133dce3c9ec8e4812f9d51240
BLAKE2b-256 20c3fbc1a786e332be1413e409b39deadf7f15ecc4033f62d16283e046010631

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-1.6.0-cp38-abi3-win32.whl:

Publisher: release.yml on KartavyaDikshit/Thermite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file thermite_ml-1.6.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for thermite_ml-1.6.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3cdca6c421add81cb5c8c4e13c406e024cfaa9adb3229a4e02a08e6d0bde72db
MD5 a3a98ffa29b1c4d226cbab59049afc47
BLAKE2b-256 e95c2b00bff8af8485eeca6add2d30f778853ae915d0ee82e72f2a3a3fde0182

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-1.6.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on KartavyaDikshit/Thermite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file thermite_ml-1.6.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for thermite_ml-1.6.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 54abe501723bcef11974e86077f5f17165efd49a27d2e09cd182f5ff1e7bbfe5
MD5 2c884e755b7c01443fa04e0074785b6b
BLAKE2b-256 f50018aea30c03839f0a9953b0c2c4a7e0dd06c4599458bda3f81cd06632c426

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-1.6.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on KartavyaDikshit/Thermite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file thermite_ml-1.6.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for thermite_ml-1.6.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a7d93514dd352a449e53d684b35a111d415cc56e7fc0cb1c532aed7b6e5aeb2a
MD5 c27ea820b592465f6f5e20a0da2cb8ab
BLAKE2b-256 ab8b7959c21e4b46d859d3dcaaf1cf7fc4783bd770f7683847fafd497d5b3d4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-1.6.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on KartavyaDikshit/Thermite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file thermite_ml-1.6.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for thermite_ml-1.6.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 80ef97ffb91dc4bd7a78ab8b7fde7466f47a5689e69c24b74be0f57aad9028be
MD5 bde532154c1368c81f3f099dfaf622d9
BLAKE2b-256 80f00f3682ce7fdfe3c323f29adb7b15423c6f1d5f4ed18f8d0689f323b993c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-1.6.0-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on KartavyaDikshit/Thermite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file thermite_ml-1.6.0-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for thermite_ml-1.6.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7639f54c36812adf6e4924d85a46d4a4c1c3ddf51bd308c014cce02432579751
MD5 d8d8f366bf33fe7ec0fdbe37330439b9
BLAKE2b-256 016d91171ee6fd4a8372c994bb7c888a82cee52fe9993ebef4297b208af1fbfc

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-1.6.0-cp38-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on KartavyaDikshit/Thermite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page