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.

To install the GPU-enabled version via pip (targeting CUDA 13.x by default):

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.5.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.5-py3-none-any.whl (56.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gplearn_cuda-0.4.5.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.5.tar.gz
Algorithm Hash digest
SHA256 19a34af3d2e60fac1c5f92460c4752503d2ccc55ec0bb9c13af227cedb724a71
MD5 48226234c10eb84a1700bc26f98a299c
BLAKE2b-256 4cdd418477907a017227f2d47dd76fd17b167b14f1eb7d249205acd07a25b905

See more details on using hashes here.

Provenance

The following attestation bundles were made for gplearn_cuda-0.4.5.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.5-py3-none-any.whl.

File metadata

  • Download URL: gplearn_cuda-0.4.5-py3-none-any.whl
  • Upload date:
  • Size: 56.3 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 25db25ea2ff228d0031731ada75f843a51d722b41deee2acfd85592cfe2d019b
MD5 27f04616b054d8100478f694beb3b3a6
BLAKE2b-256 17fed5a6caf274508789e90faa25413d9ee3b8e7ac8c68d7d9dc21a9ef4e9e0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for gplearn_cuda-0.4.5-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