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

Uploaded Python 3

File details

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

File metadata

  • Download URL: gplearn_cuda-0.4.4.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.4.tar.gz
Algorithm Hash digest
SHA256 5eb80748c59de27bf37effdb6bc72e9b86154c35be0d51a70f9355e9f3f261af
MD5 fb003d704ab3d241bbffbc0ab19ac118
BLAKE2b-256 4a22bbbc2b0f600f43a9cf96b59c3a78b5ffd5bf8b35388a3d57c89e252d5b6b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gplearn_cuda-0.4.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c3e48a36292833cd743f015a19aacc10331a15195fee61f8c0247a0644164241
MD5 dfb385a8dd73d0378640aafd2aa2388a
BLAKE2b-256 2f6f5b663b29a9c24ef8cfc2e7a2d031c385780244179151261dd6768243bd7c

See more details on using hashes here.

Provenance

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