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.0.tar.gz (39.0 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.0-cp312-cp312-win_amd64.whl (536.3 kB view details)

Uploaded CPython 3.12Windows x86-64

monatq-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (898.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

monatq-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (835.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

monatq-0.2.0-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.0.tar.gz.

File metadata

  • Download URL: monatq-0.2.0.tar.gz
  • Upload date:
  • Size: 39.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for monatq-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6e4082bc26dffbbc56e20cf7c1786bbbc6cd5ca75e3ca79dfc9ff91594b520a9
MD5 6038ec588341a26259bad016d3bca607
BLAKE2b-256 473b49d2e8e4c0818bed9f7875dee9daf1980ff3e69444e65d4f13a7ee7da777

See more details on using hashes here.

Provenance

The following attestation bundles were made for monatq-0.2.0.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.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: monatq-0.2.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 536.3 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for monatq-0.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4440a7041081ddf0ae8233ab9efb8e8d171648ad9f43407cc17dc744326d8d21
MD5 a0556953c4ec88fe26155b9dcde4056a
BLAKE2b-256 de00c11a51a5deb1d5273fe3eeb2831d75135e505b75402327f8faf668434cd9

See more details on using hashes here.

Provenance

The following attestation bundles were made for monatq-0.2.0-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.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for monatq-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8ba0e4eea399aae0c72f1c9a4286bd5bd1a796fdde37432159444140ed996b97
MD5 c92cd789e46ac14cf2ed4102489a2d42
BLAKE2b-256 550181ce2ffffc767af67d4ff0ad87da27921ae573d44957a021578d0e19696a

See more details on using hashes here.

Provenance

The following attestation bundles were made for monatq-0.2.0-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.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for monatq-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f8209d56a1890f5fd802ebe29967d3eeb0de024b17e6ac80e3f505fed853998a
MD5 01c08c8b6f685445a9a3b72f4e723d6d
BLAKE2b-256 907184c3ad958e0548645d22e1a177377babd94f861f2b447d9b219df6dbfb85

See more details on using hashes here.

Provenance

The following attestation bundles were made for monatq-0.2.0-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.0-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.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 3a8bfe750fb54f91ce0e67ddac7c72e9e754f3c16a46d8a900cba958528d1cc5
MD5 a3d381063d61f3cced738ea6dfc26cc0
BLAKE2b-256 f947030fdf0b21a80e86d54aff846f5f216d7a1bb385c5f391fd422aecb56127

See more details on using hashes here.

Provenance

The following attestation bundles were made for monatq-0.2.0-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