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.

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.0.0.tar.gz (69.9 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.0.0-cp38-abi3-win_amd64.whl (688.9 kB view details)

Uploaded CPython 3.8+Windows x86-64

thermite_ml-1.0.0-cp38-abi3-win32.whl (607.1 kB view details)

Uploaded CPython 3.8+Windows x86

thermite_ml-1.0.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (858.0 kB view details)

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

thermite_ml-1.0.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (943.6 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ i686

thermite_ml-1.0.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (829.4 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

thermite_ml-1.0.0-cp38-abi3-macosx_11_0_arm64.whl (748.2 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

thermite_ml-1.0.0-cp38-abi3-macosx_10_12_x86_64.whl (797.2 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: thermite_ml-1.0.0.tar.gz
  • Upload date:
  • Size: 69.9 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.0.0.tar.gz
Algorithm Hash digest
SHA256 6488f74480268fa9bc8fa826c96710c85428656bc6788c777f2384efb22f9c5e
MD5 11617d3930b9e28e5711384ecead7f45
BLAKE2b-256 e9716ce6836d982aa50dcc528c8489e349a71ea8a59a99c52666e646a43bad3b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: thermite_ml-1.0.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 688.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.0.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 26a4b7998e755c097302e56571c0457a45d59e838ebc814aa1648242859f53a2
MD5 996b0d1a07011e6a9b5508ab2e9b7dcb
BLAKE2b-256 08d4e843988fdcdad1df24572e7b91ef61a3d7d6083efa35f74aeb2b34c3ed16

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: thermite_ml-1.0.0-cp38-abi3-win32.whl
  • Upload date:
  • Size: 607.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.0.0-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 82d270976863d8e104602ca97e242b04462d5da2dabfe26427def48efdaad6fd
MD5 3f9c939dfed1216159ada3d56fae593a
BLAKE2b-256 13d865dc1dc7b8bf77b3a96e53769d68b7698d03cdc4745185b8682f4cdf0274

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for thermite_ml-1.0.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1bde3174432e385eec41c282c0db565f70b24630c29d80a61104c0ea223ac0f5
MD5 2a4f0fa85c25752305376fd3a2ea5935
BLAKE2b-256 f294fc018b624a3e3279593cd35b00c0d4c129bbcaaec94d7767b07ca8efe3a9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for thermite_ml-1.0.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 95eb1aaf72ecd9ff9e839ac868a43cc9b08aa7cf7a4f9ca908c07414c1828d56
MD5 a72a69f20de2ed4918782ecc077340ce
BLAKE2b-256 a97b68530ed3cd047fb0a8ce305a1f01601c901c8094ce36d6984d21eaa3e7fa

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for thermite_ml-1.0.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 616aca6b7b589a7ee738afb49632d2548c28880f4d4207b31e1b739afbc6c81b
MD5 55a809aeb7c0311bee44604e9410d2ac
BLAKE2b-256 5bd83b2b57225df4fc8df2fba98de429c4caa47f80095c2b8ff6309be2de2e7c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for thermite_ml-1.0.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ec533c3b0cd6f1e0383979f75aab9de5b3031b9b215c6b56bba96b1a5a66edea
MD5 49f9459545bbfdadf92a885c5373d06c
BLAKE2b-256 2ce5626d4df7f6a3345be3f8871431a777862efa3c622f3dec4ad158f447c30c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for thermite_ml-1.0.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d6e2ca330e0079aaf29e13c5127b6821d69e1f64606ca21921629959fb5413e0
MD5 2515520b4f00d398226a0cea2007cfe1
BLAKE2b-256 cc9bcf236ca4f6cddbd7c34e85e7c7e1bef5130980a5931359d1ae78bcf053b0

See more details on using hashes here.

Provenance

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