Skip to content

API Reference

Greyhound exposes fused kernels through functional operators and small nn.Module wrappers. The functional layer is the most direct way to call kernels from model code, while the module layer is useful when replacing standard transformer blocks.

Detailed API reference pages are generated from Python docstrings with scripts/generate_api_docs.py.

FunctionPurpose
greyhound.nn.functional.cross_entropyCross-entropy using the standalone loss-and-logits-gradient kernel.
greyhound.nn.functional.autograd_loss_and_logits_gradAdapter from scalar PyTorch losses to chunked loss-and-logits-gradient callbacks.
greyhound.nn.functional.chunked_linear_lossChunked linear projection with a user-provided per-chunk loss-and-logits-gradient function.
greyhound.nn.functional.chunked_linear_cross_entropyChunked linear cross-entropy using a fused cross-entropy-and-logits-gradient kernel per logits tile.
greyhound.nn.functional.causal_conv1dDepthwise causal 1D convolution with optional bias and activation.
greyhound.nn.functional.selective_log_softmaxSelected log-softmax values without materializing full log-probabilities.

Generated functional reference

ModulePurpose
greyhound.nn.causal_conv1d.GreyhoundCausalConv1dDepthwise causal Conv1d wrapper backed by Greyhound’s fused convolution kernel.

Generated module wrapper reference

UtilityPurpose
greyhound.bonus.newton_schultz.orthogonalize_via_newton_schulzMuon-style Newton-Schulz orthogonalization composed with Quack symmetric GEMM when available.

Bonus integrations are experimental utilities that compose Greyhound code with kernels from other providers. They are documented separately from the core functional and module API because they may require optional provider dependencies.

The public API is implemented in the Python package under src/greyhound/:

SurfaceSource
Functional namespacesrc/greyhound/nn/functional.py
Module wrapperssrc/greyhound/nn/
Autograd opssrc/greyhound/ops/
CuTe DSL kernelssrc/greyhound/kernels/
Bonus integrationssrc/greyhound/bonus/