Skip to main content

lightgbm-rs

Python bindings for LightGBM-rs — a pure-Rust reimplementation of Microsoft's LightGBM gradient-boosting library, numerically faithful to the C++ reference (~1e-6 absolute on the CPU anchor) and built on PyO3.

The package mirrors the official lightgbm low-level surface for the in-scope APIs, so you can switch import lightgbmimport lightgbm_rs:

import numpy as np
import lightgbm_rs as lgb

X = np.random.standard_normal((1000, 10))
y = X @ np.random.standard_normal(10)

ds = lgb.Dataset(X, y)
model = lgb.train({"objective": "regression", "num_leaves": 31}, ds, num_boost_round=100)
pred = model.predict(X)  # owned numpy array

Input is marshalled into owned Rust buffers and the GIL is released (Python::detach) around the CPU-bound train/predict, so background Python threads make progress during training.

Building from source

pip install maturin
maturin develop --release   # inside this directory, into your active venv

See the workspace root for the full project, license, and the numerical-parity contract.

Known issue: ImportError: cannot allocate memory in static TLS block

_core.abi3.so embeds LLVM (used by the cubecl-cpu JIT backend), which declares many thread_local globals. On some glibc builds this exceeds the small "static TLS surplus" glibc reserves for shared objects loaded late via dlopen() (which is how Python imports extension modules), and the import fails with this error. It depends on your glibc version and what else is already loaded in the process — it is not tied to any specific Python version (reproduces on 3.13 and 3.14 alike on a recent glibc; the package's 0.0.5 release predates the embedded-LLVM backend and is unaffected).

Confirmed workaround (glibc >= 2.35, i.e. most current distros): raise the static TLS surplus before starting Python:

GLIBC_TUNABLES=glibc.rtld.optional_static_tls=4096 python -c "import lightgbm_rs"

or export GLIBC_TUNABLES in your shell profile / the environment your process runs in. 2048 was sufficient in testing; 4096 leaves headroom. The import error message includes this same guidance.

Download files

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

Source Distribution

lightgbm_rs-0.0.10.tar.gz (5.3 MB view details)

Uploaded Source

Built Distributions

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

lightgbm_rs-0.0.10-cp311-abi3-win_amd64.whl (34.7 MB view details)

Uploaded CPython 3.11+Windows x86-64

lightgbm_rs-0.0.10-cp311-abi3-manylinux_2_34_x86_64.whl (50.9 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.34+ x86-64

lightgbm_rs-0.0.10-cp311-abi3-macosx_11_0_arm64.whl (41.7 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

Details for the file lightgbm_rs-0.0.10.tar.gz.

File metadata

  • Download URL: lightgbm_rs-0.0.10.tar.gz
  • Upload date:
  • Size: 5.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for lightgbm_rs-0.0.10.tar.gz
Algorithm Hash digest
SHA256 8ec6e7d3c4afe8a3218c497295a38f88bce9c193ed41d5ab8f6d3b6b9cb9c843
MD5 d6239bc2d91504e9206ebe4e280d62d0
BLAKE2b-256 83c2ee43bfa538beb4e23ea2a50f630fd1728ebea74a695c7e636bfd6bf0043c

See more details on using hashes here.

Provenance

The following attestation bundles were made for lightgbm_rs-0.0.10.tar.gz:

Publisher: release-python.yml on BectorVoom/lightgbm_rs

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

File details

Details for the file lightgbm_rs-0.0.10-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: lightgbm_rs-0.0.10-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 34.7 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for lightgbm_rs-0.0.10-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2bf29cb82b42228cc671bd1d438246556a686f0380d761255f7860bab8dbda35
MD5 afae1c793f7583e36e3833e31c364ea9
BLAKE2b-256 e9338bb08d3d29c493031408a5fc4498f8b55cbd5831f6b3e0ca2b2b7c5493d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for lightgbm_rs-0.0.10-cp311-abi3-win_amd64.whl:

Publisher: release-python.yml on BectorVoom/lightgbm_rs

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

File details

Details for the file lightgbm_rs-0.0.10-cp311-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for lightgbm_rs-0.0.10-cp311-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7154be23e60bf32b4a6939bb725a644f09d1f1060e0456998eec2a4c0ee7b88c
MD5 4a791ab2c0a60aaf0596aa37805ddfb2
BLAKE2b-256 f3924c0a0be1398cba8bd5dee3b4aa2c2193648a8a79aebea83c5eafac9ca7a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for lightgbm_rs-0.0.10-cp311-abi3-manylinux_2_34_x86_64.whl:

Publisher: release-python.yml on BectorVoom/lightgbm_rs

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

File details

Details for the file lightgbm_rs-0.0.10-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lightgbm_rs-0.0.10-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c46768e9d90c6e3ee4e2d00d3f03e53537e27789651e27ba3867e55816352749
MD5 74ea700d72c3eadc650b56c29d02ce68
BLAKE2b-256 5b343bc6e28b052b11df258cd62c834a8ef1256469f9f7c2ece565e01a0d8d8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for lightgbm_rs-0.0.10-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: release-python.yml on BectorVoom/lightgbm_rs

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

Release history Release notifications | RSS feed

This release

0.0.10 This release

4 files

0.0.9

4 files

0.0.7

1 file

0.0.5

4 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page