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.

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.4.0.tar.gz (100.3 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.4.0-cp38-abi3-win_amd64.whl (856.6 kB view details)

Uploaded CPython 3.8+Windows x86-64

thermite_ml-1.4.0-cp38-abi3-win32.whl (767.2 kB view details)

Uploaded CPython 3.8+Windows x86

thermite_ml-1.4.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.4.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.4.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

thermite_ml-1.4.0-cp38-abi3-macosx_11_0_arm64.whl (923.0 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

thermite_ml-1.4.0-cp38-abi3-macosx_10_12_x86_64.whl (967.3 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: thermite_ml-1.4.0.tar.gz
  • Upload date:
  • Size: 100.3 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.4.0.tar.gz
Algorithm Hash digest
SHA256 0727adc06f8adacaceb3730f5e58e200391bc9e4778dfe8753e1996b8adab30c
MD5 616ae00014633b975195b23ff983a1f0
BLAKE2b-256 662df49f2e8b68a564b6947366c1b706e3420b91825b7ecec1bc45169f0522d3

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: thermite_ml-1.4.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 856.6 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.4.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 57cbe7675e79b38e8afed8df818dd1e3af21dd28426e294d78532f163938a4f8
MD5 66e940fc4de80fd824e54d6dd8fafcb7
BLAKE2b-256 9182420f1d75084b9dd944220210a726e94174cb2df79593b255cfab4dfc6dd2

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: thermite_ml-1.4.0-cp38-abi3-win32.whl
  • Upload date:
  • Size: 767.2 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.4.0-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 d1783fcccdac787bc3a92247d349b74c682770ae802126fb96a5d7abdad3e24d
MD5 f864d62e38ba8f5b11691ca56f197751
BLAKE2b-256 311dfe025150f125cea95677e17e574e1a1dd1393c5676f877902d0a63eb2be9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for thermite_ml-1.4.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4ef31f7ed2ceb973996e40125d426c03c4f51633601f3bd7c8d788683da22626
MD5 0ab7eda95adae6b44661b9adcb59aee3
BLAKE2b-256 ee07b5d71c127c383bed4df71473b8cba0fb12cbda2f41cbdc599f19f9c227b2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for thermite_ml-1.4.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 8ddeb29c8170e3c001ec8cf7f67095832904711109abba2e39d15b0609ce1056
MD5 7de74840506e11fd4d4088a8a714ac20
BLAKE2b-256 f2f75bfab1a3717e0cf4e89d5fa906aad379865c55bdb7f2f17d2be7ce13b994

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for thermite_ml-1.4.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5446068c027554cac66e12f822d751ae240d596b29b405a60af7b24cbc15a3cd
MD5 7a4ef54559f5f6b5be11e2868221e362
BLAKE2b-256 c6d6f3916f1bd55087604043bfd02d371f67a83da8a3c6adc598e8f09f07000e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for thermite_ml-1.4.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9ea52b9a267c1cc6e39faea73e81924d34c9514387adec80f0f6dea7cde5d430
MD5 0cf5599b1f76963d93142954c7b8dd40
BLAKE2b-256 e84842778962d6b7e9d71f6c3b042e9c5b94258d19023957410d2326341cd2be

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for thermite_ml-1.4.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 40551bd1dcf1f04ec08d7198da1220c0d703c2bdfad2283b024050d381c89952
MD5 3f54f0314f44e39378c88ca961f056e3
BLAKE2b-256 3917e1f9e81392c78c371051d1bd5fe2e64cf132671e6c21d91182542c6183de

See more details on using hashes here.

Provenance

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