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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58f6f7f0d042452d14cb35eee45c415e4a890c81438c9ef28a75cb60305e6de7
|
|
| MD5 |
124840aaec570f50e7fafc2b81422354
|
|
| BLAKE2b-256 |
f8daa835e50b65275715c2a66bc3cfc786f1fc97c9317df42a6a5fd381708906
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sqrt_space_kv-0.1.0.tar.gz -
Subject digest:
58f6f7f0d042452d14cb35eee45c415e4a890c81438c9ef28a75cb60305e6de7 - Sigstore transparency entry: 2198329342
- Sigstore integration time:
-
Permalink:
com-junkawasaki/sqrt-space-kv@ed196624e9d956b73ae7783c84053ab522b360bd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/com-junkawasaki
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ed196624e9d956b73ae7783c84053ab522b360bd -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adff86fed3631dab9c4975d0f58602e0bb6bdd0fc9639e730027b96a1b8da5c6
|
|
| MD5 |
f2aaee53c3d4dc188104e63a9af198ec
|
|
| BLAKE2b-256 |
7f07914be4c49b9a7bf9aee7a9614198c5289490bcfd3f62e8e1b5a99c9134f0
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sqrt_space_kv-0.1.0-py3-none-any.whl -
Subject digest:
adff86fed3631dab9c4975d0f58602e0bb6bdd0fc9639e730027b96a1b8da5c6 - Sigstore transparency entry: 2198329588
- Sigstore integration time:
-
Permalink:
com-junkawasaki/sqrt-space-kv@ed196624e9d956b73ae7783c84053ab522b360bd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/com-junkawasaki
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ed196624e9d956b73ae7783c84053ab522b360bd -
Trigger Event:
push
-
Statement type: