Skip to content

epilliat/KernelForge.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KernelForge.jl

High-performance, portable GPU primitives for Julia — a pure Julia implementation delivering performance competitive with optimized CUDA C++ libraries.

matvec — A40 vecmat — A40
scan — A40 mapreduce — A40
copy bandwidth — A40

Benchmarked on an NVIDIA A40 (Ampere) against optimized CUDA C++ baselines (CUB / cuBLAS). More GPUs (RTX 1000, MI300X) and raw CSV data in the KernelForge-benchmarks repo.

Links

Installation

using Pkg
Pkg.add("KernelForge")

Quick start

using KernelForge, CUDA   # or AMDGPU

x = CUDA.rand(Float32, 10^6)

# Reduction with a custom map + operator
total = KernelForge.mapreduce(abs2, +, x)      # sum of squares

# Prefix scan (supports non-commutative ops)
dst = similar(x)
KernelForge.scan!(+, dst, x)                    # cumulative sum

# Matrix–vector product
A = CUDA.rand(Float32, 1000, 500)
v = CUDA.rand(Float32, 500)
y = KernelForge.matvec(A, v)                    # y ≈ A * v

# Radix sort, in place
KernelForge.sort!(x)

Features

  • Map-reduce with custom functions and operators, supporting arbitrary dimensions and multidimensional arrays
  • Prefix scan supporting non-commutative operations
  • Matrix-vector operations with customizable element-wise and reduction operations
  • Searchfindfirst, findlast, argmax, argmin on GPU arrays
  • Vectorized copy with configurable load/store widths
  • Views and strided arrays supported throughout

Backends

CUDA (NVIDIA) and AMDGPU (AMD) via weak dependencies; the backend is selected through KernelAbstractions extensions. Tested on NVIDIA A40, RTX 1000, and AMD MI300X.

Sponsors

KernelForge.jl is an open-source project maintained in my personal time. If this package is useful to you — especially in a production or HPC setting — you can support its development and maintenance via GitHub Sponsors.

Corporate sponsors receive priority support on issues and an acknowledgment in the documentation.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

23 stars

Watchers

0 watching

Forks

Sponsor this project

 

Packages

 
 
 

Contributors