Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

SANTA++ kernels

SANTA++ is a sparse-attention implementation that selects teams of cached keys, evaluates their members, and applies an inclusion correction. This repository contains the GPU kernels, independent numerical references, and operator and full-model performance harnesses used to study that computation.

The source artifact contains code and reproduction instructions. Model weights, RULER datasets, run directories, profiler traces, and generated result tables are distributed separately, if provided. See validation scope for the distinction between historical GPU records and checks of this release.

Included paths

Path Purpose
santa_bench/ Kernels, numerical references, operator harness, FP16 and GPTQ-INT4 Qwen integration
tests/ Regression tests and a bounded numeric routing reference fixture
scripts/, tools/ Model-download, environment, profiling, and analysis helpers
configs/ Declared fresh reproduction configuration
docs/ Installation, protocols, methodology, and validation limits
data/, results/ Local input/output locations; generated contents excluded from source publication

Supported configurations

  • Operator: contiguous parents P=16, representatives R=4, and K={31,32,64,128,256} selected teams. One captured layer/query state per prompt; five launches form the complete operator. Nominal S=4K is not the actual KV-read count.
  • Full model: Qwen2.5-7B-Instruct, live queries, all attention layers, a growing exact generated suffix, and K=256 only. Separate adapters support FP16 model weights and the supplied GPTQ INT4 checkpoint.
  • Precision: both model paths use FP16 activations and FP16 KV. INT4 refers to model weights. BF16 and quantized KV are not implemented.
  • Geometry and batching: the supplied Qwen geometry, at most 32,768 total positions, and equal-length inputs. Prefill is sequential; decode is batched. Default capacity runs replicate each prompt into separately allocated lanes. They are replicated-batch experiments, not heterogeneous serving experiments.

Installation and quick start

Use Linux/WSL, a supported NVIDIA GPU, CUDA-capable PyTorch, and Triton. The model adapters require separate environments with exact Transformers versions. INT4 also requires GPTQModel's Marlin backend and a CUDA/C++ build toolchain. The recorded hardware was an RTX 5090 Laptop GPU; portability to other hardware must be validated. Follow installation, including its dependency availability caveat, before using these commands in the chosen environment:

python -m pip install --no-deps --no-build-isolation -e .
python -m pytest -q
python -m santa_bench.ruler_suite --help
python -m santa_bench.operator_suite --help

GPU tests skip when their dependencies or captured fixtures are unavailable. A passing CPU test suite does not establish GPU numerical correctness.

Reproduction and interpretation

Follow the reproduction runbook to prepare prompts, capture operator fixtures, validate a configuration, and run paired timings. Its fresh protocol uses twelve prompts and three full-model paired repetitions. The historical protocol table distinguishes the smaller initial subsets, later expansions, and single paired repetitions used in the recorded campaigns. Those protocols are not interchangeable.

Operator latency covers one attention computation. Full-model decode and total request latency have separate timing boundaries; see methodology. This is a latency study, not a twelve-example RULER accuracy result. Quality evaluation and independent KV-selection baselines are outside this artifact.

Validation policies must remain separate. The default independent live joint prompt/suffix attention output comparison uses atol=rtol=2e-5. A later output-only policy uses atol=rtol=1e-4 for that named comparison after failures were observed under the strict criterion. Other checks are unchanged; nonfinite outputs fail. The later policy does not imply identical FP16 rounding or generated tokens. See the exact policy scope and retain strict failures when reporting any later-policy results.

Source integrity and distribution

The source-release commands require only Python's standard library. After source edits, refresh current fingerprints and checksums; this does not rerun validation or change historical experiment records.

python3 -m santa_bench.release refresh
python3 -m santa_bench.release audit
python3 -m santa_bench.release source --output /path/to/new/santapp-kernels-source.zip
python3 -m santa_bench.release audit --archive /path/to/new/santapp-kernels-source.zip
# After extracting the source ZIP:
python3 -m santa_bench.release audit --root .

The source archive has an explicit allowlist and a checksum manifest. Review measurement packages separately: their provenance can contain local paths and device information. Current-source verification does not revalidate historical experiments; retain their original source and acceptance-policy identities. See release changes, SOURCE_PROVENANCE.json, and docs/INTEGRATION.json. The Apache-2.0 license and required third-party notices are retained.

For anonymous reviewer access, follow publication instructions. Source cleanup does not anonymize an existing repository owner or Git history.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages