Skip to main content

metrik-torch

Observed ModelGraph extraction from a real nn.Module tree.

$ pip install "metrik-torch[torch]"
$ metrik explore ./models/TinyLlama-1.1B --loader torch

The counterpart to metrik-explorer, which reads safetensors headers and config.json and never imports torch. This package walks the actual module tree, so module classes, parameter ownership, and weight tying are observed facts rather than claims from a config file.

Tying in particular: an untied lm_head has exactly the same shape as the embedding it does not share, so shape is not evidence. Here it is established by storage identity.

What it still does not know

Dataflow. nn.Module records containment, not what feeds what, so edges is None and fidelity is structural. Recovering real edges needs tracing, which breaks on the dynamic control flow most model implementations have. A consumer that needs edges checks fidelity and refuses rather than reading a containment tree as a dataflow graph.

No forward pass, no device transfer, no weight value read — module structure and parameter metadata only.

Why torch is an optional extra

uv sync --all-packages --dev stays torch-free so the CI matrix keeps running in about a minute. One dedicated job installs the extra and exercises extraction. See ADR 007.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metrik_torch-0.1.1.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

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

metrik_torch-0.1.1-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file metrik_torch-0.1.1.tar.gz.

File metadata

  • Download URL: metrik_torch-0.1.1.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for metrik_torch-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d9a34f62ac11cb5e399a1a5f58ae27e224137836cf9d79d0563140dd475546e7
MD5 7672862ab0137adb2e76ad5c0426e4c4
BLAKE2b-256 cd704433a1a7980de0125086a862bae32e4b1946316b1ddcdf91b92c656c3e78

See more details on using hashes here.

Provenance

The following attestation bundles were made for metrik_torch-0.1.1.tar.gz:

Publisher: release.yml on Asmodeus14/Metrik

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

File details

Details for the file metrik_torch-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: metrik_torch-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for metrik_torch-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b3e0a4d97799cb3465479ed40a231f9c612821322f41284b11472b87358f50f2
MD5 a85723f63adec279ba2c7061391a488f
BLAKE2b-256 b7b32e4a6264b986f1e4394987baabcae9baa869f8e304e9a6c9ae1d8f5808f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for metrik_torch-0.1.1-py3-none-any.whl:

Publisher: release.yml on Asmodeus14/Metrik

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