GPU-first numerical computing framework — Runtime, Driver, Compute, Agent SDK
Project description
NumFast
GPU-first numerical computing framework — Runtime, Driver, Compute, High-Level API and Agent SDK.
pip install numfast
Architecture
User (human or AI) ─┐
│ │ Agent SDK
▼ │ AI-agnostic
Agent SDK ─┘
│
▼
Session — owns Runtime
│
├──► Runtime — kernel table, compiler, executor
├──► Driver — CPU (reference) · WebGPU · CUDA (stub)
├──► Operations — scan(), matmul(), fft(), sort(), histogram()
└──► Compute — 6 GPU algorithms with CPU==GPU conformance
Quick start
from numfast import scan, sort, matmul
import numpy as np
# Prefix sum
x = np.array([1.0, 2.0, 3.0, 4.0, 5.0])
y = scan(x)
print(y) # [1. 3. 6. 10. 15.]
# Bitonic sort
x = np.random.random(8)
s = sort(x)
# Matrix multiplication
A = np.ones((4, 4), dtype=np.float64)
B = np.ones((4, 4), dtype=np.float64)
C = matmul(A.flatten(), B.flatten(), M=4, N=4, K=4)
Agent SDK
from numfast import AgentSDK
sdk = AgentSDK()
with sdk.session() as session:
# Run a script
result = session.run("x = 2 + 2")
# Compare two arrays
result = session.diff(
np.array([1.0, 2.0, 3.0]),
np.array([1.0, 2.0, 3.0]),
)
# Compare CPU vs GPU
cpu_result = ...
gpu_result = ...
session.compare(cpu_result, gpu_result)
# Run benchmarks
session.benchmark("matmul_4x4", "matmul(A, B, M=4, N=4, K=4)")
Tools
| Tool | Description |
|---|---|
scan() |
Inclusive prefix sum (CPU/GPU) |
matmul() |
Tiled matrix multiplication |
fft() |
Fast Fourier Transform |
sort() |
Bitonic sort (power of 2) |
histogram() |
Binned histogram with atomics |
Backends
- CPU — reference implementation, float64, always available
- WebGPU — GPU via
wgpu-py(Windows, Linux, macOS) - CUDA, OpenCL, Metal — driver interface ready (stubs)
Every GPU kernel has CPU == GPU conformance tests.
Requirements
- Python >= 3.11
- NumPy (CPU)
wgpu-py(optional, for GPU)
Development
# Run all tests
pytest
# Run conformance suite
python -m tests.conformance.test_compute
License
AGPL-3.0-only
Status
Pre-alpha. API is stable (frozen per ADR-005). Active development.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
numfast-0.0.1.tar.gz
(143.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
numfast-0.0.1-py3-none-any.whl
(194.2 kB
view details)
File details
Details for the file numfast-0.0.1.tar.gz.
File metadata
- Download URL: numfast-0.0.1.tar.gz
- Upload date:
- Size: 143.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
972a002c8e6d46b2e5112af37f63fb80e368745ffcf1f96f9976c14f8d4d71d1
|
|
| MD5 |
25fa691b708843cb71751565d8fd4823
|
|
| BLAKE2b-256 |
b039ee07d93db3023194a91a193637045dd4e44610daface4bc4cd376f783347
|
File details
Details for the file numfast-0.0.1-py3-none-any.whl.
File metadata
- Download URL: numfast-0.0.1-py3-none-any.whl
- Upload date:
- Size: 194.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8138fa120da7a29699f30fef738a3295e956322b07793ba916fb224976dd4167
|
|
| MD5 |
c5394db4f41558344e1aa77e94977c0b
|
|
| BLAKE2b-256 |
036bc96977d3381d1035202d18ad8291d9fc2e37b3f1a4f96e746d48543ee2dd
|