Skip to main content

Sqrt-Checkpoint KV-cache residency: cost models, keep-set computation, and exact reference attention. Zero dependencies.

Project description

sqrt-space-kv (Python)

Sqrt-Checkpoint KV-cache residency: cost models, keep-set computation, and exact reference attention. Zero runtime dependencies.

Full documentation, honest tradeoffs, and links to the paper / Rust port: see the repository README.

Install

pip install sqrt-space-kv

Quickstart

from sqrt_space_kv import keep_indices, strategy_cost

s = 4096
keep = keep_indices(s)          # token indices to keep resident
print(len(keep), "of", s, "kept")

cost = strategy_cost("sqrt-checkpoint", s)
print(cost["kv_cells"], cost["fidelity"])

Development

python -m pip install -e ".[dev]"
pytest -q

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sqrt_space_kv-0.1.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sqrt_space_kv-0.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file sqrt_space_kv-0.1.0.tar.gz.

File metadata

  • Download URL: sqrt_space_kv-0.1.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sqrt_space_kv-0.1.0.tar.gz
Algorithm Hash digest
SHA256 58f6f7f0d042452d14cb35eee45c415e4a890c81438c9ef28a75cb60305e6de7
MD5 124840aaec570f50e7fafc2b81422354
BLAKE2b-256 f8daa835e50b65275715c2a66bc3cfc786f1fc97c9317df42a6a5fd381708906

See more details on using hashes here.

Provenance

The following attestation bundles were made for sqrt_space_kv-0.1.0.tar.gz:

Publisher: publish.yml on com-junkawasaki/sqrt-space-kv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sqrt_space_kv-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sqrt_space_kv-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sqrt_space_kv-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 adff86fed3631dab9c4975d0f58602e0bb6bdd0fc9639e730027b96a1b8da5c6
MD5 f2aaee53c3d4dc188104e63a9af198ec
BLAKE2b-256 7f07914be4c49b9a7bf9aee7a9614198c5289490bcfd3f62e8e1b5a99c9134f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for sqrt_space_kv-0.1.0-py3-none-any.whl:

Publisher: publish.yml on com-junkawasaki/sqrt-space-kv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page