dattnbench

command
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Dattnbench writes the CUDA sources and launch plans for the lane 71 decode attention table: the generated cudalower.DecodeAttention kernel, its parity mutant and timing control, and the hand-written ServeAttention kernels of examples/llama-infer/serve.cu, each behind extern "C" entry points a benchmark loads from a shared library.

Usage:

dattnbench -serve examples/llama-infer/serve.cu -out dir

It writes gen.cu, gen_mut.cu, gen_spin.cu, gen_tail.cu, hw.cu and plans.json to dir. Build each source with nvcc -shared -Xcompiler -fPIC.

The shape is Llama-3.2-1B attention: 32 query heads over 8 KV heads of 64, BF16, 16-token pages. gen_mut.cu scales head 0's output by 1.01 on both output paths, so a parity gate must reject it at every cell. gen_spin.cu makes every block with keys wait -spin-ns on %globaltimer before its first load; in a bandwidth-bound kernel the other resident blocks hide part of that wait. gen_tail.cu leaves the kernel body as it is and has the last block to finish wait -spin-ns, so the kernel must take spin-ns longer at every cell.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL