Approximate quantile tracking for tensors using T-Digest, with element-wise parallel updates
Project description
monatq (Python)
Python bindings for monatq — approximate quantile tracking for tensors using T-Digest, with element-wise parallel updates.
Installation
pip install monatq
To build and install from source into the active Python environment (requires maturin):
make install
Usage
The bindings accept NumPy arrays and PyTorch tensors directly (float32, CPU, contiguous).
from monatq import TensorDigest
digest = TensorDigest(shape=[3, 4], compression=100)
for tensor in my_tensors: # torch.Tensor or np.ndarray, shape [3, 4]
digest.update(tensor)
medians = digest.quantile(0.5) # list of 12 floats
p10, p90 = digest.quantiles([0.1, 0.9])
labels = digest.analyze() # e.g. ["Normal", "Uniform", ...]
digest.save("checkpoint.mq")
digest = TensorDigest.load("checkpoint.mq")
Use Cases
- Model interpretability - feed activation or weight tensors through a forward pass and query per-position quantiles to understand how individual neurons or channels behave across inputs.
- Quantization & pruning - characterise the value distribution at each position to inform bit-width selection, clipping ranges, or sparsity thresholds without storing all observations in memory.
License
Apache-2.0 - see LICENSE.
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
Built Distributions
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 monatq-0.2.2.tar.gz.
File metadata
- Download URL: monatq-0.2.2.tar.gz
- Upload date:
- Size: 40.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11e4278ad954774c76dd1021aea3cdb1f6ca216af083885c5af32645b5f7868c
|
|
| MD5 |
b0c11c6f373cea3e43fffb795b25a2ad
|
|
| BLAKE2b-256 |
99bd3e77e50f918feab6470c567f0bf6a97621cb47650bd014673ee5793b8190
|
Provenance
The following attestation bundles were made for monatq-0.2.2.tar.gz:
Publisher:
release.yml on vladim0105/monatq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
monatq-0.2.2.tar.gz -
Subject digest:
11e4278ad954774c76dd1021aea3cdb1f6ca216af083885c5af32645b5f7868c - Sigstore transparency entry: 2218839763
- Sigstore integration time:
-
Permalink:
vladim0105/monatq@989a7aad4b42b25fac88f8db8298b610df5af80f -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/vladim0105
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@989a7aad4b42b25fac88f8db8298b610df5af80f -
Trigger Event:
push
-
Statement type:
File details
Details for the file monatq-0.2.2-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: monatq-0.2.2-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 550.6 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
121f208d8ecb83f04b376c7399fb40d72793e179e2a4f185c71e06ee6b6e8d21
|
|
| MD5 |
699efa21513edaecea0a1a77bc21b1a4
|
|
| BLAKE2b-256 |
a5b1be4f4ebd28e99859e83f20e07ca15137f0c615954c131c578eeaa1ee0c6d
|
Provenance
The following attestation bundles were made for monatq-0.2.2-cp312-cp312-win_amd64.whl:
Publisher:
release.yml on vladim0105/monatq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
monatq-0.2.2-cp312-cp312-win_amd64.whl -
Subject digest:
121f208d8ecb83f04b376c7399fb40d72793e179e2a4f185c71e06ee6b6e8d21 - Sigstore transparency entry: 2218839827
- Sigstore integration time:
-
Permalink:
vladim0105/monatq@989a7aad4b42b25fac88f8db8298b610df5af80f -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/vladim0105
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@989a7aad4b42b25fac88f8db8298b610df5af80f -
Trigger Event:
push
-
Statement type:
File details
Details for the file monatq-0.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: monatq-0.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 911.7 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7de55f70f86e856a848fab9e0c001a5ea2f670a6af64f944a214380243a0742e
|
|
| MD5 |
766d78201860691b8fac2b4f3efdff5e
|
|
| BLAKE2b-256 |
6298aea94f9ef9e959d4831f9d5d1983367cdb5ba76c7351deb28275d1a0edf3
|
Provenance
The following attestation bundles were made for monatq-0.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on vladim0105/monatq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
monatq-0.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
7de55f70f86e856a848fab9e0c001a5ea2f670a6af64f944a214380243a0742e - Sigstore transparency entry: 2218839850
- Sigstore integration time:
-
Permalink:
vladim0105/monatq@989a7aad4b42b25fac88f8db8298b610df5af80f -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/vladim0105
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@989a7aad4b42b25fac88f8db8298b610df5af80f -
Trigger Event:
push
-
Statement type:
File details
Details for the file monatq-0.2.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: monatq-0.2.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 847.4 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed92c5c7088332acc4bde7df2edf9d3cfd2e867168bb4e27ea0b3d73f3cfab82
|
|
| MD5 |
2de56d28a754bab5ec7741d6729eea5c
|
|
| BLAKE2b-256 |
4f82b162ecbbad5f1b8bdeb6dcdcda0bfb89da979d0541dbbeee83ad3d1e6a72
|
Provenance
The following attestation bundles were made for monatq-0.2.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on vladim0105/monatq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
monatq-0.2.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
ed92c5c7088332acc4bde7df2edf9d3cfd2e867168bb4e27ea0b3d73f3cfab82 - Sigstore transparency entry: 2218839781
- Sigstore integration time:
-
Permalink:
vladim0105/monatq@989a7aad4b42b25fac88f8db8298b610df5af80f -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/vladim0105
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@989a7aad4b42b25fac88f8db8298b610df5af80f -
Trigger Event:
push
-
Statement type:
File details
Details for the file monatq-0.2.2-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.
File metadata
- Download URL: monatq-0.2.2-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.12, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e0b8f4bb81b952da72cce314f5976a5a2ccc49f645c7c52e245f60e5e34bf0e
|
|
| MD5 |
7d7c54d3a7a69193e9575d06280910de
|
|
| BLAKE2b-256 |
3b7b7833dd6ac1d9ec79ef84b953a7384870adb47c52d48b23dac4f87faedbfe
|
Provenance
The following attestation bundles were made for monatq-0.2.2-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:
Publisher:
release.yml on vladim0105/monatq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
monatq-0.2.2-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl -
Subject digest:
5e0b8f4bb81b952da72cce314f5976a5a2ccc49f645c7c52e245f60e5e34bf0e - Sigstore transparency entry: 2218839801
- Sigstore integration time:
-
Permalink:
vladim0105/monatq@989a7aad4b42b25fac88f8db8298b610df5af80f -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/vladim0105
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@989a7aad4b42b25fac88f8db8298b610df5af80f -
Trigger Event:
push
-
Statement type: