Metadata-Version: 2.4
Name: megakernel
Version: 0.1.0
Summary: Measure the kernel-launch tax and memory ceiling a megakernel would remove. Future home of a residency-first megakernel compiler.
Author-email: Kong <goinyadeng976@gmail.com>
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: GPU :: NVIDIA CUDA
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# megakernel

A *megakernel* compiles a whole computation — up to an entire model's forward
pass — into a **single persistent GPU kernel**: one launch, one resident
working set, an in-kernel scheduler, instead of thousands of separate kernel
launches bouncing activations through device memory.

Today this package ships a probe that measures, on your GPU, the two
overheads a megakernel removes:

```
pip install megakernel
python -m megakernel
```

```
device               : <your GPU>
kernel enqueue cost  :    x.xx us  (CPU-side submit)
kernel launch tax    :    x.xx us  (end-to-end, tiny kernel)
device copy bandwidth:  xxxx.x GB/s

A decode step composed of ~500 kernel launches pays roughly y.yy ms/token
in launch tax alone, before any math or memory traffic. A megakernel pays
it once.
```

Requires a CUDA build of PyTorch (the probe reports a clear message
otherwise). Also usable as a library: `from megakernel import probe`.

## Roadmap

This name is the future home of a **residency-first megakernel compiler**
currently in development: real models compiled to single persistent kernels,
adoptable without rewriting anything. Watch this package for the first
public release.

Contact: goinyadeng976@gmail.com
