tensor-spectra 0.1.0__py3-none-any.whl
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.
- tensor_spectra/__init__.py +12 -0
- tensor_spectra/__main__.py +6 -0
- tensor_spectra/analysis/__init__.py +31 -0
- tensor_spectra/analysis/crosslayer.py +702 -0
- tensor_spectra/analysis/orchestrator.py +270 -0
- tensor_spectra/analysis/subspaces.py +26 -0
- tensor_spectra/approx/__init__.py +28 -0
- tensor_spectra/approx/combined.py +112 -0
- tensor_spectra/approx/functional.py +234 -0
- tensor_spectra/approx/low_rank.py +146 -0
- tensor_spectra/approx/orchestrator.py +118 -0
- tensor_spectra/approx/quant.py +142 -0
- tensor_spectra/cli/__init__.py +5 -0
- tensor_spectra/cli/runner.py +356 -0
- tensor_spectra/config/__init__.py +39 -0
- tensor_spectra/config/io.py +98 -0
- tensor_spectra/config/schema.py +290 -0
- tensor_spectra/data/__init__.py +68 -0
- tensor_spectra/data/base.py +85 -0
- tensor_spectra/data/records.py +43 -0
- tensor_spectra/data/ruler.py +130 -0
- tensor_spectra/data/synthetic.py +131 -0
- tensor_spectra/extraction/__init__.py +61 -0
- tensor_spectra/extraction/driver.py +110 -0
- tensor_spectra/extraction/records.py +139 -0
- tensor_spectra/extraction/registry.py +155 -0
- tensor_spectra/extraction/targets/__init__.py +17 -0
- tensor_spectra/extraction/targets/attention_probs.py +155 -0
- tensor_spectra/extraction/targets/common.py +73 -0
- tensor_spectra/extraction/targets/hidden_states.py +74 -0
- tensor_spectra/extraction/targets/kv_cache.py +269 -0
- tensor_spectra/extraction/targets/mlp.py +125 -0
- tensor_spectra/extraction/targets/queries.py +132 -0
- tensor_spectra/extraction/targets/weights.py +134 -0
- tensor_spectra/logging/__init__.py +33 -0
- tensor_spectra/logging/io.py +326 -0
- tensor_spectra/logging/result.schema.json +117 -0
- tensor_spectra/logging/serialization.py +124 -0
- tensor_spectra/models/__init__.py +20 -0
- tensor_spectra/models/introspection.py +139 -0
- tensor_spectra/models/loading.py +102 -0
- tensor_spectra/repro.py +108 -0
- tensor_spectra/spectral/__init__.py +19 -0
- tensor_spectra/spectral/engine.py +341 -0
- tensor_spectra/spectral/options.py +61 -0
- tensor_spectra/spectral/randomized.py +42 -0
- tensor_spectra/viz/__init__.py +22 -0
- tensor_spectra/viz/data.py +831 -0
- tensor_spectra/viz/figures.py +989 -0
- tensor_spectra/viz/style.py +32 -0
- tensor_spectra/web/__init__.py +24 -0
- tensor_spectra/web/app.py +301 -0
- tensor_spectra/web/data.py +321 -0
- tensor_spectra-0.1.0.dist-info/METADATA +543 -0
- tensor_spectra-0.1.0.dist-info/RECORD +57 -0
- tensor_spectra-0.1.0.dist-info/WHEEL +4 -0
- tensorspectra/__init__.py +14 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""TensorSpectra: reproducible spectral analysis for Transformer tensors."""
|
|
2
|
+
|
|
3
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
__version__ = version("tensor-spectra")
|
|
7
|
+
except PackageNotFoundError: # pragma: no cover - only used from an unpackaged source tree
|
|
8
|
+
__version__ = "0.1.0"
|
|
9
|
+
|
|
10
|
+
from tensor_spectra.repro import collect_environment, config_hash, set_global_seed
|
|
11
|
+
|
|
12
|
+
__all__ = ["__version__", "collect_environment", "config_hash", "set_global_seed"]
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""Target-independent analysis orchestration."""
|
|
2
|
+
|
|
3
|
+
from tensor_spectra.analysis.crosslayer import (
|
|
4
|
+
CrossLayerError,
|
|
5
|
+
adjusted_rand_index,
|
|
6
|
+
analyze_cross_layer,
|
|
7
|
+
cluster_similarity,
|
|
8
|
+
compare_matrices,
|
|
9
|
+
cross_target_agreement,
|
|
10
|
+
linear_cka,
|
|
11
|
+
silhouette_score,
|
|
12
|
+
similarity_matrix,
|
|
13
|
+
)
|
|
14
|
+
from tensor_spectra.analysis.orchestrator import AnalysisError, estimate_result_bytes, run
|
|
15
|
+
from tensor_spectra.analysis.subspaces import principal_angles
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
"AnalysisError",
|
|
19
|
+
"CrossLayerError",
|
|
20
|
+
"adjusted_rand_index",
|
|
21
|
+
"analyze_cross_layer",
|
|
22
|
+
"cluster_similarity",
|
|
23
|
+
"compare_matrices",
|
|
24
|
+
"cross_target_agreement",
|
|
25
|
+
"estimate_result_bytes",
|
|
26
|
+
"linear_cka",
|
|
27
|
+
"principal_angles",
|
|
28
|
+
"run",
|
|
29
|
+
"silhouette_score",
|
|
30
|
+
"similarity_matrix",
|
|
31
|
+
]
|