evalmetry 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- evalmetry-1.0.0/LICENSE +21 -0
- evalmetry-1.0.0/PKG-INFO +94 -0
- evalmetry-1.0.0/README.md +55 -0
- evalmetry-1.0.0/evalmetry/__init__.py +27 -0
- evalmetry-1.0.0/evalmetry/adapters.py +576 -0
- evalmetry-1.0.0/evalmetry/backend.py +942 -0
- evalmetry-1.0.0/evalmetry/benchmarks.py +261 -0
- evalmetry-1.0.0/evalmetry/debug.py +1421 -0
- evalmetry-1.0.0/evalmetry/hooks.py +782 -0
- evalmetry-1.0.0/evalmetry/judges.py +273 -0
- evalmetry-1.0.0/evalmetry/main.py +1504 -0
- evalmetry-1.0.0/evalmetry/models.py +209 -0
- evalmetry-1.0.0/evalmetry/module_stats.py +1084 -0
- evalmetry-1.0.0/evalmetry/recorder.py +556 -0
- evalmetry-1.0.0/evalmetry/reducers.py +578 -0
- evalmetry-1.0.0/evalmetry/report.py +2193 -0
- evalmetry-1.0.0/evalmetry/storage.py +1546 -0
- evalmetry-1.0.0/evalmetry.egg-info/PKG-INFO +94 -0
- evalmetry-1.0.0/evalmetry.egg-info/SOURCES.txt +23 -0
- evalmetry-1.0.0/evalmetry.egg-info/dependency_links.txt +1 -0
- evalmetry-1.0.0/evalmetry.egg-info/entry_points.txt +2 -0
- evalmetry-1.0.0/evalmetry.egg-info/requires.txt +22 -0
- evalmetry-1.0.0/evalmetry.egg-info/top_level.txt +1 -0
- evalmetry-1.0.0/pyproject.toml +62 -0
- evalmetry-1.0.0/setup.cfg +4 -0
evalmetry-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Evalmetry contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
evalmetry-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: evalmetry
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A research toolkit for measuring and analyzing model behavior.
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/minguinho26/evalmetry
|
|
7
|
+
Project-URL: Repository, https://github.com/minguinho26/evalmetry
|
|
8
|
+
Project-URL: Issues, https://github.com/minguinho26/evalmetry/issues
|
|
9
|
+
Project-URL: Releases, https://github.com/minguinho26/evalmetry/releases
|
|
10
|
+
Keywords: lm-eval,language-models,evaluation,interpretability
|
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: lm-eval[hf]==0.4.13
|
|
18
|
+
Requires-Dist: torch>=2.1
|
|
19
|
+
Requires-Dist: transformers==5.16.1
|
|
20
|
+
Requires-Dist: pyarrow>=14
|
|
21
|
+
Requires-Dist: pandas>=2.0
|
|
22
|
+
Requires-Dist: safetensors>=0.4
|
|
23
|
+
Requires-Dist: matplotlib>=3.7
|
|
24
|
+
Requires-Dist: sentencepiece
|
|
25
|
+
Requires-Dist: protobuf
|
|
26
|
+
Requires-Dist: pyyaml
|
|
27
|
+
Requires-Dist: tqdm
|
|
28
|
+
Provides-Extra: pinned-latest
|
|
29
|
+
Requires-Dist: lm-eval==0.4.13; extra == "pinned-latest"
|
|
30
|
+
Requires-Dist: transformers==5.16.1; extra == "pinned-latest"
|
|
31
|
+
Requires-Dist: accelerate; extra == "pinned-latest"
|
|
32
|
+
Requires-Dist: pyarrow==25.0.1; extra == "pinned-latest"
|
|
33
|
+
Requires-Dist: pandas==3.0.5; extra == "pinned-latest"
|
|
34
|
+
Requires-Dist: safetensors==0.8.0; extra == "pinned-latest"
|
|
35
|
+
Requires-Dist: matplotlib==3.11.1; extra == "pinned-latest"
|
|
36
|
+
Requires-Dist: sentencepiece; extra == "pinned-latest"
|
|
37
|
+
Requires-Dist: protobuf; extra == "pinned-latest"
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
|
|
40
|
+
# Evalmetry
|
|
41
|
+
|
|
42
|
+
A research toolkit for measuring and analyzing model behavior.
|
|
43
|
+
|
|
44
|
+
Evalmetry evaluates Hugging Face language models with lm-eval and collects internal signals from the same forward passes used for scoring.
|
|
45
|
+
|
|
46
|
+
## Features
|
|
47
|
+
|
|
48
|
+
- Benchmark scores with per-layer logit lens and layer similarity.
|
|
49
|
+
- Optional attention, hidden states, custom hooks and module statistics.
|
|
50
|
+
- Custom benchmarks, LLM judge scoring and modified-model adapters.
|
|
51
|
+
- Resumable runs, saved-data readers and comparison reports.
|
|
52
|
+
|
|
53
|
+
Model evaluation supports one process on one CUDA GPU. CPU execution is for test fixtures and verification tools. Reports and saved-data readers do not require a GPU.
|
|
54
|
+
|
|
55
|
+
## Install
|
|
56
|
+
|
|
57
|
+
Install from PyPI in your Python environment:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pip install evalmetry
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Evalmetry requires Python >=3.10. Use a compatible CUDA build of PyTorch. The Python import and CLI are both `evalmetry`.
|
|
64
|
+
|
|
65
|
+
To install this release explicitly, use `pip install evalmetry==1.0.0`.
|
|
66
|
+
For development, clone this repository and run `python -m pip install -e .`.
|
|
67
|
+
|
|
68
|
+
## Quick start
|
|
69
|
+
|
|
70
|
+
Use `run` to evaluate eight documents and save the default signals:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
evalmetry run --model-args pretrained=Qwen/Qwen3-0.6B,dtype=bfloat16,device=cuda \
|
|
74
|
+
--tasks arc_easy --num-fewshot 0 --limit 8 --batch-size 1 \
|
|
75
|
+
--output results/quickstart
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Use `report` to generate a report from that run:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
evalmetry report results/quickstart --output report/quickstart
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The first run downloads the model and dataset if needed. Reusing a run directory resumes its recorded configuration; use a different directory for a different experiment.
|
|
85
|
+
|
|
86
|
+
Other commands: `collect-research-data` adds optional tensors to a completed run, `debug` reads a saved module trace, and `module-stats` reads saved statistics. Traces and statistics must be enabled during collection. Use `evalmetry <command> --help` for options.
|
|
87
|
+
|
|
88
|
+
## Reading results
|
|
89
|
+
|
|
90
|
+
Evaluation results, manifests and collected signals are written under the selected output directory. Read saved signals with `evalmetry.load_signals(run_dir)`; `evalmetry.describe_schema()` describes the columns.
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
Evalmetry is released under the MIT License.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Evalmetry
|
|
2
|
+
|
|
3
|
+
A research toolkit for measuring and analyzing model behavior.
|
|
4
|
+
|
|
5
|
+
Evalmetry evaluates Hugging Face language models with lm-eval and collects internal signals from the same forward passes used for scoring.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Benchmark scores with per-layer logit lens and layer similarity.
|
|
10
|
+
- Optional attention, hidden states, custom hooks and module statistics.
|
|
11
|
+
- Custom benchmarks, LLM judge scoring and modified-model adapters.
|
|
12
|
+
- Resumable runs, saved-data readers and comparison reports.
|
|
13
|
+
|
|
14
|
+
Model evaluation supports one process on one CUDA GPU. CPU execution is for test fixtures and verification tools. Reports and saved-data readers do not require a GPU.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
Install from PyPI in your Python environment:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install evalmetry
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Evalmetry requires Python >=3.10. Use a compatible CUDA build of PyTorch. The Python import and CLI are both `evalmetry`.
|
|
25
|
+
|
|
26
|
+
To install this release explicitly, use `pip install evalmetry==1.0.0`.
|
|
27
|
+
For development, clone this repository and run `python -m pip install -e .`.
|
|
28
|
+
|
|
29
|
+
## Quick start
|
|
30
|
+
|
|
31
|
+
Use `run` to evaluate eight documents and save the default signals:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
evalmetry run --model-args pretrained=Qwen/Qwen3-0.6B,dtype=bfloat16,device=cuda \
|
|
35
|
+
--tasks arc_easy --num-fewshot 0 --limit 8 --batch-size 1 \
|
|
36
|
+
--output results/quickstart
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Use `report` to generate a report from that run:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
evalmetry report results/quickstart --output report/quickstart
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The first run downloads the model and dataset if needed. Reusing a run directory resumes its recorded configuration; use a different directory for a different experiment.
|
|
46
|
+
|
|
47
|
+
Other commands: `collect-research-data` adds optional tensors to a completed run, `debug` reads a saved module trace, and `module-stats` reads saved statistics. Traces and statistics must be enabled during collection. Use `evalmetry <command> --help` for options.
|
|
48
|
+
|
|
49
|
+
## Reading results
|
|
50
|
+
|
|
51
|
+
Evaluation results, manifests and collected signals are written under the selected output directory. Read saved signals with `evalmetry.load_signals(run_dir)`; `evalmetry.describe_schema()` describes the columns.
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
Evalmetry is released under the MIT License.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""Per-layer internal signal collection alongside an lm-eval benchmark run.
|
|
2
|
+
|
|
3
|
+
Scoring is lm-eval's, unchanged.
|
|
4
|
+
This package only pulls extra research signals out of the same forward passes and writes them in a fixed, self-describing format.
|
|
5
|
+
|
|
6
|
+
The reading entry point is `load_signals`; `describe_schema` prints what the columns mean.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from .storage import SCHEMA_VERSION, describe_schema, load_signals, read_manifest, read_sample_metrics
|
|
10
|
+
|
|
11
|
+
__all__ = ["SCHEMA_VERSION", "describe_schema", "load_signals", "read_manifest", "read_sample_metrics"]
|
|
12
|
+
|
|
13
|
+
from .hooks import HookSpec, HookContext
|
|
14
|
+
|
|
15
|
+
__all__ += ["HookSpec", "HookContext"]
|
|
16
|
+
|
|
17
|
+
from .models import ModelBundle, fingerprint_files
|
|
18
|
+
|
|
19
|
+
__all__ += ["ModelBundle", "fingerprint_files", "RunConfig", "run"]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def __getattr__(name):
|
|
23
|
+
"""Load evaluation entrypoints lazily so `python -m evalmetry.main` works."""
|
|
24
|
+
if name in {"RunConfig", "run"}:
|
|
25
|
+
from .main import RunConfig, cmd_run
|
|
26
|
+
return {"RunConfig": RunConfig, "run": cmd_run}[name]
|
|
27
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|