Skip to main content

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.

monatq visualizer

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

monatq-0.2.2.tar.gz (40.8 kB view details)

Uploaded Source

Built Distributions

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

monatq-0.2.2-cp312-cp312-win_amd64.whl (550.6 kB view details)

Uploaded CPython 3.12Windows x86-64

monatq-0.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (911.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

monatq-0.2.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (847.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

monatq-0.2.2-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

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

Hashes for monatq-0.2.2.tar.gz
Algorithm Hash digest
SHA256 11e4278ad954774c76dd1021aea3cdb1f6ca216af083885c5af32645b5f7868c
MD5 b0c11c6f373cea3e43fffb795b25a2ad
BLAKE2b-256 99bd3e77e50f918feab6470c567f0bf6a97621cb47650bd014673ee5793b8190

See more details on using hashes here.

Provenance

The following attestation bundles were made for monatq-0.2.2.tar.gz:

Publisher: release.yml on vladim0105/monatq

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

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

Hashes for monatq-0.2.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 121f208d8ecb83f04b376c7399fb40d72793e179e2a4f185c71e06ee6b6e8d21
MD5 699efa21513edaecea0a1a77bc21b1a4
BLAKE2b-256 a5b1be4f4ebd28e99859e83f20e07ca15137f0c615954c131c578eeaa1ee0c6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for monatq-0.2.2-cp312-cp312-win_amd64.whl:

Publisher: release.yml on vladim0105/monatq

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

File details

Details for the file monatq-0.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for monatq-0.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7de55f70f86e856a848fab9e0c001a5ea2f670a6af64f944a214380243a0742e
MD5 766d78201860691b8fac2b4f3efdff5e
BLAKE2b-256 6298aea94f9ef9e959d4831f9d5d1983367cdb5ba76c7351deb28275d1a0edf3

See more details on using hashes here.

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

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

File details

Details for the file monatq-0.2.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for monatq-0.2.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ed92c5c7088332acc4bde7df2edf9d3cfd2e867168bb4e27ea0b3d73f3cfab82
MD5 2de56d28a754bab5ec7741d6729eea5c
BLAKE2b-256 4f82b162ecbbad5f1b8bdeb6dcdcda0bfb89da979d0541dbbeee83ad3d1e6a72

See more details on using hashes here.

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

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

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

File hashes

Hashes for monatq-0.2.2-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 5e0b8f4bb81b952da72cce314f5976a5a2ccc49f645c7c52e245f60e5e34bf0e
MD5 7d7c54d3a7a69193e9575d06280910de
BLAKE2b-256 3b7b7833dd6ac1d9ec79ef84b953a7384870adb47c52d48b23dac4f87faedbfe

See more details on using hashes here.

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

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