← Projects
05 / 06 - Python · CUDA · GPU Computing

GPU Combinatorial
Optimizer

CUDA-accelerated tool for finding optimal combinations of numeric inputs that satisfy a target output constraint. A combinatorial search that takes hours on CPU completes in seconds on GPU.

PythonCUDA GPU ComputingAlgorithms NumPyCombinatorics
View on GitHub ↗

What it does

Given a pool of numeric inputs and a target output range, the tool finds all combinations of 10 inputs whose weighted average falls within the target. Formula and weights are configurable per use case.

Finding the exact combination for a desired output value is a combinatorial search problem. This tool offloads it entirely to the GPU using CUDA, searching millions of combinations per second.

Why GPU?

With 500 available inputs, finding valid 10-element combinations yields ~2.6 trillion possibilities - years at CPU speed, seconds to minutes on GPU.

math
C(500, 10) ≈ 2.6 × 10¹²  combinations

# CPU: ~years at single-thread speed
# GPU (CUDA, 4090): seconds to minutes

Computation pipeline

01
Define target
Specify the target output range and provide the pool of available numeric inputs.
02
Upload to GPU
Input values transferred to GPU memory. CUDA kernel compiled and launched across all cores.
03
Parallel search
Each GPU thread evaluates a subset of combinations, computing the weighted average.
04
Return results
Matching combinations collected from GPU memory and returned for use.

Requirements & setup

bash
# Requires NVIDIA GPU with CUDA support
# Install CUDA Toolkit from nvidia.com first
pip install -r requirements.txt
python main.py