Skip to main content

GPU-accelerated Genetic Programming in Python (CUDA extension of gplearn)

Project description

Build Status Version License Documentation Status

Welcome to gplearn-CUDA!

gplearn-CUDA implements GPU-accelerated Genetic Programming in Python, with a scikit-learn inspired and compatible API.

This project is a high-performance extension of the original gplearn library developed by Trevor Stephens. It maintains all the original functionality while introducing massive parallelization via NVIDIA CUDA.

Overview

While Genetic Programming (GP) can be used to perform a very wide variety of tasks, gplearn-CUDA focuses on three scikit-learn style estimators: symbolic regression, binary classification, and symbolic feature generation.

These map directly to SymbolicRegressor, SymbolicClassifier, and SymbolicTransformer.

CUDA Acceleration

The core contribution of gplearn-CUDA is high-performance GPU acceleration via NVIDIA CUDA. By setting device='cuda', the library utilizes a custom virtual machine interpreter on the GPU to achieve 2x–4x speedups on massive datasets and large populations.

from gplearn.genetic import SymbolicRegressor
# Enable CUDA acceleration
est = SymbolicRegressor(device='cuda', population_size=5000)
est.fit(X, y)

Installation

gplearn-CUDA requires a recent version of scikit-learn. The CUDA acceleration is compatible with CUDA 11.2 through 13.x.

Plain pip install gplearn-CUDA remains CPU-only. To install the GPU-enabled version via pip, use one of the CUDA extras:

pip install "gplearn-CUDA[cuda13]"

The cuda extra is kept as a convenience alias for cuda13:

pip install "gplearn-CUDA[cuda]"

For other CUDA versions or Conda installation, please see the Installation Guide.

Python Compatibility

gplearn-CUDA currently requires Python 3.11 or newer because its core dependency scikit-learn>=1.8.0 requires that Python range.

Verified in this repository on Windows:

  • CPU path: Python 3.11, 3.12, 3.13, and 3.14

  • CUDA path: Python 3.12 and 3.14

On some Windows Python 3.14 environments, CuPy can import and JIT kernels successfully while optional BLAS backends such as cuBLAS still fail to load. When that happens, SymbolicTransformer(device='cuda') now falls back to a NumPy-based correlation step for hall-of-fame selection and emits a warning instead of aborting the fit.

License & Credits

gplearn-CUDA is released under the BSD 3-Clause License, following the licensing of the original project.

  • Original Author: Trevor Stephens (@trevorstephens)

  • CUDA Extension: LGA-Personal

For the latest development version, first get the source from github:

git clone https://github.com/LGA-Personal/gplearn-CUDA.git

Then navigate into the local directory and simply run:

pip install .

If you come across any issues in running or installing the package, please submit a bug report.

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

gplearn_cuda-0.4.6.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

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

gplearn_cuda-0.4.6-py3-none-any.whl (56.4 kB view details)

Uploaded Python 3

File details

Details for the file gplearn_cuda-0.4.6.tar.gz.

File metadata

  • Download URL: gplearn_cuda-0.4.6.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gplearn_cuda-0.4.6.tar.gz
Algorithm Hash digest
SHA256 b7d0555f32010f7ba59140b38a6871528c2a007a59522aee98810d62a907e8b8
MD5 1aeedbadd696b0b1b3702a1d585b5aea
BLAKE2b-256 a5557980daa0e53695ee29dc793056f79613fcce28ae818d418a09e26a57a1bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for gplearn_cuda-0.4.6.tar.gz:

Publisher: publish.yml on LGA-Personal/gplearn-CUDA

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

File details

Details for the file gplearn_cuda-0.4.6-py3-none-any.whl.

File metadata

  • Download URL: gplearn_cuda-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 56.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gplearn_cuda-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6459ad3a02f0bae90781306db3cafb3e25a6d2589480e35bd873c5ff5fcafc8b
MD5 5926a694299951d0ec1eb732a412042f
BLAKE2b-256 230209d005dad56ed354a19eabfbef59b50eec06234104504da3fd818cd35693

See more details on using hashes here.

Provenance

The following attestation bundles were made for gplearn_cuda-0.4.6-py3-none-any.whl:

Publisher: publish.yml on LGA-Personal/gplearn-CUDA

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