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.1.tar.gz (40.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.1-cp312-cp312-win_amd64.whl (552.0 kB view details)

Uploaded CPython 3.12Windows x86-64

monatq-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (910.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

monatq-0.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (846.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

monatq-0.2.1-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.1.tar.gz.

File metadata

  • Download URL: monatq-0.2.1.tar.gz
  • Upload date:
  • Size: 40.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.1.tar.gz
Algorithm Hash digest
SHA256 a45ff7f4f3e64012629558edece7fe40f5e25dd5fc9eb44cfc83a21ba30c64ec
MD5 c72209c0dd3e6435eaf21af083906296
BLAKE2b-256 a0be75b12c896cb320c1a50569427da7dab081a87d443630d11543c24f61d7de

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: monatq-0.2.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 552.0 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.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 87a9410494d4844aad9fe28ba751a2e58d07c70b196110ec10f5926bad50514b
MD5 de85df4e89777cf306fdb7e05c8a2c57
BLAKE2b-256 634e27ad7eb5165630eb02448df3cc6bd2dd43932c182d5ab35332681b7bfe19

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for monatq-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4f5281135e3a6d890ccb509718837a95028b5968513b2645b2197849b9b30f12
MD5 164c86001044e4792963d1f317c5322c
BLAKE2b-256 51e209cda198e441329e1fe319cc8276b8b50ff55c15fa8ecbb6be1fb16cb49a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for monatq-0.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0f2d8b32b62adce645180fd7797b2cb7cfe484d553e293c263ff05387b8a34ff
MD5 091a2756ffd9d86748ede75221e99b82
BLAKE2b-256 4ba7bf1dde35d1d78802c7bd12ec6e1d197a4e53e0a6765c5b94c2e56cd788fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for monatq-0.2.1-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.1-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.1-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 86dde034429e922b5f76d30c33afbeabb3f252e41e6d62b4ac2c3d9faec338ca
MD5 8c0fb82804c0df062c09b10e4240a7a6
BLAKE2b-256 24f215c09cf08f807b30a1b94eeef32593a27b6d7f0934034406681d171a4d06

See more details on using hashes here.

Provenance

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