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).

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.3.0.tar.gz (96.2 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.3.0-cp38-abi3-win_amd64.whl (821.9 kB view details)

Uploaded CPython 3.8+Windows x86-64

thermite_ml-1.3.0-cp38-abi3-win32.whl (735.1 kB view details)

Uploaded CPython 3.8+Windows x86

thermite_ml-1.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

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

thermite_ml-1.3.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ i686

thermite_ml-1.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (989.5 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

thermite_ml-1.3.0-cp38-abi3-macosx_11_0_arm64.whl (885.4 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

thermite_ml-1.3.0-cp38-abi3-macosx_10_12_x86_64.whl (934.7 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: thermite_ml-1.3.0.tar.gz
  • Upload date:
  • Size: 96.2 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.3.0.tar.gz
Algorithm Hash digest
SHA256 7f6f46e34b0e6e3dab990977b5f6290c4d6e09b00126072356b8499b22ef5199
MD5 a7b9618c8f80e34d869e48325dc91964
BLAKE2b-256 4ee368d1c8967b101b9a513c1c866e879b83c35592f5d7f21a121a8bd1f7de24

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-1.3.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.3.0-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: thermite_ml-1.3.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 821.9 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.3.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ccbc3b1e1dc1c3823afd287ebfc9ddb76dfd5618c08d40adfb797f34ffbd03ec
MD5 13bda1a75f32a6c55e83f9691f57ad63
BLAKE2b-256 9df71380f5018fe52dfc6f86ca5b0fd17a2bc4de0b0420d81991f9c8d7e76925

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-1.3.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.3.0-cp38-abi3-win32.whl.

File metadata

  • Download URL: thermite_ml-1.3.0-cp38-abi3-win32.whl
  • Upload date:
  • Size: 735.1 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.3.0-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 9d2140e65c83d63e6c18931ebb1a70c8e50df44e482ccad8068a606938db0180
MD5 d6763f723c89178e6b3944fd0da4caeb
BLAKE2b-256 c0848e8a11ee758fb9423bde379ed45efaf15c11b70140ecd0192462b484c643

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-1.3.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.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for thermite_ml-1.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a323cdfa76e3c7e5ca9e92b28e448a4b7c569fe3a87ba557635ba34c569fc579
MD5 892b311d37866d4374d8ee27c687a5cb
BLAKE2b-256 583ada537526f890140ed396ad89163e1911cf520995d890983ff776e14623a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-1.3.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.3.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for thermite_ml-1.3.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 a71dc4e4c3cf9785d0c507dcf2bd1bac4c2777327db67be92a72e3a1a3f91721
MD5 72f6ab1d4eaf484511f5603b5b41bc0f
BLAKE2b-256 4c973cde8158a8bc8b6276f9370afeee644dd1945520a8fc9dc60da336538abb

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-1.3.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.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for thermite_ml-1.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 671db0f97bc65ef956487b720c8f2a4485f05db680887c5415e16fc80178e236
MD5 b5ed68b39b79b40cd9822deee075c8c6
BLAKE2b-256 b55b6cf2b8b038de153e32018d03fa5061d259521726978c92738050598bd5aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-1.3.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.3.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for thermite_ml-1.3.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b36c52525d919edf83bc9e569220689b1fc4d11cd75133b9ef5861b74e2af6a6
MD5 267141313bf14cd62779c6936f330d35
BLAKE2b-256 de1b530cca85b4666ff20f82d727a13550e3535cb8493c06eff100fb75a5f634

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-1.3.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.3.0-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for thermite_ml-1.3.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4fa53309db58f362c636e71b64af8fe5f04e5570ea40f7424e10ee4cc0be0dcc
MD5 f3cb8c8f1bb9d19bcc2d8fb9bcd18074
BLAKE2b-256 a6b7474101a976b65e9d9269e4ce40ed9b2afd2a797509f46fe280ad1a16b4b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-1.3.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